Skip to content

Commit 5455c67

Browse files
committed
Merge remote-tracking branch 'l3/ACP2E-541' into PR_L3_22_04_2022
2 parents fa8d847 + a311ec3 commit 5455c67

File tree

38 files changed

+431
-179
lines changed

38 files changed

+431
-179
lines changed

app/code/Magento/AdvancedSearch/view/frontend/templates/search_data.phtml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@
66

77
/**
88
* @var \Magento\AdvancedSearch\Block\SearchData $block
9+
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
910
*/
1011
?>
1112
<?php
1213
/** @var \Magento\Search\Model\QueryResult[] $data */
1314
$data = $block->getItems();
14-
if (count($data)) : ?>
15+
if (count($data)): ?>
1516
<dl class="block">
1617
<dt class="title"><?= $block->escapeHtml(__($block->getTitle())) ?></dt>
17-
<?php foreach ($data as $additionalInfo) : ?>
18+
<?php foreach ($data as $additionalInfo): ?>
1819
<dd class="item">
1920
<a href="<?= $block->escapeUrl($block->getLink($additionalInfo->getQueryText())) ?>"
2021
><?= $block->escapeHtml($additionalInfo->getQueryText()) ?></a>
21-
<?php if ($block->isShowResultsCount()) : ?>
22-
<span class="count"><?= /* @noEscape */ (int)$additionalInfo->getResultsCount() ?></span>
22+
<?php if ($block->isShowResultsCount()): ?>
23+
<span class="count">
24+
<?= /* @noEscape */ $localeFormatter->formatNumber((int)$additionalInfo->getResultsCount()) ?>
25+
</span>
2326
<?php endif; ?>
2427
</dd>
2528
<?php endforeach; ?>

app/code/Magento/Bundle/view/base/templates/product/price/tier_prices.phtml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
?>
77

88
<?php
9-
/** @var \Magento\Framework\Pricing\Render\PriceBox $block */
10-
9+
/**
10+
* @var \Magento\Framework\Pricing\Render\PriceBox $block
11+
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
12+
*/
1113
/** @var \Magento\Bundle\Pricing\Price\TierPrice $tierPriceModel */
1214
$tierPriceModel = $block->getPrice();
1315
$tierPrices = $tierPriceModel->getTierPriceList();
1416
?>
15-
<?php if (count($tierPrices)) : ?>
17+
<?php if (count($tierPrices)):?>
1618
<ul class="<?= $block->escapeHtmlAttr(($block->hasListClass() ? $block->getListClass() : 'prices-tier items')) ?>">
17-
<?php foreach ($tierPrices as $index => $price) : ?>
19+
<?php foreach ($tierPrices as $index => $price): ?>
1820
<li class="item">
1921
<?= /* @noEscape */ __(
2022
'Buy %1 with %2 discount each',
21-
$price['price_qty'],
22-
'<strong class="benefit">' . round($price['percentage_value']) . '%</strong>'
23+
$localeFormatter->formatNumber($price['price_qty']),
24+
'<strong class="benefit">' .
25+
$localeFormatter->formatNumber(round($price['percentage_value'])) .
26+
'%</strong>'
2327
); ?>
2428
</li>
2529
<?php endforeach; ?>

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ define([
211211
}, 0);
212212
toTemplate.data[type] = {
213213
value: value,
214-
formatted: utils.formatPrice(value, format)
214+
formatted: utils.formatPriceLocale(value, format)
215215
};
216216
});
217217

app/code/Magento/Bundle/view/frontend/templates/sales/order/creditmemo/items/renderer.phtml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
6+
// phpcs:disable Magento2.Templates.ThisInTemplate
7+
// phpcs:disable Generic.Files.LineLength
8+
?>
9+
<?php
10+
/**
11+
* @var \Magento\Bundle\Block\Sales\Order\Items\Renderer $block
12+
* @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
13+
*/
714
?>
8-
<?php /** @var $block \Magento\Bundle\Block\Sales\Order\Items\Renderer */ ?>
915
<?php $parentItem = $block->getItem() ?>
1016

1117
<?php $items = $block->getChildren($parentItem) ?>
@@ -14,86 +20,86 @@
1420

1521
<?php $_prevOptionId = '' ?>
1622

17-
<?php foreach ($items as $_item) : ?>
23+
<?php foreach ($items as $_item): ?>
1824

