Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Sharing a checkout between a websites on the same domain

Sharing a checkout between a websites on the same domain

dgrigg
Shopify Partner
4 0 0

I am in the process of building a marketing website for a client that has an existing Shopify store. They want the product details and checkout pages to remain on their Shopify store. On the new marketing site they want an indicator on the site to show a site visitor that they have items in their cart, if they have added some on the Shopify site, and a link to the checkout (on Shopify).

Using the Shopify SDK I can see how to get an existing checkout/cart to determine if the cart has items in it and also how to get a checkout link. What I need to figure out is how to connect the cart on the Shopify side to the marketing site. If I create a checkout/cart on the marketing site via the SDK, and then follow the checkout link, which directs me to the Shopify shop (running on a sub domain) everything looks good. However if I go to the main product catalogue on the Shopify site to continue adding items to the cart, it's an entirely different cart from the one I started on the main domain.

Is there a way to share a cart between the Shopify and another website? Both the marketing site and the Shopify site run on a common domain. I had thought possibly setting a cookie on the Shopify site that could share the checkout id, but it seems like there's a disconnect between the two sites.

Is this possible?

Replies 3 (3)

hashtd
Excursionist
15 1 3

You can use `js-buy-sdk`  to solve this issue vie sharing checkoutId between your shopify site & marketing website. (cookie, localstorage etc)

then on page navigation/change fetch added products/variants vie Storefront API on marketing website using checkoutId

 

this mean you may have to rework on shopify site if it is using AJAX API/liquid form

https://shopify.github.io/js-buy-sdk/

- Was my response helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
dgrigg
Shopify Partner
4 0 0

I am using the js-buy-sdk. I had assumed anything I started via the sdk (ie checkout) on the marketing site would be visible when I go to the shopify site subdomain but that doesn't seem to be the case.

dgrigg
Shopify Partner
4 0 0

It appears that the Private Shopify app I created to use with Sdk is a different sales channel from the main store channel. Is there a way to use the SDK with the store channel?