Skip to content

Commit 6ad9c03

Browse files
author
mdykas
committed
issue/14056 - Coupon API not working for guest user
1 parent 48d9e3f commit 6ad9c03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Quote/Model/CouponManagement.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public function set($cartId, $couponCode)
5656
if (!$quote->getItemsCount()) {
5757
throw new NoSuchEntityException(__('Cart %1 doesn\'t contain products', $cartId));
5858
}
59+
if (!$quote->getStoreId()) {
60+
throw new NoSuchEntityException(__('Cart isn\'t assigned to correct store'));
61+
}
5962
$quote->getShippingAddress()->setCollectShippingRates(true);
6063

6164
try {

0 commit comments

Comments
 (0)