19-
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()) : ?>
25+
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?>
2026
<?php $_showlastRow = true ?>
21-
<?php else : ?>
27+
<?php else: ?>
2228
<?php $_showlastRow = false ?>
2329
<?php endif; ?>
2430

25-
<?php if ($_item->getOrderItem()->getParentItem()) : ?>
31+
<?php if ($_item->getOrderItem()->getParentItem()): ?>
2632
<?php $attributes = $block->getSelectionAttributes($_item) ?>
27-
<?php if ($_prevOptionId != $attributes['option_id']) : ?>
33+
<?php if ($_prevOptionId != $attributes['option_id']): ?>
2834
<tr class="options-label">
2935
<td class="col label" colspan="7"><div class="option label"><?= $block->escapeHtml($attributes['option_label']) ?></div></td>
3036
</tr>
3137
<?php $_prevOptionId = $attributes['option_id'] ?>
3238
<?php endif; ?>
3339
<?php endif; ?>
3440
<tr id="order-item-row-<?= $block->escapeHtmlAttr($_item->getId()) ?>"
35-
class="<?php if ($_item->getOrderItem()->getParentItem()) : ?>item-options-container<?php else : ?>item-parent<?php endif; ?>"
36-
<?php if ($_item->getParentItem()) : ?>
41+
class="<?php if ($_item->getOrderItem()->getParentItem()): ?>item-options-container<?php else: ?>item-parent<?php endif; ?>"
42+
<?php if ($_item->getParentItem()): ?>
3743
data-th="<?= $block->escapeHtmlAttr($attributes['option_label']) ?>"
3844
<?php endif; ?>>
39-
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
45+
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
4046
<td class="col name" data-th="<?= $block->escapeHtmlAttr(__('Product Name')) ?>">
4147
<strong class="product name product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
4248
</td>
43-
<?php else : ?>
49+
<?php else: ?>
4450
<td class="col value" data-th="<?= $block->escapeHtmlAttr(__('Product Name')) ?>"><?= $block->getValueHtml($_item) ?></td>
4551
<?php endif; ?>
4652
<td class="col sku" data-th="<?= $block->escapeHtmlAttr(__('SKU')) ?>"><?= $block->escapeHtml($_item->getSku()) ?></td>
4753
<td class="col price" data-th="<?= $block->escapeHtmlAttr(__('Price')) ?>">
48-
<?php if ($block->canShowPriceInfo($_item)) : ?>
54+
<?php if ($block->canShowPriceInfo($_item)): ?>
4955
<?= $block->getItemPriceHtml($_item) ?>
50-
<?php else : ?>
56+
<?php else: ?>
5157
&nbsp;
5258
<?php endif; ?>
5359
</td>
5460
<td class="col qty" data-th="<?= $block->escapeHtmlAttr(__('Quantity')) ?>">
55-
<?php if ($block->canShowPriceInfo($_item)) : ?>
56-
<?= (float)$_item->getQty() * 1 ?>
57-
<?php else : ?>
61+
<?php if ($block->canShowPriceInfo($_item)): ?>
62+
<?= /* @noEscape */ $localeFormatter->formatNumber((float)$_item->getQty() * 1) ?>
63+
<?php else: ?>
5864
&nbsp;
5965
<?php endif; ?>
6066
</td>
6167
<td class="col subtotal" data-th="<?= $block->escapeHtmlAttr(__('Subtotal')) ?>">
62-
<?php if ($block->canShowPriceInfo($_item)) : ?>
68+
<?php if ($block->canShowPriceInfo($_item)): ?>
6369
<?= $block->getItemRowTotalHtml($_item) ?>
64-
<?php else : ?>
70+
<?php else: ?>
6571
&nbsp;
6672
<?php endif; ?>
6773
</td>
6874
<td class="col discount" data-th="<?= $block->escapeHtmlAttr(__('Discount Amount')) ?>">
69-
<?php if ($block->canShowPriceInfo($_item)) : ?>
75+
<?php if ($block->canShowPriceInfo($_item)): ?>
7076
<?= $block->escapeHtml($block->getOrder()->formatPrice(-$_item->getDiscountAmount()), ['span']) ?>
71-
<?php else : ?>
77+
<?php else: ?>
7278
&nbsp;
7379
<?php endif; ?>
7480
</td>
7581
<td class="col rowtotal" data-th="<?= $block->escapeHtmlAttr(__('Row Total')) ?>">
76-
<?php if ($block->canShowPriceInfo($_item)) : ?>
82+
<?php if ($block->canShowPriceInfo($_item)): ?>
7783
<?= $block->getItemRowTotalAfterDiscountHtml($_item) ?>
78-
<?php else : ?>
84+
<?php else: ?>
7985
&nbsp;
8086
<?php endif; ?>
8187
</td>
8288
</tr>
8389
<?php endforeach; ?>
8490

