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.

1
  • please attach your code Aug 14, 2019 at 9:44

1 Answer 1

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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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