Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue in 2.2.8 and 2.3+ where emails were being sent with all #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions view/frontend/templates/email/shipment/track.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@
?>
<?php $_shipment = $block->getShipment() ?>
<?php $_order = $block->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<br />
<table class="shipment-track">
<thead>
<tr>
<th><?= /* @escapeNotVerified */ __('Shipped By') ?></th>
<th><?= /* @escapeNotVerified */ __('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($_shipment->getAllTracks() as $_item): ?>
<tr>
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
<td>
<?php $url = $block->getTrackingUrl($_item) ?>
<?php if ($url): ?>
<a href="<?= $block->escapeHtml($url) ?>" target="_blank" rel="nofollow noopener">
<?= $block->escapeHtml($_item->getNumber()) ?>
</a>
<?php else: ?>
<?= $block->escapeHtml($_item->getNumber()) ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php $trackCollection = $_order->getTracksCollection($_shipment->getId()) ?>
<?php if ($_shipment && $_order && $trackCollection): ?>
<br />
<table class="shipment-track">
<thead>
<tr>
<th><?= /* @escapeNotVerified */ __('Shipped By') ?></th>
<th><?= /* @escapeNotVerified */ __('Tracking Number') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($trackCollection as $_item): ?>
<tr>
<td><?= $block->escapeHtml($_item->getTitle()) ?>:</td>
<td>
<?php $url = $block->getTrackingUrl($_item) ?>
<?php if ($url): ?>
<a href="<?= $block->escapeHtml($url) ?>" target="_blank" rel="nofollow noopener">
<?= $block->escapeHtml($_item->getNumber()) ?>
</a>
<?php else: ?>
<?= $block->escapeHtml($_item->getNumber()) ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>