VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: heppers on April 05, 2017, 21:40:43 PM

Title: Stock Quantity
Post by: heppers on April 05, 2017, 21:40:43 PM
Apologies for the slight duplication, but im finding what i have found very difficult to follow.
I'm after a n00b/simple/dummies guide to replacing the red/amber/green stock level bars with text "Quantity in stock: X" where X obviously is the qty in stock.

I've found a few things but it says "use this line of code" but then doesn't say exactly where it needs to go.

I'd also like it to show the QTY on the product page as well as on the category page.

I'm not really a programmer so my knowledge of html/php is very limited :)

Maybe to expand...
In category view you have the product image at the top
Under that you have the product title, and next to it the traffic light stock level
Under that you have Description
Under that and to the left is Price,

Can i get the Quantitiy in stock to the right of the price?
Title: Re: Stock Quantity
Post by: GJC Web Design on April 05, 2017, 23:14:44 PM
No one can help you without versions, template and a live site would obviously help...

qty is in the product object as   $product->stock->stock_level

if u echo this you have a number

so place your code where u want to see it
Title: Re: Stock Quantity
Post by: jenkinhill on April 05, 2017, 23:39:41 PM
Yup. See http://forum.virtuemart.net/index.php?topic=128401.0
Title: Re: Stock Quantity
Post by: heppers on April 06, 2017, 07:13:54 AM
DOH! Sorry I'm running Joomla 3.6.5 and VM 3.2.1!
>Facepalm<
Title: Re: Stock Quantity
Post by: GJC Web Design on April 06, 2017, 10:29:24 AM
QuoteFor template/layout/function issues a live site url is required  <------------

how could we know what of the 100's of available templates u are using?

but my instructions above still apply.. the info is there.. u just need to display it
Title: Re: Stock Quantity
Post by: heppers on April 06, 2017, 10:32:35 AM
I'm really not awake this morning am i? The default protostar template that comes with Joomla...
Runs away to facepalm. again.
http://pedders.noip.me/bbhs/index.php/shop
Also PHP 5.6.27 :)