Skip to content

Commit 764612e

Browse files
committed
#20310 change product_price_value based on tax setting
1 parent 45e3ddb commit 764612e

File tree

1 file changed

+8
-0
lines changed
  • app/code/Magento/Tax/Plugin/Checkout/CustomerData

1 file changed

+8
-0
lines changed

app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject
6868
$this->itemPriceRenderer->setItem($item);
6969
$this->itemPriceRenderer->setTemplate('checkout/cart/item/price/sidebar.phtml');
7070
$result['items'][$key]['product_price']=$this->itemPriceRenderer->toHtml();
71+
if($this->itemPriceRenderer->displayPriceExclTax()) {
72+
$result['items'][$key]['product_price_value'] = $item->getCalculationPrice();
73+
} elseif ($this->itemPriceRenderer->displayPriceInclTax()) {
74+
$result['items'][$key]['product_price_value'] = $item->getPriceInclTax();
75+
} elseif ($this->itemPriceRenderer->displayBothPrices()) {
76+
$result['items'][$key]['product_price_value']['incl_tax'] = $item->getPriceInclTax();
77+
$result['items'][$key]['product_price_value']['excl_tax'] = $item->getCalculationPrice();
78+
}
7179
}
7280
}
7381
}

0 commit comments

Comments
 (0)