$couponCode = 'WELCOME'; //coupon name
$coupon = Mage::getModel('salesrule/coupon');
$coupon->load($couponCode, 'code');
$couponUsage = new Varien_Object();
$customerId = Mage::getSingleton('customer/session')->getCustomerId(); // get current customer id
Mage::getResourceModel('salesrule/coupon_usage')->loadByCustomerCoupon(
$couponUsage, $customerId, $coupon->getId());
echo $couponUsage->getTimesUsed();
获得某个用户使用某个coupon的次数
最新推荐文章于 2024-08-22 21:39:30 发布