VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: danilo58 on February 10, 2017, 14:28:39 PM

Title: show stock level ONLY in product detail
Post by: danilo58 on February 10, 2017, 14:28:39 PM
Hi, it is possible to show the stock level ONLY in product detail (and shopping cart) but not in category list?
Title: Re: show stock level ONLY in product detail
Post by: AH on February 10, 2017, 14:51:46 PM
Yes - you need to do a display template override

components\com_virtuemart\sublayouts\products.php

Comment this out:-

if ( VmConfig::get ('display_stock', 1)) { ?>
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<?php }
echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$product));
?>




Put the new changed file in:

templates\YOURTEMPLATE\html\com_virtuemart\sublayouts\products.php
Title: Re: show stock level ONLY in product detail
Post by: danilo58 on February 24, 2017, 12:22:09 PM
Oh, please tell me how I comment this?

if ( VmConfig::get ('display_stock', 1)) { ?>
               <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
            <?php }
            echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$product));
            ?>
Title: Re: show stock level ONLY in product detail
Post by: AH on February 24, 2017, 14:41:42 PM
Just delete it will work