![]() |
Adding Quantity Available to products_t.tpl
I thought this would be simple, but I must be missing something. I would like to add the quantity available to the products_t.tpl page. I cut n' pasted the following code from the products.tpl thinking it should work the same way:
{$lng.lbl_quantity} {if $product.avail gt 0}{$product.avail}{else}{$lng.txt_no}{/if} {$lng.txt_items_available} This doesn't work for some reason, it just says " No item(s) available", which is not right because if you click further into the item it displays the quantity available correctly. I think I am missing a little piece of code but can't find it. Any help? Thanks in advance. |
Hi Weberar, please post your X-Cart version number in your signature. Edit your profile, enter version, enter password, hit save. Thanks!
|
I added the version to my signature, X-Cart Gold 4.0.12 running on Unix
|
Since that code doesn't exist in productS.tpl, I assume you mean you tried to copy it from product.tpl? You'll notice that the Smarty variables work differently in the multi-product display than they do in the product display, so you can't just copy code from one to the other. Try this:
Code:
{$lng.lbl_quantity} {if $products[product].avail gt 0}{$products[product].avail}{else}{$lng.txt_no}{/if} {$lng.txt_items_available} |
Padraic,
Works perfect, thank you so much for your help! |
| All times are GMT -8. The time now is 07:40 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.