Skip to content

Commit aacd874

Browse files
committed
ACP2E-3536: Cart Rule with shipping condition not applying when placing order from admin
- With test
1 parent 233d683 commit aacd874

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

app/code/Magento/SalesRule/Observer/ProcessOrderCreationDataObserver.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,12 @@
99

1010
use Magento\Framework\Event\Observer;
1111
use Magento\Framework\Event\ObserverInterface;
12-
use Magento\Multicoupon\Model\Config\Config;
1312

1413
/**
1514
* Class for process order for resetting shipping flag.
1615
*/
1716
class ProcessOrderCreationDataObserver implements ObserverInterface
1817
{
19-
/**
20-
* @param Config $multiCouponConfig
21-
*/
22-
public function __construct(private Config $multiCouponConfig)
23-
{
24-
}
25-
2618
/**
2719
* Checking shipping method and resetting it if needed.
2820
*
@@ -38,8 +30,7 @@ public function execute(Observer $observer)
3830
$isVirtualQuote = $quote->isVirtual();
3931
$quoteShippingMethod = $observer->getEvent()->getShippingMethod();
4032
$checkIfCouponExists = array_key_exists('coupon', $request['order']);
41-
$noOfCouponsAvailable = $this->multiCouponConfig->getMaximumNumberOfCoupons();
42-
if (!$isVirtualQuote && !empty($quoteShippingMethod) && $checkIfCouponExists && $noOfCouponsAvailable <= 1) {
33+
if (!$isVirtualQuote && !empty($quoteShippingMethod) && $checkIfCouponExists) {
4334
$shippingAddress = $quote->getShippingAddress();
4435
$shippingAddress->setShippingMethod($quoteShippingMethod);
4536
}

0 commit comments

Comments
 (0)