I have styled my product listings, but want to have a search from a text box to return products as search results.
I
can do this using xslt search, but has anyone done this already? is
there a simple XSLT I can use with the same styling as the Teacommerce
starter kit so that I have the ADD TO CART buttons already linked up and
working.
Product Search
I have styled my product listings, but want to have a search from a text box to return products as search results.
I can do this using xslt search, but has anyone done this already? is there a simple XSLT I can use with the same styling as the Teacommerce starter kit so that I have the ADD TO CART buttons already linked up and working.
Many thanks
I have done this a couple of times. I'm using Umbraco Examine and the uComponent xslt search helper methods, which works fine.
Here you can read how to set up examine:
http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx
I use this small piece of xslt for my search form:
<xsl:variable name="q" select="umbraco.library:RequestQueryString('q')"/>
<xsl:variable name="searchPageId" select="$currentPage/ancestor-or-self::Lang/SearchPage/@id" />
<xsl:if test="string($searchPageId) != ''">
<form action="{umbraco.library:NiceUrl($searchPageId)}" method="get">
<input type="text" name="q" class="searchQ" value="{$q}" />
<input type="submit" class="btn" value="{umbraco.library:GetDictionaryItem('Form_Search')}" />
</form>
</xsl:if>
And this is how I get the search result:
<xsl:variable name="q" select="umbraco.library:RequestQueryString('q')"/>
<xsl:variable name="searchNodes" select="ucomponents.search:QuickSearch($q, false(), 'ProductSearcher')"/>
Now you have a bunch of products, or whatever and can display them on the website
/Rune
is working on a reply...