How to show stock quantity not stock level at category page and productdetils

Started by wzyefd, September 25, 2012, 20:00:45 PM

Previous topic - Next topic

wzyefd

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?

bytelord

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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!


johnchris

Quote from: 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 ?>

Hope helps you out.

Regards

Many Thanks bytelord!

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