diff --git a/app/code/Magento/Catalog/view/base/web/js/price-utils.js b/app/code/Magento/Catalog/view/base/web/js/price-utils.js index 7b83d12cc9804..da45e978a63f2 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-utils.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-utils.js @@ -56,6 +56,7 @@ define([ s = amount < 0 ? '-' : isShowSign ? '+' : ''; } else if (isShowSign === false) { s = ''; + pattern = '%s'; } pattern = pattern.indexOf('{sign}') < 0 ? s + pattern : pattern.replace('{sign}', s); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js index 2ca829abd72f7..5ffd7d6db524f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js @@ -21,6 +21,10 @@ define([ return priceUtils.formatPrice(price, quote.getPriceFormat()); }, + getFormattedPriceWithoutSign: function (price) { + return priceUtils.formatPrice(price, quote.getPriceFormat(), false); + }, + /** * @return {*} */ @@ -39,4 +43,4 @@ define([ return stepNavigator.isProcessed('shipping'); } }); -}); +}); \ No newline at end of file diff --git a/app/code/Magento/Tax/view/frontend/templates/order/tax.phtml b/app/code/Magento/Tax/view/frontend/templates/order/tax.phtml index b329f00973b5a..9d769cedfac8f 100644 --- a/app/code/Magento/Tax/view/frontend/templates/order/tax.phtml +++ b/app/code/Magento/Tax/view/frontend/templates/order/tax.phtml @@ -3,9 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - // @codingStandardsIgnoreFile - ?> getOrder(); @@ -26,7 +24,7 @@ getLabelProperties() ?>> escapeHtml($title) ?> - (%) + (getOrderCurrency()->formatTxt((float)$percent, ['display' => \Magento\Framework\Currency::NO_SYMBOL]) ?>%)
@@ -54,4 +52,4 @@ getValueProperties() ?> data-th="escapeHtml(__('Tax')) ?>"> formatPrice($_source->getTaxAmount()) ?> - + \ No newline at end of file diff --git a/app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/tax.js b/app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/tax.js index 2b1f387f5c8c4..18726e2c5acef 100644 --- a/app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/tax.js +++ b/app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/tax.js @@ -102,30 +102,11 @@ define([ }, /** - * @param {*} parent - * @param {*} percentage + * @param {*} percent * @return {*|String} */ - getTaxAmount: function (parent, percentage) { - var totalPercentage = 0; - - taxAmount = parent.amount; - rates = parent.rates; - _.each(rates, function (rate) { - totalPercentage += parseFloat(rate.percent); - }); - - return this.getFormattedPrice(this.getPercentAmount(taxAmount, totalPercentage, percentage)); - }, - - /** - * @param {*} amount - * @param {*} totalPercentage - * @param {*} percentage - * @return {*|String} - */ - getPercentAmount: function (amount, totalPercentage, percentage) { - return parseFloat(amount * percentage / totalPercentage); + formatTxt: function (percent) { + return this.getFormattedPriceWithoutSign(percent); }, /** diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html index 5f1ac86e38ffd..ab0effb9ff5c3 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/summary/tax.html @@ -38,22 +38,24 @@ - + - - - - - - - - + + + + + + + + + + - + \ No newline at end of file