Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Products showing up inside the Sanity Studio #3

Closed
petercr opened this issue Feb 3, 2021 · 3 comments
Closed

Question about Products showing up inside the Sanity Studio #3

petercr opened this issue Feb 3, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@petercr
Copy link

petercr commented Feb 3, 2021

Great project 🤘 Quick question about the Products syncing in Sanity

First off, great job on this project 💯 🔥 🔥
I have been looking through the code, and really digging it.

So I have the whole project up and running locally with the Sanity Studio server running on http://localhost:3333 and I have the Next site running locally on http://localhost:3000.

When I go to the Shop section of the Studio, everything looks to be working fine.
I can see listings of Products there, and I can see listings under Product Variants.
But only products that have variants are getting listed in either section.
If I add a product on Shopify without variants, then I don't see it in the Studio.
It looks like it is just doubling up the Product Variant data instead of having 2 different types of product data.

I didn't know if you had any idea as to why this was happening, or how best to debug it?
Any insight would be appreciated 👍

Thanks 😄

Here are some screenshots showing I get the views and url's for both Products and Product Variants.

Product View:
sanity-products

Product Variant View:
sanity-product-variant

@ndimatteo
Copy link
Owner

Hey there @petercr thanks for the kind comments! 🙏 I'm glad you're digging using HULL!! 🤘

Your screenshots look to be displaying product data properly, but in your screenshot of the "Product Variants" view, you have to click into a product to see the associated variants for it (in case that wasn't clear). If there are no variants set in Shopify for a given product, there will still technically be one variant (the only variant) for the product (this is even how Shopify denotes products in their data structure).

All products, regardless of variants will have a base product document in Sanity, which are in the "Product" view, and is what the "Product Variants" are grouped by.

Also, remember that products are sync'd using the shopify webhooks which hit the shopify sync api endpoint for Next (/api/shopify/product-update). So if you had products created before the webhooks and sync were setup, those products will not get pulled into Sanity until you make some kind of change to them on Shopify.

If that all makes sense, maybe I'm still misunderstanding what you're experiencing, so please let me know!

Perhaps it would help to know what you're expecting to see, vs what you're actually seeing?

Let me know if that helps, looking forward to hearing more!

@ndimatteo ndimatteo self-assigned this Feb 4, 2021
@ndimatteo ndimatteo added the question Further information is requested label Feb 4, 2021
@petercr
Copy link
Author

petercr commented Feb 4, 2021

@ndimatteo Thanks so much for getting back to me so quickly 🚀

I feel like SUCH a noob 😆 so you were right about this part:

Also, remember that products are sync'd using the shopify webhooks which hit the shopify sync api endpoint for Next (/api/shopify/product-update). So if you had products created before the webhooks and sync were setup, those products will not get pulled into Sanity until you make some kind of change to them on Shopify.

I had a product that was in Shopify and was not showing up in Sanity.
That is was I was trying to get across with the previous message.
I call it "The Case of The Missing Pants" 🔍

I went to the Shopify Admin section, and updated some of the info on the product. (price & inventory)
Then I went back to Sanity and check the products again, and there it was 🤦
It seems it was just a matter of needing to update a value on the product, and the web hook picked it up 🔥

Thanks again for the help, the issue is all set now 😎

@ndimatteo
Copy link
Owner

@petercr haha no worries at all!

It's an easy thing to overlook with something like this, happy to help! 🤘

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants