您的位置:首页 > 其它

Magento--判断checkout中是否使用了coupon code

2015-07-01 15:31 274 查看
在checkout页面中,如果想判断顾客是否有使用coupon code,可以通过checkout session来进行判断。
以下代码会返回checkout中使用的coupon code或者返回空(当没有使用coupon code时)

<?php

$coupon_code = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode(); if($coupon_code){
echo "coupon used";
}else{
echo "coupon not used";
}

?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: