Skip to content

Commit 59d5d30

Browse files
fix excl price format
1 parent bc6c2d6 commit 59d5d30

File tree

2 files changed

+26
-35
lines changed
  • app
    • code/Magento/ConfigurableProduct/view/base/templates/product/price
    • design/frontend/Magento/blank/web/css/source

2 files changed

+26
-35
lines changed

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

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,34 @@
66
?>
77
<script type="text/x-magento-template" id="tier-prices-template">
88
<ul class="prices-tier items">
9+
<% var exclPrice = ' <span class="price-wrapper price-excluding-tax"'
10+
+ 'data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">'
11+
+ '<span class="price">&nbsp;%1</span>'
12+
+ '</span>'
13+
%>
14+
915
<% _.each(tierPrices, function(item, key) { %>
10-
<% var priceStr = '<span class="price-container price-tier_price">'
11-
+ '<span data-price-amount="' + priceUtils.formatPrice(item.price, currencyFormat) + '"'
12-
+ ' data-price-type=""' + ' class="price-wrapper ">'
13-
+ '<span class="price">' + priceUtils.formatPrice(item.price, currencyFormat) + '</span>'
14-
+ '</span>'
15-
+ '</span>'; %>
16-
<li class="item">
17-
<%= '<?= $block->escapeHtml(__('Buy %1 for %2 each and', '%1', '%2')) ?>'
18-
.replace('%1', item.qty)
19-
.replace('%2', priceStr) %>
20-
<strong class="benefit">
21-
<?= $block->escapeHtml(__('save')) ?><span
16+
<% var itemExclPrice = item.hasOwnProperty('excl_tax_price')
17+
? exclPrice.replace('%1', priceUtils.formatPrice(item['excl_tax_price'], currencyFormat))
18+
: ''
19+
%>
20+
21+
<% var priceStr = '<span class="price-container price-tier_price">'
22+
+ '<span data-price-amount="' + priceUtils.formatPrice(item.price, currencyFormat) + '"'
23+
+ ' data-price-type=""' + ' class="price-wrapper price-including-tax">'
24+
+ '<span class="price">' + priceUtils.formatPrice(item.price, currencyFormat) + '</span>'
25+
+ '</span>' + itemExclPrice + '</span>';
26+
%>
27+
<li class="item">
28+
<%= '<?= $block->escapeHtml(__('Buy %1 for %2 each and', '%1', '%2')) ?>'
29+
.replace('%1', item.qty)
30+
.replace('%2', priceStr)
31+
%>
32+
<strong class="benefit">
33+
<?= $block->escapeHtml(__('save')) ?><span
2234
class="percent tier-<%= key %>">&nbsp;<%= item.percentage %></span>%
23-
</strong>
24-
<% if (item['excl_tax_price']) { %>
25-
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
26-
<span class="price"><%= priceUtils.formatPrice(item['excl_tax_price'], currencyFormat) %></span>
27-
</span>
28-
<% } %>
29-
</li>
35+
</strong>
36+
</li>
3037
<% }); %>
3138
</ul>
3239
</script>

app/design/frontend/Magento/blank/web/css/source/_price.less

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,4 @@
7373

7474
.price-style-1();
7575
.price-style-3();
76-
77-
.prices-tier.items {
78-
.price-excluding-tax {
79-
display: block;
80-
81-
&:before {
82-
content: attr(data-label) ': ';
83-
.lib-font-size(11);
84-
}
85-
86-
.price {
87-
font-size: 1.2rem;
88-
font-weight: 700;
89-
}
90-
}
91-
}
9276
}

0 commit comments

Comments
 (0)