All things Shopify and commerce
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.
Solved! Go to the solution
This is an accepted solution.
Alright thanks a lot, Also in one of our store CUSTOM BRANDED BOXES, the price for one of the product keeps changing frequently even if we dint change it any idea?
@sivainguva without more details it's difficult to determine what the culprit could be.
I suggest marking this current thread as "Solved" to let others know that you found a solution for company name. If you are still needing assistance with the product price issue, you can create another thread with more details on the problem you're reporting and perhaps someone else here on the forums can jump in and provide some assistance. Of course you can always contact Shopify's support team directly as well.
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.
Hey That sounds good, just a quick question, so where does that show up in shopify if i add metafield ?
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 }}.
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.
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
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:
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.
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):
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?
Hey Kyle,
Please help me on this.
Hey @sivainguva!
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?
When a logged-in customer proceeds to the checkout process on Shopify, the address fields will be prefilled with the customer's default address. If the customer record does not have a default address, or if a new address is supplied during the checkout process, then the Shopify will update the customer record once the order is placed, and the address collected during checkout will be saved as the customer's default address.
Does this help to answer your question?
Thanks that helps.
Hey Kyle,
Just a quick question, As i told we are asking the customers their address during the account creation on our website , by looking at this api document , i wonder how would i get the customerid , during the account creation ?
https://shopify.dev/api/admin/rest/reference/customers/customer-address#create-2021-07
When you create a customer record via API, Shopify will include the auto-generated customer ID in the response: https://shopify.dev/api/admin/rest/reference/customers/customer#create-2021-01. You would then need to reference this customer ID when making another call to the Customer Address resource to create a customer's address. Note that you can also define an address when creating a customer record, thus eliminating the need to make a separate call.
Hey Kyle,
Thanks for response, Can we include the companyname in the address if we are trying to make single api call by adding address when creating the customer record?
Hey Kyle,
Please let me know if you dint get my question.
Can we include the companyname in the address if we are trying to make single api call by adding address when creating the customer record?
Yep, you sure can!
Hey Kyle,
Thanks a lot for the response , so now i am passing the address during the customer record creation. like this
{ "customer": { "first_name": "Steve", "last_name": "Lastnameson", "email": "[email protected]", "phone": "+15142546011", "verified_email": true, "addresses": [ { "address1": "123 Oak St", "city": "Ottawa", "province": "ON", "phone": "555-1212", "zip": "123 ABC", "last_name": "Lastnameson", "first_name": "Mother", "company_name": "Test", "country": "CA" } ] } }
So one last question if i do like i will be able to see the address in shopify admin under the address column right?
You're almost there, @sivainguva!
`company_name` is not valid property, so you'll need to use `company` instead, like so:
{
"customer": {
"first_name": "Steve",
"last_name": "Lastnameson",
"email": "[email protected]",
"phone": "+15142546011",
"verified_email": true,
"addresses": [
{
"address1": "123 Oak St",
"city": "Ottawa",
"province": "ON",
"phone": "555-1212",
"zip": "123 ABC",
"last_name": "Lastnameson",
"first_name": "Mother",
"company": "Test Company",
"country": "CA"
}
]
}
}
Alright thanks a lot, Also in one of our store CUSTOM BRANDED BOXES, the price for one of the product keeps changing frequently even if we dint change it any idea?
This is an accepted solution.
Alright thanks a lot, Also in one of our store CUSTOM BRANDED BOXES, the price for one of the product keeps changing frequently even if we dint change it any idea?
@sivainguva without more details it's difficult to determine what the culprit could be.
I suggest marking this current thread as "Solved" to let others know that you found a solution for company name. If you are still needing assistance with the product price issue, you can create another thread with more details on the problem you're reporting and perhaps someone else here on the forums can jump in and provide some assistance. Of course you can always contact Shopify's support team directly as well.
Hi All,
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024