If you’ve ever watched Trevor Harmon’s talk on Gatsby and Shopify, he does explain the integration between both.
Basically, in Shopify, all you need is
- Shopify partner account (for someone aiming to test this)
- Bogus gateway for payments
- Create new private app in Shopify. Storefront API, and select the boxes to read product tags and read customer tags.
- Create products. Options – size, color, … Variance – combination of options.
Now, to pull data to Gatsby one needs the plugin gatsby-source-shopify and allShopifyProduct has variants with shopifyID and that’s what one wants to use.
Then, for the checkout, he mentions shopify-buy plugin. Thing is, I couldn’t find such plugin.
Found one with similar name called gatsby-plugin-shopify-buy but it has
a slightly different name (In Gatsby plugins already noticed there’s people giving similar names to some good ones as a way to get people to use them) and different methods, so that’s not the one.
How should I implement the checkout then?
2
Answers
Is that what you are looking for
gatsby-plugin-shopify-buy
?According to the documentation, the
context
passed to theStoreContext.Consumer
or as theprop
storeContext
towithStoreContext
child components.This js-buy-sdk plugin is the one you were looking for. For the checkout you’d need something like this