diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b440295..a2e5a2c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [3.3.3](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.3.2...v3.3.3) - 2021-08-26 +**BREAKING CHANGES** +### Changed +- Updated order service to set order number as a shipment custom reference instead of order ID when creating a draft. Integrations need to set an order number in the `ShopOrderService::getOrderAndShippingData`. + ## [3.3.2](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.3.1...v3.3.2) - 2021-08-24 ### Changed - Reverted Shopware code review changes. diff --git a/src/BusinessLogic/Order/OrderService.php b/src/BusinessLogic/Order/OrderService.php index f925b305..d31495aa 100644 --- a/src/BusinessLogic/Order/OrderService.php +++ b/src/BusinessLogic/Order/OrderService.php @@ -277,7 +277,7 @@ private function convertOrderToDraftDto(Order $order) $draft->contentValue = $order->getTotalPrice(); $draft->priority = $order->isHighPriority(); $draft->source = $this->configuration->getDraftSource(); - $draft->shipmentCustomReference = $order->getId(); + $draft->shipmentCustomReference = $order->getOrderNumber(); $this->addPackages($order, $draft); $methodId = $order->getShippingMethodId(); diff --git a/tests/BusinessLogic/Common/TestComponents/Order/TestShopOrderService.php b/tests/BusinessLogic/Common/TestComponents/Order/TestShopOrderService.php index 49ae78e9..87d5f4c1 100644 --- a/tests/BusinessLogic/Common/TestComponents/Order/TestShopOrderService.php +++ b/tests/BusinessLogic/Common/TestComponents/Order/TestShopOrderService.php @@ -148,6 +148,7 @@ public function getOrder($orderId, $shippingMethodId = 0, $destinationCountry = if (!isset(static::$orders[$orderId])) { $order = new Order(); $order->setId($orderId); + $order->setOrderNumber('testOrderNumber'); $order->setShipment(new Shipment()); $order->setShippingMethodId($shippingMethodId); $order->setShippingAddress(new Address()); diff --git a/tests/BusinessLogic/Order/OrderServiceTest.php b/tests/BusinessLogic/Order/OrderServiceTest.php index 09d7b923..dd86219c 100644 --- a/tests/BusinessLogic/Order/OrderServiceTest.php +++ b/tests/BusinessLogic/Order/OrderServiceTest.php @@ -168,7 +168,7 @@ public function testPrepareDraftWrongDestinationCountry() public function testPrepareDraftShippingReference() { $draft = $this->orderService->prepareDraft('test'); - self::assertEquals($draft->shipmentCustomReference, 'test'); + self::assertEquals($draft->shipmentCustomReference, 'testOrderNumber'); } /**