1

In magento 2 how to remove coma from billing and shipping address of order confirmation email template.

Order confirmation mail is called from "order_new.html" file.

In this file billing address is called as"{{var formattedBillingAddress|raw}}" this line and the shipping address is called as "{{var formattedShippingAddress|raw}}".

In which file i have to edit? How can i do this? Please help me to achieve this.

1
$templateVars = array(
        'store' => $this->storeManager->getStore(),
        'message'   => 'We processed your order ID We will contact you soon in mail for the acknowledgement if you not receive mail within 4 hours please get help from support@xxx.com',
        'order' => $order,
        'store'=> $store,
        'productName'=> $productName,
        'payment_html' => $this->getPaymentHtml($order),
        'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
        'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
   );
1
  • Where can we add/edit this code ? Mar 11 '20 at 13:25
0

This does not need any translation file or csv, Magento uses the template type for the address format ( Text, Text One Line, HTML, PDF).

You can change/ update the formate and order of content via admin panel.

  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Customers and choose Customer Configuration.

  3. Address Templates 

    The section includes a separate set of formatting instructions for each of the following:

    Text

    Text One Line

    HTML

    PDF

  4. Edit each template as needed, using the examples for reference. When complete, click Save Config

Email uses the html type for the address formate so you need to update the content in admin.

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.