Product Links in
Magento Order Emails

Category: Magento
Product Links in Magento Order Emails
Product Links in Magento Order Emails

To link a product name with its product page in your order emails, edit following files:

Magento_Sales/templates/email/items/order/default.phtml
Magento_Sales/templates/email/items/invoice/default.phtml
Magento_Sales/templates/email/items/shipment/default.phtml

To get the product URL, use the following snippet of code and insert it into a href attribute of the link.

<?= $_item->getProduct()->getProductUrl(); ?>

For example,

<p class="product-name"> <a href="<?= $_item->getProduct()->getProductUrl(); ?>"> <?= $block->escapeHtml($_item->getName()); ?> </a> </p>

The result of the snippet of code will be a clickable product name in Magento Emails.

Tutorials

Purchase Email Templates $39 USD

Each purchase of MET comes with 20 different styles —
and a lifetime of free fresh designs & bug-fix updates.

One purchase for all your future projects.