cancel
Showing results for 
Search instead for 
Did you mean: 

Remove attribute in order email

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Remove attribute in order email

I'm trying to figure out how to remove a product attribute from the order email (Color for example sake)

I have found the relevant file at 

vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml

Working in it from my child theme

This is what me and a colleague came up, though it seems to be hanging at the checkout when an order is submitted

 

                <?php foreach ($block->getItemOptions() as $option): ?>
                
                <?php 
                    if(isset($option['color']) 
                        {
                            } else {
                    ?>
                <dt><strong><em><?= /* @@escapeNotVerified */  $option['label'] ?></em></strong></dt>
                <dd><?= /* @escapeNotVerified */  nl2br($option['value']) ?></dd>
    
                <?php } ?

<?php endforeach; ?>

Any help would be appreciated