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
  #11  
Old 01-25-2011, 04:34 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

I mean Product options, not Extra Fields.
__________________
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
  #12  
Old 01-25-2011, 07:33 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Displaying Product options using "if" statements

The method for product options is very much similar to what Steve has demonstrated for you using extra fields. Instead of looping through the extra fields array - you will do a similar loop through the product options array ($product_options). Then, understand there is an array inside the array with all the options per product

Look at /skin/common_files/modules/Product_Options/customer_options.tpl as a guide for what you want to do.

Use webmastermode on the page in question, select "show variables", look at the $product_options array for the fields available to you.

Code:
{foreach from=$product_options item=v} {$v.classid} {$v.productid} {$v.class} {$v.classtext} {$v.orderby} {$v.avail} {$v.is_modifier} {$v.class_orig} {foreach from=$v.options item=o} {$o.classid} {$o.option_name} {$o.orderby} {$o.avail} {$o.price_modifier} {$o.modifier_type} {$o.option_name_orig} {$o.optionid} {$o.selected} {/foreach} {/foreach}

If you can see in the webmastermode window exactly what you are after, you can reference it without looping. Maybe something like:

Code:
{$product_options[1].avail} {$product_options[1].options[92].option_name}


---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #13  
Old 01-26-2011, 03:00 AM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

would you please give me a full example, thanks.
__________________
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
  #14  
Old 01-27-2011, 03:43 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Displaying Product options using "if" statements

anybody knows how to do? tks in advance!
__________________
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
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:22 AM.

   

 
X-Cart forums © 2001-2020