Skip to content

Commit

Permalink
fix: Remove shipping method lookup
Browse files Browse the repository at this point in the history
The plugin only uses the shipping method handle when generating the XML
document. This change removes the shipping method lookup and instead
sets the field value to whatever shipping method handle is saved for
the order.
  • Loading branch information
johnnynotsolucky committed Sep 1, 2023
1 parent c2c6a50 commit b37e54d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ public function shippingMethod(\SimpleXMLElement $order_xml, $order): void
]);
Event::trigger(static::class, self::ORDER_FIELD_EVENT, $orderFieldEvent);

if (!$orderFieldEvent->value && $shippingMethod = $order->getShippingMethod()) {
$orderFieldEvent->value = $shippingMethod->handle;
if (!$orderFieldEvent->value) {
$orderFieldEvent->value = $order->shippingMethodHandle;
}

$this->addChildWithCDATA($order_xml, 'ShippingMethod', $orderFieldEvent->value);
Expand Down

0 comments on commit b37e54d

Please sign in to comment.