![]() |
Strange Out Of Stock Behavior on Products page
I have a fashion site with variants on most products. I display SOLD OUT on the product page, and on the products (category) page when a product is out of stock, for the most part this works. I have the following code in products.tpl to handle this:
Code:
{if $products[product].avail le 0}<div class="sellout">SOLD OUT</div>{/if} My question (finally) how can I change this behavior so it only says SOLD OUT in my product listings if ALL variants are SOLD OUT, not just when someone has the last one of something in their cart? I realise the importance of the default functionality on the product page, to prevent someone adding unavailable stock to their cart, but on the category pages it is confusing, especially when other variants might still be available. Thanks in advance. |
Re: Strange Out Of Stock Behavior on Products page
Okay, so I think I've found where I can fix this strange behavior but am wondering if anyone can think of any adverse consequences of doing this.
In include/search.php there is the following code: Code:
$in_cart = 0; When I comment out the line: Code:
$products[$k]['avail'] -= $in_cart; Code:
//$products[$k]['avail'] -= $in_cart; then it prevents the behavior I'm talking about. Can anyone think of any other consequences of doing this? |
All times are GMT -8. The time now is 01:08 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.