This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/themes/default/blocks/cart/admin_view.tpl
2011-05-03 09:49:01 +10:00

83 lines
2.7 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}
{if $results <= 0}
{t}Your cart is empty, please select one or more products to continue{/t}
{else}
<script type="text/javascript">
<!--
{literal}
function changeDomainTerm(id,term) {
showIFrame('iframe',0,0,'?_page=cart:changeqty&type=3&_escape=1&id='+id+'&term='+term);
}
function changeRecurring(id,schedule) {
showIFrame('iframe',0,0,'?_page=cart:admin_changeqty&account_id='+acct+'&type=2&_escape=1&id='+id+'&schedule='+schedule);
}
function changeQuantity(id,qty) {
if(qty == "0") qty = 1;
showIFrame('iframe',0,0,'?_page=cart:admin_changeqty&account_id='+acct+'&type=1&_escape=1&id='+id+'&qty='+qty);
}
function deleteCart(id) {
document.getElementById('c'+id).style.display = 'none';
showIFrame('iframe',0,0,'?_page=cart:admin_changeqty&account_id='+acct+'&_escape=1&id='+id+'&qty=0');
}
function updatePrice(id,base,setup,qty) {
document.getElementById("quantity_"+id).value = qty;
document.getElementById("def_base_price_"+id).style.display='none';
document.getElementById("base_price_"+id).innerHTML = base;
if(document.getElementById("def_setup_price_"+id))
document.getElementById("def_setup_price_"+id).style.display='none';
if(document.getElementById("setup_price_"+id))
document.getElementById("setup_price_"+id).innerHTML = setup;
}
function ad_hoc_discount(id) {
var amount = document.getElementById('ad_hoc_discount_'+id).value;
var url = "ajax.php?do[]=checkout:admin_adddiscount&id="+id+"&amount="+amount;
http.open("GET", url, true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
try { eval(http.responseText) } catch(e) {}
}
}
http.send(null);
}
var http = getHTTPObject();
var acct = '{$VAR.account_id}';
{/literal}
//-->
</script>
<!-- LOOP THROUGH EACH RECORD -->
{foreach from=$cart item=cart}
<div id="c{$cart.id}">
{if $cart.cart_type == '2'}
{include file='file:cart_table_type_2.tpl' showadmin=true}
{elseif $cart.cart_type == '3'}
{include file='file:cart_table_type_3.tpl' showadmin=true}
{else}
{include file='file:cart_table_type_x.tpl' showadmin=true}
{/if}
<br/>
{include file='file:cart_table_assoc.tpl'}
</div>
{/foreach}
<!-- END OF RESULT LOOP -->
<iframe name="iframe" id="iframe" style="border:0px; width:0px; height:0px;" scrolling="no" ALLOWTRANSPARENCY="true" frameborder="0" src="themes/{$THEME_NAME}/IEFrameWarningBypass.htm"></iframe>
{/if}
{/if}