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

Displaying Product options using "if" statements

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-23-2011, 02:06 AM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Displaying Product options using "if" statements

I want to show Product options at different places, how to use "if" statement to control, pls?
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #2  
Old 01-23-2011, 07:30 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Displaying Product options using "if" statements

Open /skin/common_files/modules/Extra_Fields/product.tpl and use it as a guide. Turning on the debuger will help you with the variables available to use
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-23-2011, 04:15 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

I do not know how to use, would you pls give me an example?
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #4  
Old 01-23-2011, 04:51 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Displaying Product options using "if" statements

It all depends what you want to show and how
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 01-23-2011, 08:47 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

give me some examples, pls.
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #6  
Old 01-24-2011, 04:55 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Displaying Product options using "if" statements

Code:
{foreach from=$extra_fields item=v} {if $v.active eq "Y" && $v.field_value} <tr> <td class="property-name">{$v.field}</td> <td class="property-value">{$v.field_value}</td> </tr> {/if} {/foreach}

This will show only active fields with values
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 01-25-2011, 12:09 AM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

for example, i have 2 Product options , and i want to show them at differn place, how to do?
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #8  
Old 01-25-2011, 03:18 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Displaying Product options using "if" statements

Code:
{foreach from=$extra_fields item=v} {if $v.active eq "Y" && $v.field_value && $v.service_name eq "xxx"} <tr> <td class="property-name">{$v.field}</td> <td class="property-value">{$v.field_value}</td> </tr> {/if} {/foreach}

replace "xxx" with the service name for the field
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #9  
Old 01-25-2011, 12:18 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Displaying Product options using "if" statements

Is this for Product Options or Extra Fields?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #10  
Old 01-25-2011, 02:33 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Displaying Product options using "if" statements

Quote:
Originally Posted by cherie
Is this for Product Options or Extra Fields?
Silly me

Scratch all posts above - it is for extra fields not options
__________________
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 12:11 AM.

   

 
X-Cart forums © 2001-2020