Skip to content

Commit cdc5a4a

Browse files
MC-42288: Coupon codes for existing cart price rule are not generated
- Use strict comparison
1 parent c7d6e57 commit cdc5a4a

File tree

1 file changed

+1
-1
lines changed
  • app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote

1 file changed

+1
-1
lines changed

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function execute()
8080

8181
if (!$rule->getId()) {
8282
$result['error'] = __('Rule is not defined');
83-
} elseif ($rule->getCouponType() != \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO
83+
} elseif ((int) $rule->getCouponType() !== \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO
8484
&& !$rule->getUseAutoGeneration()) {
8585
$result['error'] =
8686
__('Rule is not saved with auto generate option enabled. Please save the rule and try again.');

0 commit comments

Comments
 (0)