X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Product Modifier Mod (https://forum.x-cart.com/showthread.php?t=29891)

scoobie 03-22-2007 01:46 AM

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


All times are GMT -8. The time now is 01:01 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.