diff --git a/app/code/Magento/Quote/Model/CouponManagement.php b/app/code/Magento/Quote/Model/CouponManagement.php index 62515a17f268b..55c21c974d6dd 100644 --- a/app/code/Magento/Quote/Model/CouponManagement.php +++ b/app/code/Magento/Quote/Model/CouponManagement.php @@ -55,6 +55,9 @@ public function set($cartId, $couponCode) if (!$quote->getItemsCount()) { throw new NoSuchEntityException(__('The "%1" Cart doesn\'t contain products.', $cartId)); } + if (!$quote->getStoreId()) { + throw new NoSuchEntityException(__('Cart isn\'t assigned to correct store')); + } $quote->getShippingAddress()->setCollectShippingRates(true); try {