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

Need help creating 2 different out of stock messages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 05-31-2009, 09:34 PM
 
Hallsons Hallsons is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 84
 

Default Re: Need help creating 2 different out of stock messages

It took a little more thought than needed, but here was my solution to get the message to display in the category products list.

I replaced the code in the customer/main/buy_now.tpl:

{if $config.General.unlimited_products ne "Y" && ($product.avail le 0 or $product.avail lt $product.min_amount)}
<b>{$lng.txt_out_of_stock}</b>

with:

{if $config.General.unlimited_products ne "Y" && $product.avail eq 9999}
<b>Out of Stock by mail - pickup at nursery only</b>
{elseif $config.General.unlimited_products ne "Y" && ($product.avail le 0 or $product.avail lt $product.min_amount)}
<b>{$lng.txt_out_of_stock}</b>

And to get the same message to display in the customer/mail/product.tpl file I replaced this code:

{if $config.General.unlimited_products eq "N" and (($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq '' or $variants ne '' and $product.avail le 0)}
<script type="text/javascript" language="JavaScript 1.2">
<!--
var min_avail = 1;
var avail = 0;
var product_avail = 0;
-->
</script>
<b>{$lng.txt_out_of_stock}</b>

with:

{if $config.General.unlimited_products ne "Y" && $product.avail eq 9999}
<b>Out of Stock by mail - pickup at nursery only</b>
{elseif $config.General.unlimited_products eq "N" and (($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq '' or $variants ne '' and $product.avail le 0)}
<script type="text/javascript" language="JavaScript 1.2">
<!--
var min_avail = 1;
var avail = 0;
var product_avail = 0;
-->
</script>
<b>{$lng.txt_out_of_stock}</b>

Thank you all for your help!

Chris
__________________
Chris Wilson
4.7.10 (after 9 years with 4.1.12)
CDSEO Pro
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 10:45 PM.

   

 
X-Cart forums © 2001-2020