85-
<?php if ($_showlastRow && (($_options = $block->getItemOptions()) || $block->escapeHtml($_item->getDescription()))) : ?>
91+
<?php if ($_showlastRow && (($_options = $block->getItemOptions()) || $block->escapeHtml($_item->getDescription()))): ?>
8692
<tr>
8793
<td class="col options" colspan="7">
88-
<?php if ($_options = $block->getItemOptions()) : ?>
94+
<?php if ($_options = $block->getItemOptions()): ?>
8995
<dl class="item-options">
90-
<?php foreach ($_options as $_option) : ?>
96+
<?php foreach ($_options as $_option): ?>
9197
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
92-
<?php if (!$block->getPrintStatus()) : ?>
98+
<?php if (!$block->getPrintStatus()): ?>
9399
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
94-
<dd<?php if (isset($_formatedOptionValue['full_view'])) : ?> class="tooltip wrapper"<?php endif; ?>>
100+
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip wrapper"<?php endif; ?>>
95101
<?= /* @noEscape */ $_formatedOptionValue['value'] ?>
96-
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
102+
<?php if (isset($_formatedOptionValue['full_view'])): ?>
97103
<div class="tooltip content">
98104
<dl class="item options">
99105
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
@@ -102,8 +108,8 @@
102108
</div>
103109
<?php endif; ?>
104110
</dd>
105-
<?php else : ?>
106-
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
111+
<?php else: ?>
112+
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value']: $_option['value'])) ?></dd>
107113
<?php endif; ?>
108114
<?php endforeach; ?>
109115
</dl>

app/code/Magento/Bundle/view/frontend/templates/sales/order/invoice/items/renderer.phtml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
6+
// phpcs:disable Magento2.Templates.ThisInTemplate
7+
// phpcs:disable Generic.Files.LineLength
8+
/** @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter */
79
?>
810
<?php /** @var $block \Magento\Bundle\Block\Sales\Order\Items\Renderer */ ?>
911
<?php $parentItem = $block->getItem() ?>
@@ -13,17 +15,17 @@
1315
<?php $_index = 0 ?>
1416

1517
<?php $_prevOptionId = '' ?>
16-
<?php foreach ($items as $_item) : ?>
18+
<?php foreach ($items as $_item): ?>
1719

18-
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()) : ?>
20+
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper(Magento\GiftMessage\Helper\Message::class)->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?>
1921
<?php $_showlastRow = true ?>
20-
<?php else : ?>
22+
<?php else: ?>
2123
<?php $_showlastRow = false ?>
2224
<?php endif; ?>
2325

