Skip to content

Commit a19dcf3

Browse files
committed
ACP2E-3432: usage_limit and uses_per_customer not updating in salesrule_coupon Table
1 parent 6acfd6a commit a19dcf3

File tree

1 file changed

+7
-3
lines changed
  • app/code/Magento/SalesRule/Model/ResourceModel

1 file changed

+7
-3
lines changed

app/code/Magento/SalesRule/Model/ResourceModel/Rule.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
55
*/
6+
67
namespace Magento\SalesRule\Model\ResourceModel;
78

89
use Magento\Framework\App\ObjectManager;
@@ -187,7 +188,10 @@ protected function _afterSave(AbstractModel $object)
187188
}
188189

189190
// Update auto geterated specific coupons if exists
190-
if ($object->getUseAutoGeneration() && $object->hasDataChanges()) {
191+
if (($object->getUseAutoGeneration()
192+
|| ((int) $object->getCouponType()) === \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO
193+
) && $object->hasDataChanges()
194+
) {
191195
$this->_resourceCoupon->updateSpecificCoupons($object);
192196
}
193197
return parent::_afterSave($object);

0 commit comments

Comments
 (0)