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

Product Category If Statement Not Working

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-07-2012, 04:31 AM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Product Category If Statement Not Working

I have this if statement on skin1/customer/main/product.tpl

{if $product.categoryid eq "1039"} All custom hoses are made to order and ship within 2 business days{/if}

and it will not work but if I change it to {if $product.categoryid = "1039"} All custom hoses are made to order and ship within 2 business days{/if} I get a error. I realize I should have eq and not = . But the statement does show in the page.

I have used this if statement like this for many sites but for some reason it will not show here. Any idea why?

This is running on x cart 4.2.0
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote
  #2  
Old 02-07-2012, 08:34 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Product Category If Statement Not Working

Have you tried without the quotes, just the number? I assume you are sure the categoryid is 1039. You should consider upgaring to the stable 4.2.x version though (4.2.0 was like a beta)
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 02-08-2012, 05:02 AM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Re: Product Category If Statement Not Working

I tried without the quotes and it did not work. This is not making sense as I have used this format for an if statement on many sites and they all work. Not sure about upgrading because it has some customization for placing products in the cart.
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote
  #4  
Old 02-08-2012, 10:08 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Product Category If Statement Not Working

Are you sure categoryid is 1039? You can list it for the product(s) in question - {$product.categoryid} - and see what the output is.
The upgrade to 4.2.3 is bug fixing upgrade, it will not mess up with any customizations you have, it is not like going to another branch
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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 02:59 PM.

   

 
X-Cart forums © 2001-2020