Yes, you're right. Only the SKUSuffix but that doesn't mean it's impossible to integrate result based on the SKU Prefix also. This would only take a little tweaking on the aspdnsf_GetProducts, page.search.xml.config or page.searchadv.xml.config; however, on this example, we'll be using the former. First, you'll need to modify the stored procedure: aspdnsf_GetProducts
Change the occurrences (2 occurrences to be exact) of this line:
Code:
or patindex(@searchstr, isnull(p.sku , '')+isnull(pv.skusuffix , '')) > 0
To:
Code:
or patindex(@searchstr,isnull(p.sku,'')) > 0
or patindex(@searchstr,isnull(pv.skusuffix,'')) > 0
Execute the stored procedure, then next, we'll modify the XML package: page.search.xml.config
Under the template /
Add the highlighted parts:
Code:
<td align="center">
<b>
<xsl:value-of select="aspdnsf:StringResource('search.aspx.7', $LocaleSetting)" disable-output-escaping="yes" />
</b>
</td>
<td align="center">
<b>
<xsl:value-of select="'SKU Suffix'" disable-output-escaping="yes" />
</b>
</td>
Note: Adding a string resource, instead of a hardcoded: SKU Suffix would be good for flexibility.
Code:
<td valign="middle" align="left" >
<a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
<xsl:value-of select="$pName" disable-output-escaping="yes" />
<xsl:if test="vName!=''">
-<xsl:value-of select="$vName" />
</xsl:if>
</a>
</td>
<td align="center">
<xsl:value-of select="SKU" />
</td>
<td align="center">
<xsl:value-of select="SKUSuffix" />
<xsl:if test="SKUSuffix!=''">
<xsl:value-of select="SKUSuffix" />
</xsl:if>
</td>
Then comment out the highlighted parts:
Code:
<td align="center">
<xsl:value-of select="SKUSuffix" />
<xsl:if test="SKUSuffix!=''">
<xsl:value-of select="SKUSuffix" />
</xsl:if>
</td>