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

Display Out of Stock message in product_t.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-09-2007, 03:47 AM
 
Plug Plug is offline
 

Member
  
Join Date: Oct 2006
Posts: 14
 

Default Display Out of Stock message in product_t.tpl

Just wondering if there is a way to display if a product is out of stock on the product_t page.

Thanks
__________________
x-cart 4.0.19 Gold
www.the-plug.com
Reply With Quote
  #2  
Old 02-09-2007, 04:16 AM
 
balinor balinor is offline
 

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

Default Re: Display Out of Stock message in product_t.tpl

Sure, just take a look at the code in customer/main/product.tpl and use something similar on customer/main/products_t.tpl.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-09-2007, 04:21 AM
 
Plug Plug is offline
 

Member
  
Join Date: Oct 2006
Posts: 14
 

Default Re: Display Out of Stock message in product_t.tpl

Quote:
Originally Posted by balinor
Sure, just take a look at the code in customer/main/product.tpl and use something similar on customer/main/products_t.tpl.

I've tried that already and the only results I seem to be able to acheive is a blank page or every product displaying as sold out. I don't really understand the code enough to copy the correct bit.
__________________
x-cart 4.0.19 Gold
www.the-plug.com
Reply With Quote
  #4  
Old 02-09-2007, 04:58 AM
 
balinor balinor is offline
 

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

Default Re: Display Out of Stock message in product_t.tpl

Well you can't copy it directly, as the code for the product page and the products pages are different. A simple way is to just add this bit of code which will display an in-stock or out of stock message:

{if $products[product].avail le 0}Out of Stock{else}In Stock{/if}

You can use the same {if} statement to hide the price or buy now button as well.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 02-09-2007, 05:02 AM
 
Plug Plug is offline
 

Member
  
Join Date: Oct 2006
Posts: 14
 

Default Re: Display Out of Stock message in product_t.tpl

That's brilliant. Thanks for your help.
__________________
x-cart 4.0.19 Gold
www.the-plug.com
Reply With Quote
  #6  
Old 07-22-2009, 08:05 AM
 
moomal moomal is offline
 

Advanced Member
  
Join Date: Apr 2009
Posts: 98
 

Default Re: Display Out of Stock message in product_t.tpl

On 4.2, I got this to work by using:

{if $product.avail le 0}Out of Stock{else}In Stock{/if}
__________________
X-Cart Gold 4.2.0
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 03:37 PM.

   

 
X-Cart forums © 2001-2020