Magento客户发票收货地址公司名称不显示问题求助
Let's work through why your company name isn't showing up in the shipping address and fix this issue step by step:
1. Fix the Critical Template Syntax Error
Looking at your code, there's a syntax mistake in the company name block that's likely breaking the rendering:
{{depend company}}{{var company}} {{/depend}<br/>
The closing {{/depend}} tag is missing a closing brace }}, which invalidates the conditional logic. Here's the corrected full template with proper syntax:
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/> {{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 city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}<br/> {{var country}}<br/> {{depend telephone}}T: {{var telephone}}{{/depend}} {{depend fax}}<br/>F: {{var fax}}{{/depend}} {{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}
2. Verify the company Field is Enabled & Populated
The {{depend company}} tag only renders content if two conditions are met:
- The
companyvariable has a non-empty value (from user input or system data) - Your system's shipping address configuration actually enables the company name field (some platforms disable this by default for shipping addresses)
Double-check:
- Does your shipping address form include a company name input?
- Are users (or your backend system) actually providing a company name for shipping addresses?
3. Confirm You're Editing the Correct Template
It's common to accidentally modify the billing address template instead of the shipping one. Ensure the template you updated is specifically assigned to the shipping address section in your system settings.
4. Test the company Variable Directly
To rule out data flow issues, temporarily remove the {{depend company}} wrapper and add {{var company}}<br/> directly to the template.
- If the company name shows up now, the problem was with the
dependcondition (either the field is disabled or no value is being passed) - If it still doesn't appear, your system isn't passing the
companyvariable to the shipping address template—you'll need to check backend configurations to ensure this variable is included in the shipping address data.
内容的提问来源于stack exchange,提问作者Jass

