Hello,
i need to display stock level also in product details.
i found in page template this code:
echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$this->product));
but it doesn't work.
How can i do?
Thanks.
joomla 3.4.1 - virtuemart 3.0.9
i'm trying to put in this:
<span class="vmicon vm2-<?php echo $this->product->stock->stock_level ?>" title="<?php echo $this->product->stock->stock_tip ?>"></span>
but nothing appears.
push !
why '$this->product->stock->stock_level' not work ?
Try the following in productdetails.php view:
1) Add this code near the top of the file
// Get stock indicators
$productmodel = VmModel::getModel('product');
$stockinfo = $productmodel->getStockIndicator($this->product);
2) Then add the following code in the file at the place you like to display the stock level
<?php if ( VmConfig::get ('display_stock', 1)) { ?>
<span class="vmicon vm2-<?php echo $stockinfo->stock_level ?>" title="<?php echo $stockinfo->stock_tip ?>"></span>
<?php } ?>