Page 1 of 1

SKU on CategoryGrid4

Posted: Mon Nov 10, 2008 8:09 pm
by triplw
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

Posted: Tue Nov 11, 2008 5:29 am
by mazhar
Find the following lines of code in the CategoryGridPage4.ascx.cs file

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 />"));
                    }
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 />"));
                    }
                    //OUTPUT SKU
                    if (!String.IsNullOrEmpty(product.Sku))
                    {
                        itemTemplate1.Controls.Add(new LiteralControl(String.Format("<b>SKU: </b>{0}<br />",product.Sku)));
                    }