Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Greetings,
We have an interesting issue that we are facing with the AJAX Cart API.
We have several systems working together and we would like shopify to play the main Cart and point of transaction.
Ideally we are attempting to figure out a way to use the Shopify API to programmatically manage the users cart so they can checkout, vs having to build our own cart service.
We have a waitlist service for a product that is out of stock, once the product becomes available we want to programmatically add to a users cart and send them a notice that they can checkout. On the flip side, we want to also remove an item from the cart if their window to purchase expires.
However we are having issues keeping the cart in sync with the user, so this leads us to believe we need build our own cart management service and bypass Shopify's.
Any thoughts, greatly appreciate the assistance in advance.
--Chris-Heady
Solved! Go to the solution
This is an accepted solution.
@chris-heady wrote:The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
That's right there's no native way to sync carts , aka persistent cart, even for signed in accounts.
The cart however is in json format shop.com/cart.json so just fetch and push, use cart attributes to store sync state timing information if need be.
persistent carts are a hairy business, goodluck nntr.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hottake is you would be using cart permalinks, or generating draft orders.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Thanks @PaulNewton Not sure what you mean, are you asking if we are using permalinks or draft orders?
Not asking if your using those feature, but stating you may have to use those features to get the outcome your looking for from the info you've provided.
Can't edit posts after 3 hours or i'd fix the initial to clarify /sigh.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Thanks @PaulNewton , Appreciate you response, we are looking into creating a set of middleware endpoints that can manage the cart, waitlist and timing of the experience, then using a permalink to checkout via Shopify.
The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
Thanks for your advice.
This is an accepted solution.
@chris-heady wrote:The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
That's right there's no native way to sync carts , aka persistent cart, even for signed in accounts.
The cart however is in json format shop.com/cart.json so just fetch and push, use cart attributes to store sync state timing information if need be.
persistent carts are a hairy business, goodluck nntr.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org