From 0660c8b54ed71e6fe4be0c4bcb7ff6f11658a297 Mon Sep 17 00:00:00 2001 From: Igor Wulff Date: Mon, 19 Jun 2023 18:10:42 +0200 Subject: [PATCH] Improve share cart token retrieval --- Plugin/Api/CartGet.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plugin/Api/CartGet.php b/Plugin/Api/CartGet.php index 87b6a1a..d7febee 100644 --- a/Plugin/Api/CartGet.php +++ b/Plugin/Api/CartGet.php @@ -91,7 +91,8 @@ public function setTokenToExtensionAttributes(CartInterface $cart) } try { - $mpShareCartToken = $this->quoteFactory->create()->load($cart->getId())->getMpShareCartToken(); + $mpShareCartToken = $cart->getMpShareCartToken() + ?: $this->quoteFactory->create()->load($cart->getId())->getMpShareCartToken(); } catch (Exception $e) { return $cart; }