Customize a block outside editor

If somewhere you're limited by editor, there is a gentle way to modify html code of blocks over .phtml files. As an example, in this article product image will be removed from items table.

1. Copy template file

To avoid conflicts with future updates, the first of all we need to copy .phtml file to our design folder. Depends on how the extension was installed, .phtml file will be located here:

app/code/Magetrend/Email/view/frontend/templates/email/default/block/sales/items/order/default.phtml

or here

vendor/magetrend/email/view/frontend/templates/email/default/block/sales/items/order/default.phtml

This file contains a html code of item row. Copy it to the following destination

app/design/frontend/VENDOR/THEME/Magetrend_Email/templates/email/default/block/sales/items/order/default.phtml

2. Customizing the file

The following changes in the file is just an example of how to hide the imag. You can change whatever is needed.

Open the file

app/design/frontend/VENDOR/THEME/Magetrend_Email/templates/email/default/block/sales/items/order/default.phtml

find

<?php if ($block->showImage()): ?>

replace in two places

<?php if (false && $block->showImage()): ?>

3. Clear the caches

The last thing is to clear the caches. If your store is in production mode you might need to run magento upgrade/compile/deploy commands because .phtml files might be cached at var/view_preprocessed/.

It's very general way of how to overwrite .phtml, .css, .xml files of Magento 2 extension. All the files located under

app/code/Magetrend/Email/view/frontend

can be modified in the same way.