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

If statement for specific option class?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 02-24-2009, 06:26 AM
 
balinor balinor is offline
 

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

Default Re: If statement for specific option class?

Thanks Victor, but it isn't for me. What version is it working for you on? This is a 4.1.10 cart.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #12  
Old 02-24-2009, 06:49 AM
 
geckoday geckoday is offline
 

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

Default Re: If statement for specific option class?

Quote:
Originally Posted by Victor D
http://www.phpbuilder.com/manual/en/language.references.pass.php
also I should mention that this is working for me
That page discusses pass by reference for function calls by using the & in the function definition. The correct page reference is http://us3.php.net/foreach which does discuss the *PHP 5 only* reference within the foreach construct. This will not work in PHP 4.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #13  
Old 02-24-2009, 06:54 AM
 
geckoday geckoday is offline
 

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

Default Re: If statement for specific option class?

Its possible you might need to use $v.classtext instead of $v.class in the smarty. classtext is what is displayed on the page. If that doesn't work add {$products|print_r} to the top of your products.tpl and take a look at the [class] and [classtext] values for the products to see whats up.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #14  
Old 02-24-2009, 07:01 AM
 
balinor balinor is offline
 

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

Default Re: If statement for specific option class?

Yep both class and classtext are 'size'. Now some of these products have both a size and flavor class - will this work when a product has both? Meaning I want it to display if size class is present by itself or in combo with another class.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #15  
Old 02-24-2009, 07:39 AM
 
geckoday geckoday is offline
 

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

Default Re: If statement for specific option class?

It scans all options for the product and if it finds one with the name size it adds the text. So it works like you want it to. Tested and working fine for me.

Did you add it to the right .tpl? Sometimes I dig around in products.tpl for a while before I notice things don't look right and remember my site uses products_t.tpl.

Other than that I can only suggest some basic troubleshooting. Replace the whole smarty {foreach} stuff that was added with some plain text to be sure its in the right spot. If that's OK replace it with {$products[product].product_options|print_r} to see if you've got the [class] variable there. If that shows the proper [class] stuff, scratch head and post back.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote

The following user thanks geckoday for this useful post:
balinor (02-24-2009)
  #16  
Old 02-24-2009, 07:51 AM
 
balinor balinor is offline
 

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

Default Re: If statement for specific option class?

Yep, did that, spit out the correct variable. So I backed up and started from scratch. This time I got rid of the |lower and it is now working. Thanks for the help guys, really appreciate it!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #17  
Old 02-24-2009, 08:03 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: If statement for specific option class?

I have really stuck with 4.1.10 till found that products_t.tpl is used for 1-column format (in admin there was 1 for number of columns to display products).

For 4.1.11 it is working perfect.
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
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 08:09 PM.

   

 
X-Cart forums © 2001-2020