24-
<?php if ($_item->getOrderItem()->getParentItem()) : ?>
26+
<?php if ($_item->getOrderItem()->getParentItem()): ?>
2527
<?php $attributes = $block->getSelectionAttributes($_item) ?>
26-
<?php if ($_prevOptionId != $attributes['option_id']) : ?>
28+
<?php if ($_prevOptionId != $attributes['option_id']): ?>
2729
<tr class="options-label">
2830
<td class="col label" colspan="5">
2931
<div class="option label"><?= $block->escapeHtml($attributes['option_label']) ?></div>
@@ -33,56 +35,56 @@
3335
<?php endif; ?>
3436
<?php endif; ?>
3537
<tr id="order-item-row-<?= $block->escapeHtmlAttr($_item->getId()) ?>"
36-
class="<?php if ($_item->getOrderItem()->getParentItem()) : ?>item-options-container
37-
<?php else : ?>item-parent
38+
class="<?php if ($_item->getOrderItem()->getParentItem()): ?>item-options-container
39+
<?php else: ?>item-parent
3840
<?php endif; ?>"
39-
<?php if ($_item->getOrderItem()->getParentItem()) : ?>
41+
<?php if ($_item->getOrderItem()->getParentItem()): ?>
4042
data-th="<?= $block->escapeHtmlAttr($attributes['option_label']) ?>"
4143
<?php endif; ?>>
42-
<?php if (!$_item->getOrderItem()->getParentItem()) : ?>
44+
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
4345
<td class="col name" data-th="<?= $block->escapeHtmlAttr(__('Product Name')) ?>">
4446
<strong class="product name product-item-name"><?= $block->escapeHtml($_item->getName()) ?></strong>
4547
</td>
46-
<?php else : ?>
48+
<?php else: ?>
4749
<td class="col value" data-th="<?= $block->escapeHtmlAttr(__('Product Name')) ?>"><?= $block->getValueHtml($_item) ?></td>
4850
<?php endif; ?>
4951
<td class="col sku" data-th="<?= $block->escapeHtmlAttr(__('SKU')) ?>"><?= $block->escapeHtml($_item->getSku()) ?></td>
5052
<td class="col price" data-th="<?= $block->escapeHtmlAttr(__('Price')) ?>">
51-
<?php if ($block->canShowPriceInfo($_item)) : ?>
53+
<?php if ($block->canShowPriceInfo($_item)): ?>
5254
<?= $block->getItemPriceHtml($_item) ?>
53-
<?php else : ?>
55+
<?php else: ?>
5456
&nbsp;
5557
<?php endif; ?>
5658
</td>
5759
<td class="col qty" data-th="<?= $block->escapeHtmlAttr(__('Qty Invoiced')) ?>">
58-
<?php if ($block->canShowPriceInfo($_item)) : ?>
59-
<?= (float)$_item->getQty() * 1 ?>
60-
<?php else : ?>
60+
<?php if ($block->canShowPriceInfo($_item)): ?>
61+
<?= /* @noEscape */ $localeFormatter->formatNumber((float)$_item->getQty() * 1) ?>
62+
<?php else: ?>
6163
&nbsp;
6264
<?php endif; ?>
6365
</td>
6466
<td class="col subtotal" data-th="<?= $block->escapeHtmlAttr(__('Subtotal')) ?>">
65-
<?php if ($block->canShowPriceInfo($_item)) : ?>
67+
<?php if ($block->canShowPriceInfo($_item)): ?>
6668
<?= $block->getItemRowTotalHtml($_item) ?>
67-
<?php else : ?>
69+
<?php else: ?>
6870
&nbsp;
6971
<?php endif; ?>
7072
</td>
7173
</tr>
7274
<?php endforeach; ?>
7375

74-
<?php if ($_showlastRow && (($_options = $block->getItemOptions()) || $block->escapeHtml($_item->getDescription()))) : ?>
76+
<?php if ($_showlastRow && (($_options = $block->getItemOptions()) || $block->escapeHtml($_item->getDescription()))): ?>
7577
<tr>
7678
<td class="col options" colspan="5">
77-
<?php if ($_options = $block->getItemOptions()) : ?>
79+
<?php if ($_options = $block->getItemOptions()): ?>
7880
<dl class="item-options">
79-
<?php foreach ($_options as $_option) : ?>
81+
<?php foreach ($_options as $_option): ?>
8082
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
81-
<?php if (!$block->getPrintStatus()) : ?>
83+
<?php if (!$block->getPrintStatus()): ?>
8284
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
83-
<dd<?php if (isset($_formatedOptionValue['full_view'])) : ?> class="tooltip wrapper"<?php endif; ?>>
85+
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="tooltip wrapper"<?php endif; ?>>
8486
<?= /* @noEscape */ $_formatedOptionValue['value'] ?>
85-
<?php if (isset($_formatedOptionValue['full_view'])) : ?>
87+
<?php if (isset($_formatedOptionValue['full_view'])): ?>
8688
<div class="tooltip content">
8789
<dl class="item options">
8890
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
@@ -91,8 +93,8 @@
9193
</div>
9294
<?php endif; ?>
9395
</dd>
94-
<?php else : ?>
95-
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
96+
<?php else: ?>
97+
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value']: $_option['value'])) ?></dd>
9698
<?php endif; ?>
9799
<?php endforeach; ?>
98100
</dl>

0 commit comments

Comments
 (0)