Instock / Out of stock flat on category page.

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
kastnerd
Commodore (COMO)
Commodore (COMO)
Posts: 474
Joined: Wed Oct 22, 2008 9:17 am

Instock / Out of stock flat on category page.

Post by kastnerd » Wed Jul 22, 2009 1:19 pm

I am currently using CatagoryGrid4 to display my products. I would like to show the in stock / Out of stock status but no the actual inventory count.

See this page http://67.225.187.60/Arch-Rims--C21.aspx

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

Re: Instock / Out of stock flat on category page.

Post by mazhar » Fri Jul 24, 2009 6:04 am

Locate following code in your code file

Code: Select all

//OUTPUT RATING
                    if (Token.Instance.Store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)
                    {
                        itemTemplate1.Controls.Add(new LiteralControl(string.Format("<img src=\"{0}\" /><br />", NavigationHelper.GetRatingImage(product.Rating))));
                    }
and then update it as below

Code: Select all

//OUTPUT RATING
                    if (Token.Instance.Store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None)
                    {
                        itemTemplate1.Controls.Add(new LiteralControl(string.Format("<img src=\"{0}\" /><br />", NavigationHelper.GetRatingImage(product.Rating))));
                    }
if (product.InventoryMode == InventoryMode.Product)
                    { 
                        if(product.InStock > 0)
                            itemTemplate1.Controls.Add(new LiteralControl("In Stock"));
                        else
                            itemTemplate1.Controls.Add(new LiteralControl("Out Stock"));
                    }

Post Reply