X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding Quantity Available to products_t.tpl (https://forum.x-cart.com/showthread.php?t=12444)

weberar 02-26-2005 04:26 PM

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.

balinor 02-26-2005 04:46 PM

Hi Weberar, please post your X-Cart version number in your signature. Edit your profile, enter version, enter password, hit save. Thanks!

weberar 02-26-2005 05:08 PM

I added the version to my signature, X-Cart Gold 4.0.12 running on Unix

balinor 02-27-2005 04:30 AM

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}

weberar 02-27-2005 11:47 AM

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.