Display In Stock Or Out Of Stock In Grid List

Hi all,



I would like to have “in stock” or “out of stock” to be visible in grid list.

I know that if I add in products_multicolumns.tpl following


show_add_to_cart=true




But problem with this is that next to these two signs I get add to cart, wish list and compare links and I don't want them in grid list.



So anyone knows a way to add “in stock” and “out of stock” to be shown in grid list??



thanks

Try



show_product_amount=true

nop, nothing happened. Did clearef cache…Btw, this would show the amount of products on stock, right?

Would like not to show that.

[quote name='UrKo' timestamp='1408368539' post='189834']

nop, nothing happened. Did clearef cache…Btw, this would show the amount of products on stock, right?

Would like not to show that.

[/quote]



It depends on the Settings → Appearance → Show number of available products setting.

yea I noticed I disabled that.

Will have to find the way just to show “in stock” or “out of stock” without showing the number of items

Has anyone managed to figure this out. I prefer the grid view for my store but it is annoying that you cannot see if an item is in stock or not until you go to the detailed view for each item.



I've looked through all the template files but can't seem to find what controls the “out of stock” or “in stock” label to show up.

Try this solution


  1. Open the design\themes\responsive\templates\blocks\list_templates\grid_list.tpl and replace:



{include file="common/product_data.tpl" product=$product}




with



{include file="common/product_data.tpl" product=$product show_product_amount=true}




2. Add the following code to the required place in the template:



{assign var="product_amount" value="product_amount_`$obj_id`"}
{$smarty.capture.$product_amount nofilter}




3. Save the file



4. Clear cache



5. Check the result

Awesome, thank you. Worked a treat.



I didn't end up needing the second piece of code as it now either shows “out of stock” or “add to cart” which is how I want it.



With the extra piece of code an item that is in stock will also show “availability - in stock” with the “add to cart button” which I don't think is necessary.



I did however find a little glitch which I have managed a work around for. The default products per page setting is 12. I only have one category that has more than 12 items (has 13) and for some reason the “out of stock” and “add to cart” buttons would not show unless you changed the number of items per page to 24 or viewed the second page and then went back to the first.



I just changed my default products per page to 16 and made an extra column so it is now 4 x 4 view which solves this problem.

Hi, I have the same problems, and I have applied the same solution without results, still got stock label but none instead "out of stock" label.

Suggestions?

Additional changes are required in

design/themes/responsive/templates/common/product_data.tpl

replace

{if ($product_amount > 0 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y" || $details_page}

with

{if ($product_amount > 0 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y"}