diff --git a/CHANGELOG.md b/CHANGELOG.md index a6986a9d..12271299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Prevent addShippingInfo from triggering an error in integration API #195 @rhoerr ## [3.6.3] - 27 September 2023 ### Fixed diff --git a/DataLayer/Event/AddShippingInfo.php b/DataLayer/Event/AddShippingInfo.php index 60c5c83b..0000df72 100644 --- a/DataLayer/Event/AddShippingInfo.php +++ b/DataLayer/Event/AddShippingInfo.php @@ -37,8 +37,8 @@ public function __construct( public function get(): array { $shippingMethod = $this->cart->getShippingAddress()->getShippingMethod(); - - if (empty($shippingMethod)) { + + if (empty($shippingMethod) && $this->checkoutSession->hasQuote()) { $quoteId = $this->checkoutSession->getQuote()->getId(); $shippingMethod = $this->getShippingMethodFromQuote((int)$quoteId); }