News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

stock level in product details

Started by guardiano78, June 13, 2015, 15:52:06 PM

Previous topic - Next topic

guardiano78

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

guardiano78

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.

mhuebler

push !

why '$this->product->stock->stock_level' not work ?

Spiros Petrakis

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 ?>
Joomla templates and extensions development
https://www.yourgeek.gr