Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Number of Times Coupon Code is Used in Magento

Tags:

magento

How can i get number of times the coupon code is used and list of coupon codes.Is that information available in SalesRule module?

like image 860
blakcaps Avatar asked Jun 27 '11 11:06

blakcaps


1 Answers

Yes. Quite easily in fact:

$coupon = Mage::getModel('salesrule/coupon');
$coupon->load('SOMECOUPONCODE', 'code');
if($coupon->getId()) {
    $timesUsed = $coupon->getTimesUsed();
}
like image 92
Daniel Sloof Avatar answered Oct 28 '22 10:10

Daniel Sloof