Shopify Cart Manipulation

Solved
chris-heady
New Member
3 0 0

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. 

  • Website (Shopify)
  • Mobile App (Shopify SDK)
  • Waitlist (Custom Middleware application)

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 

Accepted Solution (1)

Accepted Solutions
PaulNewton
Shopify Partner
4214 303 902

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.

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com

View solution in original post

Replies 5 (5)
PaulNewton
Shopify Partner
4214 303 902

Hottake is you would be using cart permalinks, or generating draft orders.

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
chris-heady
New Member
3 0 0

Thanks @PaulNewton Not sure what you mean, are you asking if we are using permalinks or draft orders?

PaulNewton
Shopify Partner
4214 303 902

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.

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
chris-heady
New Member
3 0 0

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. 

PaulNewton
Shopify Partner
4214 303 902

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.

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com