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)
-   -   textarea option (https://forum.x-cart.com/showthread.php?t=34150)

ARW VISIONS 09-24-2007 09:24 PM

textarea option
 
I would like to have a textarea in the product options that is multiline and wider than the default textfield. Is this possible?

balinor 09-25-2007 04:30 AM

Re: textarea option
 
Sure, just open up the modules/Product_options/customer_options.tpl and change the text box to a text field.

ARW VISIONS 09-25-2007 07:17 AM

Re: textarea option
 
I jsut want one not all of them to be textareas. I did get them all to change.

balinor 09-25-2007 07:23 AM

Re: textarea option
 
You would need to use an {if} statement to only show a textarea for one option then. Use this as a guide to how to write the {if} statement for a single option:

http://forum.x-cart.com/showthread.php?t=24417&highlight=options+pop+up

ARW VISIONS 09-25-2007 07:33 AM

Re: textarea option
 
I've been using this for a bit for the question marks next to the options. This has no change on the textarea.

{* $Id: customer_options.tpl,v 1.24 2006/04/07 05:19:21 svowl Exp $ *}
{if $product_options ne ''}
{if $nojs ne 'Y'}
<tr style="display: none;"><td>
<script type="text/javascript" language="JavaScript 1.2">
<!--
var alert_msg = '{$alert_msg}';
-->
</script>
{include file="modules/Product_Options/check_options.tpl"}
</td></tr>
{/if}

{foreach from=$product_options item=v}
{if $v.options ne '' || $v.is_modifier eq 'T'}
<tr>
<td valign="middle" height="25">{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class }{/if}</td>
<td valign="middle">
{if $cname ne ""}
{assign var="poname" value="$cname[`$v.classid`]"}
{else}
{assign var="poname" value="product_options[`$v.classid`]"}
{/if}
{if $v.is_modifier eq 'T'}
<input id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}" />
{else}
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options(); FormValidation();"{/if}>{foreach from=$v.options item=o}
<option value="{$o.optionid}"{if $o.selected eq 'Y'} selected="selected"{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} {*({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1 plain_text_message=1}{else}{$o.price_modifier}%{/if})*}{/if}</option> {/foreach}
</select>
{if $v.classtext eq 'Quantity'}
<a href="#" onClick="window.open('/options/quantity.html','','scrollbars=no,resizable=no,widt h=300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>

{elseif $v.classtext eq 'Coating'}
<a href="#" onClick="window.open('/options/coating.html','','scrollbars=no,resizable=no,width =300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>

{elseif $v.classtext eq 'Proof'}
<a href="#" onClick="window.open('/options/proof.html','','scrollbars=no,resizable=no,width=3 00,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>

{elseif $v.classtext eq 'Design'}
<a href="#" onClick="window.open('/options/design.html','','scrollbars=no,resizable=no,width= 300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>

{elseif $v.classtext eq 'Imprint'}
<a href="#" onClick="window.open('/options/imprint.html','','scrollbars=no,resizable=no,width =300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>

{elseif $v.classtext eq 'Fold'}
<a href="#" onClick="window.open('/options/fold.html','','scrollbars=yes,resizable=no,width=3 00,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>
{elseif $v.classtext eq 'Special Instructions'}
<textarea cols="25" rows="5"></textarea>

{/if}
{/if}
</td>
</tr>
<tr>
{/if}
{/foreach}
{/if}


{if $product_options_ex ne ""}
<tr>
<td colspan="2"><font id="exception_msg" color="red"></font></td>
</tr>
{if $err ne ''}
<tr>
<td colspan="2"><font class="CustomerMessage">{$lng.txt_product_options_ combinations_warn}:</font></td>
</tr>
{foreach from=$product_options_ex item=v}
<tr>
<td>{foreach from=$v item=o}{if $usertype eq "A"}{$o.class}{else}{$o.classtext}{/if}: {$o.option_name}<br />{/foreach}<br /></td>
</tr>
{/foreach}
{/if}
{/if}

balinor 09-25-2007 07:37 AM

Re: textarea option
 
I was merely linking that thread to show you how to use {if} statements for options, the mod by itself does not do anything for textareas. You need to use the {if} statement code around the textbox code, something like this:

if this option

show textarea

else

show textbox

Use the code from the thread to write those if statements.

ARW VISIONS 09-25-2007 09:41 AM

Re: textarea option
 
I tried this -

{if $v.is_modifier eq 'T'}
<input id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}" />
{elseif $v.classtext eq 'Special instructions'}
<textarea cols="25" rows="6"></textarea>
{else}
<select id="po{$v.classid}" name="{$poname}"{if $disable} disabled="disabled"{/if}{if $nojs ne 'Y'} onchange="javascript: check_options(); FormValidation();"{/if}>{foreach from=$v.options item=o}
<option value="{$o.optionid}"{if $o.selected eq 'Y'} selected="selected"{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} {*({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1 plain_text_message=1}{else}{$o.price_modifier}%{/if})*}{/if}</option> {/foreach}
</select>

Still its just a one line text box. If I change the type from text field to product option and add some blank options the textarea shows up, but the cart button will not work.. very confusing


All times are GMT -8. The time now is 11:06 AM.

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