SKU on CategoryGrid4

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

SKU on CategoryGrid4

Post by triplw » Mon Nov 10, 2008 8:09 pm

Is there a way to have the SKU displayed under the product's name on the category page using CategoryGrid4.aspx?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: SKU on CategoryGrid4

Post by mazhar » Tue Nov 11, 2008 5:29 am

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)));
                    }

Post Reply