0

In magento 2 I try to add company attribute in admin > Sales > Order > edit > "shipping Address" block, between name and address :

enter image description here

Do you know how to make this change ?

EDIT

In Store > Configuration > Customers > Customer Configuration > Address Templates

In HTML there is "company" attribute :

{{if intitule_adresse}}{{var intitule_adresse}}<br/>{{/if}}
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}{{depend firstname}}<br />{{/depend}}
{{depend company}}{{var company}}<br />{{/depend}}
{{if street1}}{{var street1}}<br />{{/if}}
{{depend street2}}{{var street2}}<br />{{/depend}}
{{depend street3}}{{var street3}}<br />{{/depend}}
{{depend street4}}{{var street4}}<br />{{/depend}}
{{if postcode}}{{var postcode}}{{/if}} {{if city}}{{var city}} {{/if}}{{if region}}{{var region}} {{/if}}<br />
{{var country}}<br />
{{depend telephone}}T: <a href="tel:{{var telephone}}">{{var telephone}}</a>{{/depend}}
{{depend fax}}<br />F: {{var fax}}{{/depend}}
{{depend vat_id}}<br />VAT: {{var vat_id}}{{/depend}}

But It does not appear in shipping address. When I remove {{depend company}}{{/depend}} and leave only {{var company}}<br /> there is a blank line.

2
  • do you want that on specific location into shipping address? Jan 6, 2020 at 14:49
  • Yes, between name and address (in 2nd position)
    – Fbr
    Jan 6, 2020 at 15:02

1 Answer 1

1

Go to

Store > Configuration > Customers > Customer Configuration > Address Templates

In HTML You Need To Add Your Attribute.

{{depend attribute_code}}<br/>Attribute Label: {{var attribute_code}}
8
  • check you enter compny name in your address ?? Jan 7, 2020 at 9:23
  • The "company" attribute is already defined here, but does not appear: {{depend company}} {{var company}} <br /> {{/ depend}} (look at my update above)
    – Fbr
    Jan 7, 2020 at 9:24
  • Yes of course there is a company name
    – Fbr
    Jan 7, 2020 at 9:24
  • try create new order and fill the compny name and check because i also work on this so i am sure about this Jan 7, 2020 at 9:29
  • I create new order, when I click on edit shipping address the company field is well filled but still does not appear...
    – Fbr
    Jan 7, 2020 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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