我是靠谱客的博主 机智山水,这篇文章主要介绍Magento--判断checkout中是否使用了coupon code,现在分享给大家,希望可以做个参考。

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

1 <?php 
2 
3 $coupon_code = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode(); if($coupon_code){     
4     echo "coupon used"; 
5 }else{     
6     echo "coupon not used"; 
7 } 
8 
9 ?>     

转载于:https://www.cnblogs.com/mityaya/p/4613372.html

最后

以上就是机智山水最近收集整理的关于Magento--判断checkout中是否使用了coupon code的全部内容,更多相关Magento--判断checkout中是否使用了coupon内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(150)

评论列表共有 0 条评论

立即
投稿
返回
顶部