zen-cart网站,模版,采集,二次开发

首页 » ZenCart » ZenCart教程 » 阅读文章

ZenCart在线支付方式最大订单金额限制方法

2012-08-28 18:11 20320 0 发表评论
标签:


在线支付方式最大订单金额,可以有效的降低由于客户拒付,缺货退款而导致的商户不必要的损失

效果图

使用方法

includes\templates\你的模板\templates\tpl_checkout_confirmation_default.php中查找

<h1 id="checkoutConfirmDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

下,增加

<?php
$calculaterate = $db->Execute("SELECT * FROM ".TABLE_CURRENCIES.";");
while(!$calculaterate->EOF){
$rate[$calculaterate->fields['code']]=$calculaterate->fields['symbol_left'].$calculaterate->fields['symbol_right'];
$calculaterate->MoveNext();
}
$maxamount=20;//默认货币下最大订单金额
$order_tatal=$_SESSION['cart']->total+$_SESSION['shipping']['cost'];
if($order_tatal > $maxamount && $_SESSION['payment']!='westernunion'){
	$disable='disabled';
	echo '<div class="messageStackCaution larger">To protect the safety of the customer\'s credit card, online payment per order cannot exceed <span style="color:red;font-weight:bold;">'.$rate[DEFAULT_CURRENCY].$maxamount.'</span><br />please click <a href="'.zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL').'" style="color:blue">here</a> to reduce the amount of order,or please click <a href="'.zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'NONSSL').'" style="color:blue">here</a> to use Western Union payment</div>';
}
?>

查找

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"') ;?></div>

替换为

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"'.$disable) ;?></div>

注:由于没有计算优惠信息,所以实际值会略有偏差

如果你的网站没有tpl_checkout_confirmation_default.php文件做过修改,直接下载样本替换即可

相关日志:

评论 共0条 (RSS 2.0) 发表评论

  1. 暂无评论,快抢沙发吧。

发表评论

  • 
  • 插入代码

联系我 Contact Me

回到页首