127 lines
4.1 KiB
Smarty
127 lines
4.1 KiB
Smarty
{assign var=meth value=':'|explode:$VAR._page}
|
|
<!-- {$meth.0}:{$meth.1} -->
|
|
|
|
{$method->exe($meth.0,$meth.1)}
|
|
{if ($method->result == false) }
|
|
{$block->display('core:method_error')}
|
|
{else}
|
|
|
|
<div style="text-align: center;">
|
|
<input type="submit" onclick="addCart('cart','{$record.host}')" name="cart" value="{t}Add to Cart{/t}" class="form_button"/><br/>
|
|
<br/>
|
|
</div>
|
|
|
|
<form id="view" name="view" method="post" action="" enctype="multipart/form-data">
|
|
|
|
{if $list->translate('product_translate','name,description_full','product_id',$record.id,'translate_product')}{/if}
|
|
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
|
|
<tr valign="top" class="row2">
|
|
<td><b>{$translate_product.name}</b></td>
|
|
</tr>
|
|
<tr valign="top" class="row1">
|
|
<td>{$translate_product.description_full}</td>
|
|
</tr>
|
|
</table>
|
|
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
|
|
<tr valign="top" class="row2">
|
|
<td style="width: 50%;"><b>{osb f=tf field=sku}</b></td>
|
|
<td style="width: 50%;"> </td>
|
|
</tr>
|
|
<tr valign="top" class="row1">
|
|
<td style="width: 50%;">{$record.sku}</td>
|
|
<td style="width: 50%;" valign="middle">{if $record.cart_multiple} {t}Quantity{/t}: <input name="quantity" type="text" id="quantity" value="1" size="3" maxlength="3"/>{/if}</td>
|
|
</tr>
|
|
</table>
|
|
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
|
|
<tr valign="top" class="row2">
|
|
<td style="width: 50%;"><b>{osb f=tf field=price_type}</b></td>
|
|
<td style="width: 50%;"><b>{osb f=tf field=taxable}</b></td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td style="width: 50%;">{$list->menu_staticlist('pricetype','','',$record.price_type,'form_menu')}</td>
|
|
<td style="width: 50%;">{$list->bool('',$record.taxable,'form_field')}</td>
|
|
</tr>
|
|
</table>
|
|
{if $record.price_type == '1'}
|
|
{include file='file:ti_product-price_type-1.tpl'}
|
|
{elseif $record.price_type == '2'}
|
|
{include file='file:ti_product-price_type-2.tpl'}
|
|
{else}
|
|
{include file='file:ti_product-price_type-x.tpl'}
|
|
{/if}
|
|
{if $attr}
|
|
<br/>
|
|
{foreach from=$attr item=attr_arr key=key}
|
|
{assign var=attr_id value=$attr_arr.id}
|
|
{if $attr_arr.type == '0'}
|
|
{include file='file:ti_product_attr-collect_type-0.tpl'}
|
|
{elseif $attr_arr.type == '1'}
|
|
{include file='file:ti_product_attr-collect_type-1.tpl'}
|
|
{elseif $attr_arr.type == '2'}
|
|
{include file='file:ti_product_attr-collect_type-2.tpl'}
|
|
{/if}
|
|
{/foreach}
|
|
{/if}
|
|
{if $record.host}
|
|
<br/>
|
|
{include file='file:ti_product_host.tpl'}
|
|
{/if}
|
|
{if $record.prod_plugin}
|
|
<table>
|
|
<tr valign="top">
|
|
<td align="left">{osb f=plugin type=product name=$record.prod_plugin_file name_prefix=order_ data=$record.prod_plugin_data admin=true}</td>
|
|
</tr>
|
|
</table>
|
|
{/if}
|
|
|
|
<div>
|
|
<input type="hidden" id="page" name="_page" value=""/>
|
|
<input type="hidden" name="do[]" value="cart:admin_add"/>
|
|
<input type="hidden" name="product_id" value="{$record.id}"/>
|
|
<input type="hidden" name="account_id" value="{$VAR.account_id}"/>
|
|
</div>
|
|
</form>
|
|
|
|
<script type="text/javascript" src="themes/default/blocks/product/product.js"></script>
|
|
<script type="text/javascript">
|
|
<!--
|
|
{literal}
|
|
function attrValidate(addtype) {
|
|
var val_arr = new Array(2);
|
|
var i=0;
|
|
|
|
{/literal}
|
|
{foreach from=$attr item=attr_arr key=key}
|
|
{assign var=attr_id value=$attr_arr.id}
|
|
{if $attr_arr.required == '1'}
|
|
val_arr[i] = new Array ('attr_{$attr_id}','{$attr_arr.name}','{$attr_arr.type}');
|
|
i++;
|
|
{/if}
|
|
{/foreach}
|
|
{literal}
|
|
|
|
for (ii=0; ii < i; ii++) {
|
|
if (! document.getElementById(val_arr[ii][0]).value) {
|
|
document.getElementById(val_arr[ii][0]).focus();
|
|
|
|
if(val_arr[ii][2] == '1') {
|
|
alert('You must select an option for "'+val_arr[ii][1]+'"');
|
|
} else {
|
|
alert('You must enter a value for the product option "'+val_arr[ii][1]+'"')
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// product plugin validation:
|
|
var val_plugin=false;
|
|
try{val_plugin = product_plugin_validate();} catch(e) {val_plugin = true;}
|
|
if (val_plugin)
|
|
doCart(addtype);
|
|
}
|
|
{/literal}
|
|
//-->
|
|
</script>
|
|
{/if}
|