0
votes

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

  1. Shopify partner account (for someone aiming to test this)
  2. Bogus gateway for payments
  3. Create new private app in Shopify. Storefront API, and select the boxes to read product tags and read customer tags.
  4. 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

2 Answers

2
votes

This js-buy-sdk plugin is the one you were looking for. For the checkout you'd need something like this

// Create an empty checkout
client.checkout.create().then((checkout) => {
  // Do something with the checkout
  console.log(checkout);
});
0
votes

Is that what you are looking for gatsby-plugin-shopify-buy?

According to the documentation, the context passed to the StoreContext.Consumer or as the prop storeContext to withStoreContext child components.