VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: wzyefd on September 25, 2012, 20:00:45 PM

Title: How to show stock quantity not stock level at category page and productdetils
Post by: wzyefd on September 25, 2012, 20:00:45 PM
I want to show exact stock quantity at front-end for wholesale。
If it displays stock level,the shopper doesnot get the exact quantity of this product,maybe order more than the stock, and cause the order to failure.
So can I show exact quantity at front-end?
Title: Re: How to show stock quantity not stock level at category page and productdetils
Post by: bytelord on September 25, 2012, 20:27:22 PM
Hello,

You could override your category or product details layout to show the products in stock by using some PHP. eg:

for category layout (category/default.php):
<?php echo $product->product_in_stock ?>

for product details layout (productdetails/default.php):
<?php echo $this->product->product_in_stock ?>

more information regarding templates:
http://forum.virtuemart.net/index.php?topic=97744.0
http://forum.virtuemart.net/index.php?topic=92756.0
http://forum.virtuemart.net/index.php?topic=100696.0

Hope helps you out.

Regards
Title: Re: How to show stock quantity not stock level at category page and productdetils
Post by: wzyefd on September 26, 2012, 09:51:00 AM
It works
Thanks :)
Title: Re: How to show stock quantity not stock level at category page and productdetils
Post by: johnchris on April 26, 2016, 07:50:49 AM
Quote from: bytelord on September 25, 2012, 20:27:22 PM
Hello,

You could override your category or product details (http://www.sternberglawoffice.com/west-palm-beach-personal-injury-attorney/) layout to show the products in stock by using some PHP. eg:

for category layout (category/default.php):
<?php echo $product->product_in_stock ?>

for product details layout (productdetails/default.php):
<?php echo $this->product->product_in_stock ?>

Hope helps you out.

Regards

Many Thanks bytelord!

I have got, I was looking for that. Thank you so much. It really works.