Skip to content

Fixed Issue 12225: Tier pricing tax shows only including tax #27953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/code/Magento/Catalog/Pricing/Price/TierPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class TierPrice extends AbstractPrice implements TierPriceInterface, BasePricePr
* @var CustomerGroupRetrieverInterface
*/
private $customerGroupRetriever;
/**
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
private $scopeConfig;

/**
* @param Product $saleableItem
Expand All @@ -78,7 +82,8 @@ public function __construct(
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
Session $customerSession,
GroupManagementInterface $groupManagement,
CustomerGroupRetrieverInterface $customerGroupRetriever = null
CustomerGroupRetrieverInterface $customerGroupRetriever = null,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
$quantity = (float)$quantity ? $quantity : 1;
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
Expand All @@ -91,6 +96,7 @@ public function __construct(
} else {
$this->customerGroup = (int) $this->customerGroupRetriever->getCustomerGroupId();
}
$this->scopeConfig = $scopeConfig;
}

/**
Expand Down Expand Up @@ -157,6 +163,9 @@ function (&$priceData) {
/* convert string value to float */
$priceData['price_qty'] = $priceData['price_qty'] * 1;
$priceData['price'] = $this->applyAdjustment($priceData['price']);
if ($this->scopeConfig->getValue('tax/display/type') == 3) {
$priceData['excl_tax_price'] = $this->applyAdjustment($priceData['excl_tax_price'], true);
}
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ protected function getOptionPrices()
$tierPrices[] = [
'qty' => $this->localeFormat->getNumber($tierPrice['price_qty']),
'price' => $this->localeFormat->getNumber($tierPrice['price']->getValue()),
'excl_tax_price' => (is_object($tierPrice['excl_tax_price'])) ? $this->localeFormat->getNumber($tierPrice['excl_tax_price']->getValue()) : $tierPrice['base_price'],
'percentage' => $this->localeFormat->getNumber(
$tierPriceModel->getSavePercent($tierPrice['price'])
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
+ '<span data-price-amount="' + priceUtils.formatPrice(item.price, currencyFormat) + '"'
+ ' data-price-type=""' + ' class="price-wrapper ">'
+ '<span class="price">' + priceUtils.formatPrice(item.price, currencyFormat) + '</span>'
+ '<span class="price"> excl. tax ' + priceUtils.formatPrice(item.excl_tax_price, currencyFormat) + '</span>
+ '</span>'
+ '</span>'; %>
<li class="item">
Expand Down