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)
-   -   Display Out of Stock message in product_t.tpl (https://forum.x-cart.com/showthread.php?t=28713)

Plug 02-09-2007 03:47 AM

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

balinor 02-09-2007 04:16 AM

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.

Plug 02-09-2007 04:21 AM

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.

balinor 02-09-2007 04:58 AM

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.

Plug 02-09-2007 05:02 AM

Re: Display Out of Stock message in product_t.tpl
 
That's brilliant. Thanks for your help. :mrgreen:

moomal 07-22-2009 08:05 AM

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}


All times are GMT -8. The time now is 04:38 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.