cancel
Showing results for 
Search instead for 
Did you mean: 

Email templates - show or hide some text based on the product type

Email templates - show or hide some text based on the product type

I'd like to show or hide some text in New Order email templates based on the product type.

If it's a Downloadable product, I need to show download instructions; otherwise don't show them.

In the email template, how can I get the product type?

Or is this the wrong way to go about this?

1 REPLY 1

Re: Email templates - show or hide some text based on the product type

Hi @MacEwen 

 

You can get product type with the below code:

 

 

 $item->getProductType();

 

 

You can check the code with the below solution URL for sending order email flow :


https://magento.stackexchange.com/questions/260101/sending-order-confirmation-email-template-in-mage...

 

You can custom your code to get ProductType and update your text accordingly.

 

 

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!