Skip to content

Commit d2a0e9d

Browse files
committed
ACP2E-778: REST API: Product names in cart always use default store view values
1 parent fa2ac19 commit d2a0e9d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\Quote\Model\Quote\Plugin;
99

10+
use Magento\Framework\Exception\NoSuchEntityException;
1011
use Magento\Quote\Model\Quote;
1112
use Magento\Store\Model\StoreManagerInterface;
1213

@@ -36,13 +37,14 @@ public function __construct(
3637
* @param Quote $result
3738
* @return Quote
3839
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40+
* @throws NoSuchEntityException
3941
*/
4042
public function afterLoadByIdWithoutStore(Quote $subject, Quote $result): Quote
4143
{
42-
$storeId = $this->storeManager->getStore()
43-
->getId() ?: $this->storeManager->getDefaultStoreView()
44-
->getId();
45-
$result->setStoreId($storeId);
44+
$storeId = $this->storeManager->getStore()->getId();
45+
if ($storeId) {
46+
$result->setStoreId($storeId);
47+
}
4648

4749
return $result;
4850
}

0 commit comments

Comments
 (0)