I am using Magento Version 2.4.5, I want to specifically add the country_id (e.g. FR for France) in the order email template.
The variable with the Billing address only returns the full address block.
Is there a way to solve this?
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityPlease try with the following code.
{{var order.getShippingAddress().getCountry()}} //Get the country’s ID
{{var order.getShippingAddress().getCountryModel().getName()}} //Get the country’s full name
{{var order.getBillingAddress().getCountry()}} //Get the country’s ID