Skip to content

Commit c9bb1d3

Browse files
committed
Fixed Issue 12225: Tier pricing tax shows only including tax
1 parent bf03292 commit c9bb1d3

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ class TierPrice extends AbstractPrice implements TierPriceInterface, BasePricePr
6161
* @var CustomerGroupRetrieverInterface
6262
*/
6363
private $customerGroupRetriever;
64+
/**
65+
* @var \Magento\Framework\App\Config\ScopeConfigInterface
66+
*/
67+
private $scopeConfig;
6468

6569
/**
6670
* @param Product $saleableItem
@@ -78,7 +82,8 @@ public function __construct(
7882
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
7983
Session $customerSession,
8084
GroupManagementInterface $groupManagement,
81-
CustomerGroupRetrieverInterface $customerGroupRetriever = null
85+
CustomerGroupRetrieverInterface $customerGroupRetriever = null,
86+
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
8287
) {
8388
$quantity = (float)$quantity ? $quantity : 1;
8489
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
@@ -91,6 +96,7 @@ public function __construct(
9196
} else {
9297
$this->customerGroup = (int) $this->customerGroupRetriever->getCustomerGroupId();
9398
}
99+
$this->scopeConfig = $scopeConfig;
94100
}
95101

96102
/**
@@ -157,6 +163,9 @@ function (&$priceData) {
157163
/* convert string value to float */
158164
$priceData['price_qty'] = $priceData['price_qty'] * 1;
159165
$priceData['price'] = $this->applyAdjustment($priceData['price']);
166+
if ($this->scopeConfig->getValue('tax/display/type') == 3) {
167+
$priceData['excl_tax_price'] = $this->applyAdjustment($priceData['excl_tax_price'], true);
168+
}
160169
}
161170
);
162171
}

app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ protected function getOptionPrices()
295295
$tierPrices[] = [
296296
'qty' => $this->localeFormat->getNumber($tierPrice['price_qty']),
297297
'price' => $this->localeFormat->getNumber($tierPrice['price']->getValue()),
298+
'excl_tax_price' => (is_object($tierPrice['excl_tax_price'])) ? $this->localeFormat->getNumber($tierPrice['excl_tax_price']->getValue()) : $tierPrice['base_price'],
298299
'percentage' => $this->localeFormat->getNumber(
299300
$tierPriceModel->getSavePercent($tierPrice['price'])
300301
),

app/code/Magento/ConfigurableProduct/view/base/templates/product/price/tier_price.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
+ '<span data-price-amount="' + priceUtils.formatPrice(item.price, currencyFormat) + '"'
1212
+ ' data-price-type=""' + ' class="price-wrapper ">'
1313
+ '<span class="price">' + priceUtils.formatPrice(item.price, currencyFormat) + '</span>'
14+
+ '<span class="price"> excl. tax ' + priceUtils.formatPrice(item.excl_tax_price, currencyFormat) + '</span>
1415
+ '</span>'
1516
+ '</span>'; %>
1617
<li class="item">

0 commit comments

Comments
 (0)