Sharing a checkout between a websites on the same domain

dgrigg
New Member
3 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?

0 Likes
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!
0 Likes
dgrigg
New Member
3 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.

0 Likes
dgrigg
New Member
3 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?

0 Likes