0

I try to modify some text in the order_new.html if the customer pay by a custom payment method.

For example, if he pay with 'tati' payment method, I want to remove a sentence of the mail template.

Can I do that, I try to add conditions on the template but it doesn't work..

Thanks.

  • please attach your code – Rk Rathod Aug 14 at 9:44
0

Instead of adding condition directly in the email template, you can replace your "sentence" with a block:

{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='Vendor_Module::email/order/info.phtml' order=$order}}

Then in your template email/order/info.phtml, you can use the condition however you want:

if ($this->getData('order')->getPayment()->getMethod() != 'tati') {
    echo __('The sentence you want to show to any payment method but "tati"');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.