Skip to content

Commit

Permalink
Provide fallback store id in OrderSaveAfter observer (#596)
Browse files Browse the repository at this point in the history
This change provides a fallback store id (the default store id for the Magento instance) in case one isn't present in the event payload.
  • Loading branch information
chapagain authored and sta1r committed Dec 5, 2022
1 parent efea592 commit ba792ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Observer/Sales/OrderSaveAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$store = $this->storeManager->getStore($storeId);
$storeName = $store->getName();
$websiteId = $store->getWebsiteId();
if (empty($storeId)) {
$storeId = $store->getId();
}
// start app emulation
$appEmulation = $this->emulationFactory->create();
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
Expand Down

0 comments on commit ba792ae

Please sign in to comment.