News:

Looking for documentation? Take a look on our wiki

Main Menu

show stocklevel

Started by supermac, January 11, 2012, 11:27:17 AM

Previous topic - Next topic

supermac

The following code is taken from category php page and it shows the icon with green/yellow/red square depending on product's stock-level.
<?php if (!VmConfig::get('use_as_catalog')){?>
<div class="paddingtop8">
<span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
<span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP'?></span>
</div>
<?php }?>


I'd like to see the same thing in the productdetail page (because in VM2's productdetail page the stock quantity is strangely disappeared).... I tried to copy and paste it in the productdetail .php file, just under the product images' div, but I still can't see anything.... someone can help me to modify this code to see the icon in the detail page?

I'm not an eagle with php, so please be patient, thank you!

I understood that, following the code in product's image div, maybe
     class="vmicon vm2-<?php echo $product->stock->stock_level ?>"
should be
     class="vmicon vm2-<?php echo $this->product->stock->stock_level ?>"
removing the if statement
     <?php if (!VmConfig::get('use_as_catalog')){?>
(and the closure bracket at last row)
I tried but without any result....

I need an help  :-[

Mod edit:  bump message removed.  http://forum.virtuemart.net/index.php?topic=68489.0

supermac