Skip to content

Commit ff54f4c

Browse files
authored
ENGCOM-3874: [Backport] Fix issue 19887 creating new shipment: getting all trackers. #20184
2 parents e1288fb + 51284c3 commit ff54f4c

File tree

1 file changed

+15
-14
lines changed
  • app/code/Magento/Sales/view/frontend/templates/email/shipment

1 file changed

+15
-14
lines changed

app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@
99
?>
1010
<?php $_shipment = $block->getShipment() ?>
1111
<?php $_order = $block->getOrder() ?>
12-
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
13-
<br />
14-
<table class="shipment-track">
15-
<thead>
12+
<?php $trackCollection = $_order->getTracksCollection($_shipment->getId()) ?>
13+
<?php if ($_shipment && $_order && $trackCollection): ?>
14+
<br />
15+
<table class="shipment-track">
16+
<thead>
1617
<tr>
1718
<th><?= /* @escapeNotVerified */ __('Shipped By') ?></th>
1819
<th><?= /* @escapeNotVerified */ __('Tracking Number') ?></th>
1920
</tr>
20-
</thead>
21-
<tbody>
22-
<?php foreach ($_shipment->getAllTracks() as $_item): ?>
23-
<tr>
24-
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
25-
<td><?= $block->escapeHtml($_item->getNumber()) ?></td>
26-
</tr>
27-
<?php endforeach ?>
28-
</tbody>
29-
</table>
21+
</thead>
22+
<tbody>
23+
<?php foreach ($trackCollection as $_item): ?>
24+
<tr>
25+
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
26+
<td><?= $block->escapeHtml($_item->getNumber()) ?></td>
27+
</tr>
28+
<?php endforeach ?>
29+
</tbody>
30+
</table>
3031
<?php endif; ?>

0 commit comments

Comments
 (0)