Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding Quantity Available to products_t.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-26-2005, 04:26 PM
 
weberar weberar is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default 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.
Reply With Quote
  #2  
Old 02-26-2005, 04:46 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Hi Weberar, please post your X-Cart version number in your signature. Edit your profile, enter version, enter password, hit save. Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-26-2005, 05:08 PM
 
weberar weberar is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

I added the version to my signature, X-Cart Gold 4.0.12 running on Unix
__________________
X-Cart Gold 4.0.12
Unix
Reply With Quote
  #4  
Old 02-27-2005, 04:30 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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 Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 02-27-2005, 11:47 AM
 
weberar weberar is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

Padraic,

Works perfect, thank you so much for your help!
__________________
X-Cart Gold 4.0.12
Unix
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:36 AM.

   

 
X-Cart forums © 2001-2020