Skip to content

Commit 61dbb60

Browse files
author
Anna Bukatar
committed
ACP2E-541: Arabic Store Price Currency Error
1 parent 00fb26b commit 61dbb60

File tree

8 files changed

+127
-86
lines changed

8 files changed

+127
-86
lines changed

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

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
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: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
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>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ $prevOptionId = '';
108108
<?php elseif ($item->getQtyShipped() > 0 && $item->getParentItem() && $block->isShipmentSeparately()): ?>
109109
<li class="item">
110110
<span class="title"><?= $block->escapeHtml(__('Shipped')); ?></span>
111-
<span class="content"><?= /* @noEscape */ $item->getQtyShipped() * 1; ?></span>
111+
<span class="content">
112+
<?= /* @noEscape */ $localeFormatter->formatNumber($item->getQtyShipped() * 1); ?>
113+
</span>
112114
</li>
113115
<?php else: ?>
114-
<span class="content"><?= /* @noEscape */ $parentItem->getQtyOrdered() * 1; ?></span>
116+
<span class="content">
117+
<?= /* @noEscape */ $localeFormatter->formatNumber($parentItem->getQtyOrdered() * 1); ?>
118+
</span>
115119
<?php endif; ?>
116120
<?php if (($item->getParentItem() && $block->isChildCalculated()) ||
117121
(!$item->getParentItem() && !$block->isChildCalculated()) ||

0 commit comments

Comments
 (0)