VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Starfish on March 26, 2015, 07:16:14 AM

Title: Change Virtuemart Stock Bar to Number
Post by: Starfish on March 26, 2015, 07:16:14 AM
Good day guys

Please can someone assist me with changing the virtuemart stock bar so it displays a number not the bar.

Virtuemart 3 Joomla 2.5

Thank you
Title: Re: Change Virtuemart Stock Bar to Number
Post by: AH on March 26, 2015, 09:11:11 AM
Create yourself a template override

product category display

components/com_virtuemart/sublayouts/products.php

<div class="vm-product-rating-container">
<?php echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$showRating'product'=>$product));
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));
?>

</div>



You can remove the tooltip as this may not be required


<div class="vm-product-rating-container">

echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$product));
?>
</div>



Then create an override to the stock display

components/com_virtuemart/sublayouts/stockhandle.php

You can override this view to meet your needs

if you want the available stock value then it is

$product->product_in_stock - $product->product_ordered