2009-08-03 04:10:16 +00:00
|
|
|
{assign var=meth value=':'|explode:$VAR._page}
|
|
|
|
<!-- {$meth.0}:{$meth.1} -->
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
{$method->exe($meth.0,$meth.1)}
|
|
|
|
{if ($method->result == false) }
|
|
|
|
{$block->display('core:method_error')}
|
|
|
|
{else}
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
<div style="text-align: center;">
|
2010-11-29 22:41:08 +00:00
|
|
|
<input type="submit" onclick="addCart('cart','{$record.host}')" name="cart" value="{t}Add to Cart{/t}" class="form_button"/><br/>
|
2009-08-03 04:10:16 +00:00
|
|
|
<br/>
|
|
|
|
</div>
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2010-11-29 22:41:08 +00:00
|
|
|
<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}
|
2009-08-03 04:10:16 +00:00
|
|
|
<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">
|
2010-11-29 22:41:08 +00:00
|
|
|
<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>
|
2009-08-03 04:10:16 +00:00
|
|
|
</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">
|
2010-11-29 22:41:08 +00:00
|
|
|
<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>
|
2009-08-03 04:10:16 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
2010-11-29 22:41:08 +00:00
|
|
|
{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'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{else}
|
2010-11-29 22:41:08 +00:00
|
|
|
{include file='file:ti_product-price_type-x.tpl'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{/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'}
|
2010-11-29 22:41:08 +00:00
|
|
|
{include file='file:ti_product_attr-collect_type-0.tpl'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{elseif $attr_arr.type == '1'}
|
2010-11-29 22:41:08 +00:00
|
|
|
{include file='file:ti_product_attr-collect_type-1.tpl'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{elseif $attr_arr.type == '2'}
|
2010-11-29 22:41:08 +00:00
|
|
|
{include file='file:ti_product_attr-collect_type-2.tpl'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{/if}
|
|
|
|
{/foreach}
|
|
|
|
{/if}
|
2010-11-29 22:41:08 +00:00
|
|
|
{if $record.host}
|
2009-08-03 04:10:16 +00:00
|
|
|
<br/>
|
2010-11-29 22:41:08 +00:00
|
|
|
{include file='file:ti_product_host.tpl'}
|
2009-08-03 04:10:16 +00:00
|
|
|
{/if}
|
2010-11-29 22:41:08 +00:00
|
|
|
{if $record.prod_plugin}
|
2009-08-03 04:10:16 +00:00
|
|
|
<table>
|
|
|
|
<tr valign="top">
|
2010-11-29 22:41:08 +00:00
|
|
|
<td align="left">{osb f=plugin type=product name=$record.prod_plugin_file name_prefix=order_ data=$record.prod_plugin_data admin=true}</td>
|
2009-08-03 04:10:16 +00:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
{/if}
|
2008-11-26 22:50:40 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
<div>
|
|
|
|
<input type="hidden" id="page" name="_page" value=""/>
|
|
|
|
<input type="hidden" name="do[]" value="cart:admin_add"/>
|
2010-11-29 22:41:08 +00:00
|
|
|
<input type="hidden" name="product_id" value="{$record.id}"/>
|
2009-08-03 04:10:16 +00:00
|
|
|
<input type="hidden" name="account_id" value="{$VAR.account_id}"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
2010-11-29 22:41:08 +00:00
|
|
|
<script type="text/javascript" src="themes/default/blocks/product/product.js"></script>
|
2009-08-03 04:10:16 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
<!--
|
|
|
|
{literal}
|
|
|
|
function attrValidate(addtype) {
|
|
|
|
var val_arr = new Array(2);
|
|
|
|
var i=0;
|
2010-11-29 22:41:08 +00:00
|
|
|
|
|
|
|
{/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) {
|
2009-08-03 04:10:16 +00:00
|
|
|
document.getElementById(val_arr[ii][0]).focus();
|
2010-11-29 22:41:08 +00:00
|
|
|
|
|
|
|
if(val_arr[ii][2] == '1') {
|
|
|
|
alert('You must select an option for "'+val_arr[ii][1]+'"');
|
2009-08-03 04:10:16 +00:00
|
|
|
} else {
|
2010-11-29 22:41:08 +00:00
|
|
|
alert('You must enter a value for the product option "'+val_arr[ii][1]+'"')
|
2009-08-03 04:10:16 +00:00
|
|
|
}
|
2010-11-29 22:41:08 +00:00
|
|
|
|
2009-08-03 04:10:16 +00:00
|
|
|
return false;
|
2008-11-26 22:50:40 +00:00
|
|
|
}
|
|
|
|
}
|
2009-08-03 04:10:16 +00:00
|
|
|
|
|
|
|
// product plugin validation:
|
|
|
|
var val_plugin=false;
|
2010-11-29 22:41:08 +00:00
|
|
|
try{val_plugin = product_plugin_validate();} catch(e) {val_plugin = true;}
|
|
|
|
if (val_plugin)
|
|
|
|
doCart(addtype);
|
2008-11-26 22:50:40 +00:00
|
|
|
}
|
2009-08-03 04:10:16 +00:00
|
|
|
{/literal}
|
|
|
|
//-->
|
|
|
|
</script>
|
2008-11-26 22:50:40 +00:00
|
|
|
{/if}
|