Skip to content

Commit

Permalink
Prevent addShippingInfo from triggering an error in integration API #195
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Oct 10, 2023
1 parent 2e812ba commit df695f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions DataLayer/Event/AddShippingInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit df695f3

Please sign in to comment.