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

Smarty: IF statement and "productid" variable

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-14-2008, 06:34 AM
 
carlynleigh carlynleigh is offline
 

Newbie
  
Join Date: Jun 2008
Posts: 3
 

Default Smarty: IF statement and "productid" variable

I'm trying to modify products.tpl to make it so that if one specific product number is being shown, then the "Add to cart" link acts differently.

Does anyone know the code I can use to create an IF statement to specify my specific product?

This is what I'm trying so far. The result is that my special code intended for only one product is actually displaying for all products.

Code:
<td> {if $productid = "16134"} {include file="buttons/add_to_cart.tpl" style="button" href="http://www.myURL.com"} {else} {include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"} {/if} </td>

I've also tried these (with no success):
{if $productid=16134}
{if $productid eq "16134"}

Am I using the right variable? Syntax?

Thanks!
__________________
v4.1.10
Reply With Quote
  #2  
Old 06-14-2008, 07:18 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Smarty: IF statement and "productid" variable

Should be $product.productid
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
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 06:03 AM.

   

 
X-Cart forums © 2001-2020