Page MenuHomeIn-Portal Phabricator

form_options.elm.tpl
No OneTemporary

File Metadata

Created
Fri, Feb 7, 7:17 PM

form_options.elm.tpl

<!--## PRODUCT OPTIONS FORM ##-->
<inp2:m_if check="p_ShouldListOptions">
<form name="add_to_cart" method="post" id="add_to_cart" action="<inp2:m_link pass="all,p"/>">
<input type="hidden" name="events[ord]" id="events[ord]" value="OnAddToCart">
<input type="hidden" name="m_t" value="in-commerce/checkout/shop_cart">
<input type="hidden" name="p_id" value="<inp2:p_Field name="ProductId"/>">
<input type="hidden" name="product_details_template" value="<inp2:m_Get var="t"/>">
<input type="hidden" name="shop_cart_template" value="in-commerce/checkout/shop_cart">
<inp2:m_if check="p_OptionsHaveError">
<table class="warning-message fullwidth">
<tr>
<td width="30">
<img src="<inp2:m_TemplatesBase module="In-Portal"/>img/warning_icon.gif" width="21" height="18" alt=""/>
</td>
<td><span class="warning"><inp2:m_Phrase label="lu_Warning"/></span></td>
</tr>
<tr>
<td colspan="2">
<inp2:p_OptionsError required="lu_comm_OptionsRequired" not_available="lu_comm_OptionsNotAvailable"/>
</td>
</tr>
</table>
</inp2:m_if>
<inp2:m_if check="p_FieldEquals" field="OptionsSelectionMode" value="1"> <!-- Listable options (combinations) -->
<script type="text/javascript">
function BuyCombination(comb_id)
{
document.getElementById('qty[<inp2:p_Field name="ProductId"/>]['+comb_id+']').value = 1;
document.getElementById('add_to_cart').submit();
}
</script>
<inp2:m_DefineElement name="combination_option_element">
<strong><inp2:m_Param name="option_name" />: </strong>
<inp2:m_Param name="option_value" /><inp2:m_if check="m_ParamEquals" param="is_last" value="1"><inp2:m_else/>, </inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="combination_element">
<tr class="cart-item-small">
<td>
<input type="hidden" id="qty[<inp2:p_Field name="ProductId"/>][<inp2:Field name="CombinationId"/>]" name="qty[<inp2:p_Field name="ProductId"/>][<inp2:Field name="CombinationId"/>]" value="0">
<inp2:ShowCombination render_as="combination_option_element"/>
</td>
<td><inp2:Field name="FinalPrice" currency="selected"/>&nbsp;&nbsp;</td>
<td>
<a href="javascript:BuyCombination(<inp2:Field name="CombinationId"/>)"><inp2:m_Phrase label="lu_comm_BuyNow"/></a>
</td>
</tr>
</inp2:m_DefineElement>
<table style="wdith: 100%; margin: 0px;">
<tr class="cart-header">
<td><strong><inp2:m_Phrase label="lu_comm_OptionsCombination"/></strong></td>
<td><strong><inp2:m_Phrase label="lu_comm_Price"/></strong></td>
<td>&nbsp;</td>
</tr>
<inp2:poc_PrintList2 per_page="-1" render_as="combination_element" row_start_render_as="html:" row_end_render_as="html:"/>
</table>
<br/>
<inp2:m_else/> <!-- Selectable options -->
<script type="text/javascript">
function AddToCart()
{
document.getElementById('add_to_cart').submit();
}
function UpdateOptions()
{
document.getElementById('events[ord]').value = 'OnUpdateItemOptions';
document.getElementById('add_to_cart').submit();
}
</script>
<strong><inp2:m_Phrase label="lu_comm_SelectOptions"/>:</strong><br/>
<img src="<inp2:m_TemplatesBase module="In-Commerce"/>img/s.gif" width="1" height="8" alt="" /><br />
<inp2:m_DefineElement name="option_select_element">
<option value="<inp2:m_param name="id"/>" <inp2:m_param name="selected"/>><inp2:m_param name="value"/><inp2:m_if check="m_ParamEquals" name="price" value=""><inp2:m_else/>: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_if></option>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_cb_element">
<input type="checkbox" <inp2:m_param name="selected"/>
name="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>][]"
id="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]_<inp2:m_param name="id"/>"
value="<inp2:m_param name="id"/>" />
<label for="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]_<inp2:m_param name="id"/>">
<inp2:m_param name="value"/><inp2:m_if check="m_ParamEquals" name="price" value=""><inp2:m_else/>: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_if>&nbsp;&nbsp;
</label>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_radio_element">
<input type="radio" <inp2:m_param name="selected"/>
name="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]"
id="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]_<inp2:m_param name="id"/>"
value="<inp2:m_param name="id"/>" />
<label for="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]_<inp2:m_param name="id"/>">
<inp2:m_param name="value"/><inp2:m_if check="m_ParamEquals" name="price" value=""><inp2:m_else/>: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_if>&nbsp;&nbsp;
</label>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_element">
<tr>
<td style="padding-right: 10px">
<inp2:Field name="Name"/><inp2:m_if check="FieldEquals" field="Required" value="1"><span class="field-required">*</span></inp2:m_if> :
</td>
<td>
<inp2:m_if check="FieldEquals" field="OptionType" value="1"> <!-- drop-down -->
<select class="input-select" name="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]">
<option value=""></option>
<inp2:ShowOptions render_as="option_select_element" currency="selected"/>
</select>
</inp2:m_if>
<inp2:m_if check="FieldEquals" field="OptionType" value="5"> <!-- editbox -->
<input type="text" class="input-text" name="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]" value="<inp2:OptionData/>"/>
</inp2:m_if>
<inp2:m_if check="FieldEquals" field="OptionType" value="4"> <!-- textarea -->
<textarea cols="50" rows="5" class="input-textarea" name="options[<inp2:p_Field name="ProductId"/>][<inp2:Field name="ProductOptionId"/>]"><inp2:OptionData/></textarea>
</inp2:m_if>
<inp2:m_if check="FieldEquals" field="OptionType" value="6"> <!-- checkboxeS -->
<inp2:ShowOptions render_as="option_cb_element" currency="selected"/>
</inp2:m_if>
<inp2:m_if check="FieldEquals" field="OptionType" value="3"> <!-- radio buttons -->
<inp2:ShowOptions render_as="option_radio_element" currency="selected"/>
</inp2:m_if>
</td>
</tr>
</inp2:m_DefineElement>
<table class="form-data" style="margin: 0px;" >
<inp2:p_ListOptions per_page="-1" render_as="option_element" row_start_render_as="html:" row_end_render_as="html:"/>
</table>
<br />
<inp2:m_if check="p_OptionsUpdateMode">
<input type="button" class="button" onclick="javascript:UpdateOptions()" value="<inp2:m_Phrase label="lu_comm_UpdateCartItem" no_editing="1"/>" />
<!--<a href="javascript:UpdateOptions()" class="price2"><inp2:m_Phrase label="lu_comm_UpdateCartItem"/></a><br/>-->
<inp2:m_else/>
<input type="button" class="button" onclick="javascript:AddToCart()" value="<inp2:m_Phrase label="lu_comm_BuyNow" no_editing="1"/>" />
<!--<a href="javascript:AddToCart()" class="price2"><inp2:m_Phrase label="lu_comm_BuyNow"/></a><br/>-->
</inp2:m_if>
<br/><br />
</inp2:m_if>
</form>
</inp2:m_if>
<!--## /PRODUCT OPTIONS FORM ##-->

Event Timeline