Article brought to you by buildnextshop.com
In the last couple years, we have all gotten extremely comfortable with online shopping. This has push...
For further actions, you may consider blocking this person and/or reporting abuse
@iskurbanov is there a way to pass a custom option/variant to a certain product, and display it in the cart and checkout? Something like a textfield for an engraving, gift message, etc?
Any pointing in the right direction would be greatly appreciated!
Hey Ben, you can achieve that using the "Custom Attributes" when you are creating the checkout URL. Here is the reference: shopify.dev/api/storefront/referen...
Let me know if that helps!
@iskurbanov Thanks! I think it does help.
Are these "customAttributes" per product? or per cart?
If I purchase your course, does it come with this type of support? 🙂 I'm a bit new to these parts
You would add the customAttributes per line item into your cart/checkout.
Definitely! I think after the course you would have a good idea on how to create custom option/variants for your products. We go in-depth with using GraphQL to interact with the Storefront API.
I was hoping it would be as easy as adding customAttributes here:
And passing this as an object with a value from a textfield in the UI:
customAttributes: [{ name: 'Name', value: 'David' }]
But this doesn't seem to work
Hey Ben,
Almost! It has to be a key-value pair, so something like this:
If you click on the [AttributeInput!] it tells you the format: shopify.dev/api/storefront/referen...
Let me know if that helps!
Great! But, now where do I see the custom attributes? I cant see them on the order page.
Great course btw!
You should see them on your Shopify admin dashboard under orders.
nvm, I figured it out.
thank you very much for this please update your field schema some are deprecated
Thanks for the tutorial. Very much appreciated. After following this step-by-step, I somehow continue to get this error:
Super new to shopify, how can I debug this?
Hi Chris, seems like there might be an issue with your env file. Double check to see if your values are set up properly. You can also try to input your env values directly into your code to see if that resolves the issue.
Thanks so much @iskurbanov , I am a Junior level React dev and this was super helpful to get me started. I will take the entire tutorial. Your content is super clear and you explain things very well. I appreciate it!
I am getting this error :(
dev-to-uploads.s3.amazonaws.com/up...
Could you push your code to github so I can take a look?
github.com/fernandodomain/Headless...
Shows a 404, maybe it a private repo?
Sorry. Made it public
Try to add a next.config.js file to the root directory like this: github.com/iskurbanov/shopify-next...
Your next.js might have issues accessing your env file (also I would suggest not pushing that on your public repo in case you have some sensitive information there, luckily the Storefront API is readonly).
Do you have some idea how to update the Shopify APP boilerplate with Next 12 version?
You can try changing the next.js version in package.json and then run the npm install command. I would personally wait a bit before implementing Next.js 12 on any major projects.
Do you have a course catalogue?
Hi, if you’re referring to the outline, it’s available at buildnextshop.com. Let me know if that helps!
Should this all still work with shopify deprecating private apps? Theres only custom apps now.
Hi Dan, yes it's the same thing, just different name.
for some one reason im only pulling in 1 product?
for some reason i couldnt get the updated index.js to work but the this one in the tutorial worked for me
I made such a design for fashion, you can examine it.
github.com/okanserbest/Shopify-Nex...
Looks great!