0

I have a multi-language store and I need to generate my invoice in 2 different languages in a PDF and the invoice email should also have both the languages. How can I do that.

1 Answer 1

1

If you want to have 2 languages in one Invoice PDF, you need to overwrite \Magento\Sales\Model\Order\Pdf\Invoice and \Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice and implement your custom rendering with your layout

If you want to customize email you can customize all sales_email_invoice_* templates and customize sales_email_order_invoice_items layout depends on your rules.

Maybe magento 2 how to translate strings to a specific locale will be helpful as well

One of alternative is generate Email/PDF content part for one locale and after for another one and glue parts

Invoice Templates [Added]

Magento uses 4 templates for invoice emails depends on scenario:

  • vendor/magento/module-sales/view/frontend/email/invoice_new.html - email about new Invoice for customer
  • vendor/magento/module-sales/view/frontend/email/invoice_new_guest.html - email about new Invoice for guest
  • vendor/magento/module-sales/view/frontend/email/invoice_update.html - email about update in Invoice for customer
  • vendor/magento/module-sales/view/frontend/email/invoice_update_guest.html - email about update in Invoice for guest

If you want to customize it in you theme you should place copy of those files in app/design/frontend/<vendor>/<theme>/Magento_Sales/email/

If you want to customize templates per store you can use Marketing -> Email Templates feature. Create custom template for each store and specify it in Stores -> Configuration for your store scope

Sales Emails

3

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.