File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
app/code/Magento/Tax/Plugin/Checkout/CustomerData Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \Tax \Plugin \Checkout \CustomerData ;
8
8
9
+ /**
10
+ * Process quote items price, considering tax configuration.
11
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
12
+ */
9
13
class Cart
10
14
{
11
15
/**
@@ -68,6 +72,16 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject
68
72
$ this ->itemPriceRenderer ->setItem ($ item );
69
73
$ this ->itemPriceRenderer ->setTemplate ('checkout/cart/item/price/sidebar.phtml ' );
70
74
$ result ['items ' ][$ key ]['product_price ' ]=$ this ->itemPriceRenderer ->toHtml ();
75
+ if ($ this ->itemPriceRenderer ->displayPriceExclTax ()) {
76
+ $ result ['items ' ][$ key ]['product_price_value ' ] = $ item ->getCalculationPrice ();
77
+ } elseif ($ this ->itemPriceRenderer ->displayPriceInclTax ()) {
78
+ $ result ['items ' ][$ key ]['product_price_value ' ] = $ item ->getPriceInclTax ();
79
+ } elseif ($ this ->itemPriceRenderer ->displayBothPrices ()) {
80
+ //unset product price value in case price already has been set as scalar value.
81
+ unset($ result ['items ' ][$ key ]['product_price_value ' ]);
82
+ $ result ['items ' ][$ key ]['product_price_value ' ]['incl_tax ' ] = $ item ->getPriceInclTax ();
83
+ $ result ['items ' ][$ key ]['product_price_value ' ]['excl_tax ' ] = $ item ->getCalculationPrice ();
84
+ }
71
85
}
72
86
}
73
87
}
You can’t perform that action at this time.
0 commit comments