News:

Looking for documentation? Take a look on our wiki

Main Menu

Display remain quantity of the product and not all the quantity

Started by dhatzi, June 05, 2020, 16:39:41 PM

Previous topic - Next topic

dhatzi

Hello guys,

is ti possible to display the remaining quantity of the products (quantity - sold) in product view and not the quantity of the products defined in the begginning?

Thank you in advance

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

dhatzi


dhatzi

I am asking that because in my shop if I set ie 100 pcs for an item and I do some purchases stock values remain the same 100

dhatzi

I have sell 20 pcs from an item and I had from the beginning 100 pcs set. It still displays Quantity In Stock 100 and not 80


Jörgen

Update, new install ?

VM version ?

Joomla version ?

PHP version ?

Custom Template ?

What stock values ? In front end or back end ?

If You look in back end, what does In stock say and what does booked say ?

Do you set status to shipped or eq when You ship items ?
Does this status move booked to In stock ?

Without that stock will never be decreased.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Jörgen

Your template shows "In stock" this will be in stock as long as You do not ship the items. Available items is the difference between instock and booked. This is what Your template should show instead of just instock.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

if u want stock - booked then change the call in the template 

$product->product_in_stock - $product->product_ordered
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

QuoteI have sell 20 pcs from an item and I had from the beginning 100 pcs set. It still displays Quantity In Stock 100 and not 80

Template problem and custom developping.

On override for product templatein your template:

templates/your_template/html/com_virtuemart/productdetails/default.php

find info about stock and change to:


<?php 
$stock 
$this->product->product_in_stock $this->product->product_ordered;
echo 
$stock;
?>



If you use on categoriy view then

$this->product

change to

$product
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

dhatzi