Skip to content

Commit

Permalink
fix cancel order bug (#1111)
Browse files Browse the repository at this point in the history
Co-authored-by: Dean Williams <deanwilliams@MacBook-Pro.local>
  • Loading branch information
drwilliams and Dean Williams authored Jul 28, 2020
1 parent 3d5444f commit 5a5de51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/core/Mage/SalesRule/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function sales_order_paymentCancel($observer)
Mage::getResourceModel('salesrule/coupon_usage')->updateCustomerCouponTimesUsed($customerId, $coupon->getId(), true);

// Decrement rule times_used
if ($customerCoupon = Mage::getModel('salesrule/rule_customer')->loadByCustomerRule($customerId, $coupon->getId())) {
if ($customerCoupon = Mage::getModel('salesrule/rule_customer')->loadByCustomerRule($customerId, $coupon->getRuleId())) {
$customerCoupon->setTimesUsed($customerCoupon->getTimesUsed() - 1);
$customerCoupon->save();
}
Expand Down

0 comments on commit 5a5de51

Please sign in to comment.