View Single Post
  #1  
Old 03-22-2007, 01:46 AM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default Product Modifier Mod

In my flower website, I have several product Modifiers as options on each of the flowers. For example with each floral arrangement, I added dropdowns for chocolates, balloons, teddy bears etc. In each dropdown, the first entry was always the word Select with no value. If the customer hits the Add to cart button, every option regardless of being selected would appear in the cart and subsequent invoice. If the options were left unchanged, they would show as:-

Chocolates: Select
Balloons: Select
Teddy Bears: Select

To ensure only the options that were changed appear in the cart and invoice, you need to edit the file modules/Product_Options/display_options.tpl

Replace

{foreach from=$options item=v}
{$v.class}: {$v.option_name}
{/foreach}

with:

{foreach from=$options item=v}
{if $v.option_name ne "Select"}
{$v.class}: {$v.option_name}
{/if}
{/foreach}

also, replace

{foreach from=$options item=v}
<tr>
<td>{$v.class}:&nbsp;</td>
<td>{$v.option_name}</td>
</tr>
{/foreach}

with:

{foreach from=$options item=v}
{if $v.option_name ne "Select"}
<tr>
<td>{$v.class}:&nbsp;</td>
<td>{$v.option_name}</td>
</tr>
{/if}
{/foreach}


This code was successfully tested on version 4.1.4. Anyone wishing to view this can see it at www.floriart.com.au/shop
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote