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)
-   -   Conditioning Additional Fields (https://forum.x-cart.com/showthread.php?t=22753)

sharingsunshine 06-24-2006 02:04 PM

Conditioning Additional Fields
 
Hello,

I have added an additional field that I want to show up only when a certain condition is met.

Please tell me where in this code I should insert the if statement it is a checkbox and how do I make it checked already?


{* $Id: register_additional_info.tpl,v 1.2 2004/05/06 11:22:31 max Exp $ *}
{if $section ne '' && $additional_fields ne '' && (($is_areas.A eq 'Y' && $section eq 'A') || $section ne 'A')}
{if $hide_header eq "" && $section eq 'A'}
<TR>
<TD height="20" colspan="3">{$lng.lbl_additional_information}<HR size="1" noshade></TD>
</TR>
{/if}
{foreach from=$additional_fields item=v}
{if $section eq $v.section && $v.avail eq 'Y'}
<TR>
<TD align="right">{$v.title|default:$v.field}</TD>
<TD>{if $v.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
{if $v.type eq 'T'}
<INPUT type="text" name="additional_values[{$v.fieldid}]" id="additional_values_{$v.fieldid}" size="32" value="{$v.value|escape}">
{elseif $v.type eq 'C'}
<INPUT type="checkbox" name="additional_values[{$v.fieldid}]" id="additional_values_{$v.fieldid}" value="Y"{if $v.value eq 'Y'} checked{/if}>
{elseif $v.type eq 'S'}
<SELECT name="additional_values[{$v.fieldid}]" id="additional_values_{$v.fieldid}">
{foreach from=$v.variants item=o}
<OPTION value='{$o|escape}'{if $v.value eq $o} selected{/if}>{$o|escape}</OPTION>
{/foreach}
</SELECT>
{/if}
{if $reg_error ne "" and $v.value eq "" && $v.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}
{/foreach}
{/if}

Thanks in advance,

Randal

balinor 06-24-2006 02:11 PM

Moving to template editing

sharingsunshine 06-24-2006 06:42 PM

Doesn't anyone happen to know how to do this?


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

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