Author Topic: available in stock on product page  (Read 108 times)

tecnocoppe

  • Beginner
  • *
  • Posts: 12
    • Tecnocoppe Premiazioni
  • VirtueMart Version: VM2 2.5.8
available in stock on product page
« 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 2893
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: available in stock on product page
« Reply #1 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.
Code: [Select]
echo "Disponibili: ".($this->product->product_in_stock - $this->product->product_ordered);

tecnocoppe

  • Beginner
  • *
  • Posts: 12
    • Tecnocoppe Premiazioni
  • VirtueMart Version: VM2 2.5.8
Re: available in stock on product page
« Reply #2 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