BenEskew.com Just another web developer's personal weblog.

TigerDirect
7Aug/100

Display SKU in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront

ASPDNSF Version: 9 (C# + MS SQL)

By default in AspDotNetStorefront the SKU for products is not displayed or used within the product.SimpleProduct.xml XMLPackage, so if you would like to use or display it you will need to make some fine-tuned adjustments.

First:
In your product.SimpleProduct.xml XMLPackage find the lines where the Product is being handled, namely the lines starting with:

...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>

...
...

and add a new parameter call to the parameters by adding:

<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>

ex.

...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
<xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
<xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>

...
...

Now, in your XMLPackage wherever you'd like to display the SKU, simply add the following:

<xsl:value-of select="$pSKU" disable-output-escaping="yes"/>

Using this method you can call any field from the Product table including Variants, like if you simply wanted to get the ProductID so you can display it in the XMLPackage...

...set parameter for it:
<xsl:param name="pID" select="aspdnsf:GetMLValue(ProductID)"></xsl:param>

...use it:
...href="http://www.yoursite.com/EMailproduct.aspx?productid={$pID}"><img src="http://www.yoursite.com/App_Themes/Skin_1/images/Icon-Email.gif"...

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

You must be logged in to post a comment.

No trackbacks yet.