X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Product Options other than dropdown box (https://forum.x-cart.com/showthread.php?t=5785)

zotechpc 12-30-2003 09:26 PM

Product Options other than dropdown box
 
Is there a way to have a better way of using the product option feature such as having the format change to radio, listbox, checkbox, or textbox with adding options of color with prices and such. it currently can do listbox dropdown and textbox with options or text. anybody let me know. I would be extremly happy.

Thanks guys!

funkydunk 01-03-2004 11:57 PM

Yeah - this is possible.

The template to change is skin1/modules/product_options/customer_options.tpl

There is html in there for the drop down box...this can be changed to a radio group html if you prefer.

Code:

{* $Id: customer_options.tpl,v 1.9 2003/11/14 11:06:33 svowl Exp $ *}
{section name=product_option loop=$product_options}
<tr>
<td valign=middle height=25>
{if $usertype eq "A"}
{ $product_options[product_option].optclass }:
{else}
{ $product_options[product_option].opttext }
{/if}
</td>
<td valign=middle>
{if $product_options[product_option].options ne ""}
{assign var="options" value=$product_options[product_option].options}

{*
<select name="{if $cname ne ""}{$cname}[{$product_options[product_option].optclass}]{else}product_options[{$product_options[product_option].optclass}]{/if}"{if $disable} disabled{/if}>
{section name=option loop=$options}
<option value={$smarty.section.option.index}{if $options[option].selected ne ""} selected{/if}>{$options[option].option}{if $options[option].surcharge ne 0} ({$options[option].surcharge|value_sign:"1"}{if $options[option].type eq "absolute"}{$config.General.currency_symbol}{$options[option].surcharge|abs_value}{else}{$options[option].surcharge|abs_value}%{/if}){/if}</option>
{/section}
</select>
*}
{section name=option loop=$options}
<label><input type="radio" name="{if $cname ne ""}{$cname}[{$product_options[product_option].optclass}]{else}product_options[{$product_options[product_option].optclass}]{/if}" value="{$smarty.section.option.index}"{if $options[option].selected ne ""} checked{/if}">
{$options[option].option}{if $options[option].surcharge ne 0} ({$options[option].surcharge|value_sign:"1"}{if $options[option].type eq "absolute"}{$config.General.currency_symbol}{$options[option].surcharge|abs_value}{else}{$options[option].surcharge|abs_value}%{/if}){/if}
</label>
{/section}

{else}
<input type=text name="product_options[{$product_options[product_option].optclass}]" size=32>
{/if}
</td>
</tr>
{/section}
{if $err eq "options" and $options_ex ne ""}
<TR>
<TD colspan=2><FONT class=CustomerMessage>Note: this product cannot be added to the cart with the following options combinations:</FONT></TD>
</TR>
<TR valign=top>
<TD colspan=2>
{section name=oi loop=$options_ex}
* {$options_ex[oi].exception}

{/section}
</TD>
</TR>
{/if}



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

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