0

I have created custom order email template and placed some order shipping address variables inside it. Most variables work ok, but the following are always returning no value:

{{var order.getShippingAddress().getStreet1()}}
{{var order.getShippingAddress().getCountry()}}
{{var order.getShippingAddress().getCountryModel().getName()}}

Any ideas?

2

Try this instead :

{{var order.getShippingAddress().getStreetLine(1)}}
| improve this answer | |
  • Thank you for the solution. Do you know about the country field too? – zekia Sep 14 '19 at 7:17
  • Do you mean to say that you tried this and it's not working {{var order.getShippingAddress().getCountry()}} – Arif Ahmad Sep 15 '19 at 10:07
  • please try this - {{var order.getShippingAddress().getCountryId()}} for getting the country code. – Arif Ahmad Sep 17 '19 at 14:06
1

Please try with below way to check street deatils :

 {{var $order.getShippingAddress().getStreetLine(1) }}
 {{var $order.getShippingAddress().getStreetLine(2) }}

for more data if you want than check with below url.

https://hotexamples.com/examples/magento.sales.model.order/Address/getStreetLine/php-address-getstreetline-method-examples.html

| improve this answer | |

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.