News:

Looking for documentation? Take a look on our wiki

Main Menu

Change Virtuemart Stock Bar to Number

Started by Starfish, March 26, 2015, 07:16:14 AM

Previous topic - Next topic

Starfish

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

AH

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



Regards
A

Joomla 3.10.11
php 8.0