VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: tecnocoppe on April 16, 2018, 00:32:21 AM

Title: RESOLVED: available in stock on product page
Post by: tecnocoppe on April 16, 2018, 00:32:21 AM
Hello
use of VM 3.2.14 and Joomla! 3.8.6

I would need to add, on the product page, the available quantity of the various products

up to the previous version I used in the override file in /templates/mytemplate/html/com_virtuemart/productdetails/default.php the following code:

echo "Disponibili: "; echo $this->product->product_in_stock;

but now it does not work, then I ask who is more experienced than me where I can insert the code (as long as it is still valid)

thank you and everyone for your attention

Adriano
Title: Re: available in stock on product page
Post by: Studio 42 on April 16, 2018, 10:02:03 AM
The available stock is $product->product_in_stock - $product->product_ordered
So this code should display it.
echo "Disponibili: ".($this->product->product_in_stock - $this->product->product_ordered);
Title: Re: available in stock on product page
Post by: tecnocoppe on April 18, 2018, 15:05:54 PM
Hello

Thank you for your quick answer
I tried your suggestion, but appears, for each article

Disponibilità: 0

also for those items whose availability is greater than 0

regards
Title: Re: available in stock on product page
Post by: tecnocoppe on May 02, 2018, 17:57:19 PM
Hello
thank you so much!!
now it works (I was wrong to override) :-[
regards