How to Display “Track My Order” Footer Link in Hyvä

In this guide, you can learn how to display the “Track My Order” link in your website’s footer in Hyvä theme using the Magento 2 Order Status & Shipping Tracking Lite extension.

First, check if your theme includes a Magento_Theme::html/footer/links.phtml file. If the file is missing, please copy the following file:

vendor/hyva-themes/magento2-default-theme/Magento_Theme/templates/html/footer/links.phtml

to the theme with the following path:

app/design/frontend/<theme_vendor>/<theme_name>/Magento_Theme/templates/html/footer/links.phtml

Add the code below to the Magento_Theme::html/footer/links.phtml file.

<?php
/** @var \Hyva\PlumrocketShippingTracking\ViewModel\TrackMyOrder $prOrderStatus */
$prOrderStatus = $viewModels->require(\Hyva\PlumrocketShippingTracking\ViewModel\TrackMyOrder::class);
?>
<?php if ($prOrderStatus->canShowInFooter()): ?>
    <li class="mt-4">
        <a href="<?= $escaper->escapeUrl($prOrderStatus->getTrackLink()) ?>"
           class="text-base leading-6">
            <?= $escaper->escapeHtml($prOrderStatus->getFooterTrackLinkLabel()) ?>
        </a>
    </li>
<?php endif; ?>

Step 3. Apply Changes

This step is necessary only when the FPC cache is enabled or when using Magento in production mode. If either of these conditions applies to you, please run the following commands to apply the changes:

php bin/magento setup:static-content:deploy
php bin/magento cache:flush
Was this article helpful?