File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -161,18 +161,19 @@ public function execute(): void
161
161
$ data = $ inputFilter ->getUnescaped ();
162
162
}
163
163
164
- $ data ['quantity ' ] = $ data ['qty ' ] ?? null ;
165
- $ couponQuantity = (int )$ this ->scopeConfig ->getValue (
164
+ $ data ['quantity ' ] = $ data ['qty ' ] ?? 0 ;
165
+ $ couponQuantityLimit = (int )$ this ->scopeConfig ->getValue (
166
166
self ::XML_CONFIG_COUPON_QUANTITY_LIMIT ,
167
167
ScopeInterface::SCOPE_STORE
168
168
);
169
- // @codingStandardsIgnoreStart
170
- if ( $ data [ ' quantity ' ] && $ data [ ' quantity ' ] > 0 && $ couponQuantity && $ data [ ' quantity ' ] > $ couponQuantity ) {
169
+ if ( $ data [ ' quantity ' ] > 0 && $ data [ ' quantity ' ] > $ couponQuantityLimit ) {
170
+ // @codingStandardsIgnoreStart
171
171
$ this ->messageManager ->addErrorMessage (
172
172
__ (
173
173
'Coupon quantity should be less than or equal to the coupon quantity in the store configuration. '
174
174
)
175
175
);
176
+ // @codingStandardsIgnoreEnd
176
177
} else {
177
178
$ couponSpec = $ this ->generationSpecFactory ->create (['data ' => $ data ]);
178
179
You can’t perform that action at this time.
0 commit comments