How can I edit the {{var alertGrid|raw}} for the magento 2.2.x stock alert email?

I know the template is found in vendor\magento\module-product-alert\view\frontend\email\stock_alert.html but the template references the variable.

I want to remove the product price from the grid.

It appears to be defined here: M2 Product Alert Email, however, I don't see a straightforward way of editing the layout or removing the price.

Alternatively, I could remove the variable from the template, but how do I add back the product name and link to the product?


The alertGrid block is rendered using the template /view/frontend/templates/email/price.phtml from the Magento_ProductAlert module.
you can just copy this file to your theme keeping the same path and remove the price from it.
The price is rendered but the lines:

<?= $block->getProductPriceHtml(
                    'display_label' => __('Price:')
  • Thanks. It seems /view/frontend/templates/email/stock.phtml is actually the most appropriate file to copy as I need to edit stock alerts, not price alerts. – RFI Dec 14 '18 at 12:06

Your Answer

