hi
i want to show out of stack in category view..
for example in this page
http://ninimahsool.ir/shop/دسته-بندی-محصولات/وسایل-خواب
under the title of each product if it's out of stack show out of stack!
i know i should edit templates/my_template/html/com_virtuemart/category/default.php but i don't know how!!
please help..
http://forum.virtuemart.net/index.php?topic=97744.0 I assume you mean Stock ?
yes sorry..
i mean stock
i want to add an if sentence like this:
if product stock level<1 then echo 'Out of stock'
can you help me?
I've pointed you to the relavent page with the way to obtain the stock level...
<?php
if ($product->stock->stock_level == '0') {
echo 'out of stack' ; }
?>
i added this code but no thing happen!!
i'm poor in php code writing!!
how can i write right code?
echo out $product->stock->stock_level to see what it is first .. maybe you need something in config etc
the code snippet is correct if $product->stock->stock_level exists and equals 0
but check what its value is
Simple, use this code:
// Availability
if ($product->product_in_stock == 0) { ?>
<div class="availability">
<?php echo "Out of stack"; ?>
</div>
<?php } ?>
Advanced, use VirueMart Configuration -> Action when a Product is Out of Stock.