Adding companyname

Solved
sivainguva
Tourist
27 0 1

Hi All, I am pretty new to the shopify. We are running a website which is integrated to the shopify. So when ever a customer registers an account from our website it posts all the customer data to the shopify using the POST API call. so i added a new field to our registration page called company_name but shopify doesnot have this field so how can i implement this.

0 Likes
Bitfresh
Shopify Partner
56 10 12

Hi sivainguva,

You can save it into the address.company (see https://shopify.dev/docs/themes/liquid/reference/objects/address). Or you can store it into a metafield (Read more here: https://shopify.dev/docs/admin-api/rest/reference/metafield). It depends on what option you should choose, if you also collect address information on signup you can use the first option, else I would recommend the customer metafield.

sivainguva
Tourist
27 0 1

Hey That sounds good, just a quick question, so where does that show up in shopify if i add metafield ?

0 Likes
Bitfresh
Shopify Partner
56 10 12

Hi sivainguva,

Metafields are not shown inside the Shopify Admin. There are some browser plugins to edit and show metafields (Like this one: https://chrome.google.com/webstore/detail/poshify-utilities/albldpmnhhhcjiladaacehfabibgbllk). Or you can request the metafields resource for a specific customer: /admin/customers/#{id}/metafields.json. To show the metafield on you website you can use liquid, for example if you save the company name in the customer object you can show it on their account page with: {{ customer.metafields.company.name }}.

0 Likes
sivainguva
Tourist
27 0 1

Actually we have a application on shopify , but we wanted the company name information to be displayed on shopify where we see the firstname, email,....etc. So when a user registers through our website the customer object was sent to shopify as well where we add the metafields and send it to shopify. but we wanted the companyname to be displayed on shopify admin.

0 Likes
sivainguva
Tourist
27 0 1

Also if we add the Metafields in customer.json, willit appear in shopify admin.
https://shopify.dev/docs/admin-api/rest/reference/customers/customer#index-2021-04

0 Likes
Kyle_W
Shopify Expert
133 21 81

Hey @sivainguva!

As @Bitfresh has mentioned, metafield data is not shown directly in the Shopify Admin UI. If you want the company name to appear in the Shopify admin, then you'll need to save this data into address.company and/or customer.note. The data for the "Customer Note" field will show in the Shopify admin on the customer list page, customer detail page, and order detail page. See the screenshot below for an example:

 customer note example.png

Kyle W | Helium Dev, LLC
Helium builds apps that merchants depend on:
- Customer Fields
- Meteor Mega Menu
0 Likes
sivainguva
Tourist
27 0 1

Hey Kyle,

 

That sounds good, just one more question lets say we asking customers the complete address during they signup with our website. I use thee address.companyName to get the data to the shopify. In this scenario where would you see this address on the shopify admin.

0 Likes
Kyle_W
Shopify Expert
133 21 81

Hey @sivainguva!

You can view a customer's address details in the Shopify admin on several different pages. Here's an example of where to find the data in question when viewing an individual customer record (the company name is highlighted in yellow):

Image 2021-07-08 at 4.43.00 PM-down.jpg 

Kyle W | Helium Dev, LLC
Helium builds apps that merchants depend on:
- Customer Fields
- Meteor Mega Menu
0 Likes
sivainguva
Tourist
27 0 1

Hey Kyle,

Thanks for response , So we are having the address forms in 2 pages during the sign up we have the address fields and during the checkout as well we have address fields . So in this scenario what happens to the address they enter during the checkout?

0 Likes