|
6 | 6 | ?>
|
7 | 7 | <script type="text/x-magento-template" id="tier-prices-template">
|
8 | 8 | <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"> %1</span>' |
| 12 | + + '</span>' |
| 13 | + %> |
| 14 | + |
9 | 15 | <% _.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 |
22 | 34 | class="percent tier-<%= key %>"> <%= 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> |
30 | 37 | <% }); %>
|
31 | 38 | </ul>
|
32 | 39 | </script>
|
|
0 commit comments