Customer's "Company" field included in notifications..

Customer's "Company" field included in notifications..

Reforge
Tourist
3 0 1

Forgive me if this is a repeated or silly question but it has my brain bent.

 

I have modified my "company" field to represent a "Display name". This is intended to allow me to see people's names of choice instead of their real names as I sell my items in a live-streaming environment.

After many attempts at adding the company field to my notifications email template, it is still not working. Can anyone point me in the right direction?

Replies 5 (5)

PaulNewton
Shopify Partner
7721 678 1619

What do you mean "company field" , is this for the shopify Plus B2B features for company-customers, or other.

https://help.shopify.com/en/manual/b2b/companies 

https://shopify.dev/docs/api/liquid/objects/customer#customer-current_company 

 

If you've customized a contact form make sure the data is even being passed to the backend.

 

For orders see the order object for available properties.

https://shopify.dev/docs/api/liquid/objects/order 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Reforge
Tourist
3 0 1

No this is Shopify basic - I'm just using the company field to collect a display name - and trying to pass the entered value of that field into the order notification. I have tried customer's current company - so after trying so many different things my brain just bent.

PaulNewton
Shopify Partner
7721 678 1619

But WHERE and HOW are you collecting this info, is this a contact form, a product field, in the cart, in checkout, etc

"company field" means many things with this stuff you've got to be very specific or provide examples not everyone has the same setup.

 

If you mean the company(optional) that can be shown in the checkout that's part of the address  data

And generally just output in order notification templates as part of these outputs:

{{ shipping_address | format_address }} or {{ billing_address | format_address }}

https://shopify.dev/docs/api/liquid/objects/address#address-company 

 

While confusing to find that address.company is not on the customer because a customer can have many addresses

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Reforge
Tourist
3 0 1

Sorry -

 

OK so in the default checkout process for normal customers, there is an optional field called "Company".  I have made this field required. I then went into my default theme settings and changed the public-facing label of this field to "Display name."

 I then added the company field to the customer profile but it is just the default company field.

 

Now my  desired result is to pass the data entered into this field during the checkout process (or profile since it is the same default shopify field)  to be passed through my new order notification e-mail.

 

I have tried:

{{ company }}

{{ company name }}

{{ company_name }}

{{ compnayName }}

{{ current.customer_compnay.name ))

 

None of these have passed the collected data to the notification.

PaulNewton
Shopify Partner
7721 678 1619

Thank you for clarifying your work so far.

Sorry I should have clarified how to access the address and put this in the last post.

It should be something like {{ customer.default_address.company }} 

https://shopify.dev/docs/api/liquid/objects/customer#customer-default_address

, or in some contexts: {{ order.customer.default_address.company }}

 

Or you may need to loop over the addresses array in case it's not on the first address and they put it on a shipping address, etc

https://shopify.dev/docs/api/liquid/objects/customer#customer-addresses

{% for address in customer.addresses %} {{ address.company }} {% endfor %}

Tailoring logic to need to only output one name if multiple are used.

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org