Skip to content

Commit

Permalink
renamed variable for clarity and used defined constant for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
crankycyclops committed Mar 31, 2019
1 parent e644ea7 commit 19cc768
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
if ($purchasedLink->getId()) {
return $this;
}
$statusToEnable = $this->_scopeConfig->getValue(
$orderStatusToEnableItem = $this->_scopeConfig->getValue(
\Magento\Downloadable\Model\Link\Purchased\Item::XML_PATH_ORDER_ITEM_STATUS,
ScopeInterface::SCOPE_STORE,
$orderItem->getOrder()->getStoreId()
Expand Down Expand Up @@ -155,7 +155,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
)->setNumberOfDownloadsBought(
$numberOfDownloads
)->setStatus(
1 == $statusToEnable ?
\Magento\Sales\Model\Order\Item::STATUS_PENDING == $orderStatusToEnableItem ?
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_AVAILABLE :
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_PENDING
)->setCreatedAt(
Expand Down

0 comments on commit 19cc768

Please sign in to comment.