Skip to content

Commit

Permalink
magento#20310 change product_price_value based on tax setting
Browse files Browse the repository at this point in the history
  • Loading branch information
NickdeK authored and mage2pratik committed Mar 5, 2019
1 parent 0982a53 commit ce1c1a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject
$this->itemPriceRenderer->setItem($item);
$this->itemPriceRenderer->setTemplate('checkout/cart/item/price/sidebar.phtml');
$result['items'][$key]['product_price']=$this->itemPriceRenderer->toHtml();
if($this->itemPriceRenderer->displayPriceExclTax()) {
$result['items'][$key]['product_price_value'] = $item->getCalculationPrice();
} elseif ($this->itemPriceRenderer->displayPriceInclTax()) {
$result['items'][$key]['product_price_value'] = $item->getPriceInclTax();
} elseif ($this->itemPriceRenderer->displayBothPrices()) {
$result['items'][$key]['product_price_value']['incl_tax'] = $item->getPriceInclTax();
$result['items'][$key]['product_price_value']['excl_tax'] = $item->getCalculationPrice();
}
}
}
}
Expand Down

0 comments on commit ce1c1a2

Please sign in to comment.