Skip to content

Commit

Permalink
FRW-6369 Fixed issues with Dynamic Multistore. (#10757)
Browse files Browse the repository at this point in the history
FRW-6369 Fixed issues with Dynamic Multistore.
  • Loading branch information
olhalivitchuk authored Feb 12, 2024
1 parent 4571b83 commit 9e0631a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Spryker/Shared/Oms/Transfer/oms.transfer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
<property name="orderItems" type="OrderItem[]" singular="orderItem"/>
<property name="merchants" type="OrderMerchant[]" singular="merchant"/>
<property name="status" type="string"/>
<property name="storeName" type="string"/>
<property name="orderReference" type="string"/>
<property name="messageAttributes" type="MessageAttributes"/>
</transfer>
Expand Down
8 changes: 7 additions & 1 deletion src/Spryker/Zed/Oms/Business/OmsBusinessFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,13 @@ public function getMessageBrokerFacade()
*/
public function createOrderStatusChangedMessageSender(): OrderStatusChangedMessageSender
{
return new OrderStatusChangedMessageSender($this->getMessageBrokerFacade(), $this->getStoreFacade(), $this->getSalesFacade(), $this->getConfig(), $this->getQueryContainer());
return new OrderStatusChangedMessageSender(
$this->getMessageBrokerFacade(),
$this->getStoreFacade(),
$this->getSalesFacade(),
$this->getConfig(),
$this->getQueryContainer(),
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ protected function createOrderStatusChangedTransfer(int $idSalesOrder): OrderSta
$orderStatusChangedTransfer = new OrderStatusChangedTransfer();
$orderStatusChangedTransfer->fromArray($filteredDataFromOrder);
$orderStatusChangedTransfer->setUserName($orderTransfer->getFirstName() . ' ' . $orderTransfer->getLastName());
$orderStatusChangedTransfer->setStoreName($orderTransfer->getStoreOrFail());

$states = $orderTransfer->getItemStates();
$state = !$states ? null : end($states);
Expand Down Expand Up @@ -129,8 +130,10 @@ protected function createOrderStatusChangedTransfer(int $idSalesOrder): OrderSta
*/
protected function setMessageAttributesTransfer(OrderStatusChangedTransfer $orderStatusChangedTransfer): void
{
$storeTransfer = $this->storeFacade->getStoreByName($orderStatusChangedTransfer->getStoreNameOrFail());

$messageAttributes = new MessageAttributesTransfer();
$messageAttributes->setStoreReference($this->storeFacade->getCurrentStore()->getStoreReference());
$messageAttributes->setStoreReference($storeTransfer->getStoreReference());

$orderStatusChangedTransfer->setMessageAttributes($messageAttributes);
}
Expand Down

0 comments on commit 9e0631a

Please sign in to comment.