Skip to content

Commit

Permalink
fix to call Magento\Sales\Model\Order::getStoreId() only once
Browse files Browse the repository at this point in the history
  • Loading branch information
crankycyclops committed Apr 3, 2019
1 parent 2c16697 commit 5410e07
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ public function execute(\Magento\Framework\Event\Observer $observer)
if ($purchasedLink->getId()) {
return $this;
}
$storeId = $orderItem->getOrder()->getStoreId();
$orderStatusToEnableItem = $this->_scopeConfig->getValue(
\Magento\Downloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS,
ScopeInterface::SCOPE_STORE,
$orderItem->getOrder()->getStoreId()
$storeId
);
if (!$product) {
$product = $this->_createProductModel()->setStoreId(
$orderItem->getOrder()->getStoreId()
$storeId
)->load(
$orderItem->getProductId()
);
Expand Down

0 comments on commit 5410e07

Please sign in to comment.