SKU on CategoryGrid4
SKU on CategoryGrid4
Is there a way to have the SKU displayed under the product's name on the category page using CategoryGrid4.aspx?
Re: SKU on CategoryGrid4
Find the following lines of code in the CategoryGridPage4.ascx.cs file
and place the below code just next the above code like
Code: Select all
Product product = (Product)catalogNode.ChildObject;
//OUTPUT MANUFACTURER
if (product.Manufacturer != null)
{
itemTemplate1.Controls.Add(new LiteralControl("<a href=\"Search.aspx?m=" + product.Manufacturer.ManufacturerId + "\">by " + product.Manufacturer.Name + "</a><br />"));
}
Code: Select all
Product product = (Product)catalogNode.ChildObject;
//OUTPUT MANUFACTURER
if (product.Manufacturer != null)
{
itemTemplate1.Controls.Add(new LiteralControl("<a href=\"Search.aspx?m=" + product.Manufacturer.ManufacturerId + "\">by " + product.Manufacturer.Name + "</a><br />"));
}
//OUTPUT SKU
if (!String.IsNullOrEmpty(product.Sku))
{
itemTemplate1.Controls.Add(new LiteralControl(String.Format("<b>SKU: </b>{0}<br />",product.Sku)));
}