arturobelver Posted September 9, 2014 Share Posted September 9, 2014 (edited) Hi! I want show the quantity available of product in product-list.tpl on grid and list view. Can you help me? Thanks Edited September 10, 2014 by arturobelver (see edit history) Link to comment Share on other sites More sharing options...
arturobelver Posted September 9, 2014 Author Share Posted September 9, 2014 up Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2014 Share Posted September 9, 2014 just use {$product.quantity} variable use it there, where you want to display quantity value. for example, right below the product name: <h5 itemprop="name"> {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" > {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} </a> </h5> Link to comment Share on other sites More sharing options...
arturobelver Posted September 10, 2014 Author Share Posted September 10, 2014 just use {$product.quantity} variable use it there, where you want to display quantity value. for example, right below the product name: <h5 itemprop="name"> {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" > {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} </a> </h5> Solved! Thanks <h5 itemprop="name"> {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" > {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} </a> <BR/> Stock: {$product.quantity} </h5> Link to comment Share on other sites More sharing options...
vekia Posted September 10, 2014 Share Posted September 10, 2014 awesome :-) thank you for working code snippet, you can also use {l s='Stock'} then you will be able to translate "stock" to other languages (if you use them of course) 1 Link to comment Share on other sites More sharing options...
Recommended Posts