Shopping Cart - Wix Code

Hi,
I have a few questions:

  1. Is there a way to query the shopping cart by wix code?
    For example, I’d like get the SKU of each item in the cart and display a text message if there is a SKU=x, or another example if the cart value is > 100 → do something.

  2. Is there a way to register to a call back in case the payment stage ended? For example I want to insert to the DB some information in such a case.

  3. Is there a way to register to a call back once “Add to Cart” button is clicked? If so, can I get the item added to the cart in the callback?

Thanks,
Amir

2 Likes

Hi Amir,
Currently, there’s no integration of Wix Code with Wix Stores. However, it’s on our backlog. I recommend following the product updates forum category to stay tuned.

Have a good day,
Tal.

1 Like

Hey

So if I were to be creating a plugin that queries data from the cart, how would I go about it ?

Just so you know Wix Stores is now a part of Wix Code

Hey Shan,

I know that, however I don’t see anything on Wix Stores that would allow me to get data from the Cart. Can you suggest something for the same?

Hello Amira

Have you found solution?

Did anyone find good way to read shopping cart data using wixcode. I am trying to display current cart qty before user add new iteam to cart.

Hi, Has anyone found a solution for this? Looking to be able to do the same when cart has been created.
Thanks,
Tom

https://www.wix.com/corvid/reference/wix-stores-backend.Events.html

https://www.wix.com/corvid/reference/wix-stores.html
https://www.wix.com/corvid/reference/wix-stores-backend.html

1 Like

Any chance of an example demonstrating the documentation? I think we’ve probably all read it, and looked at little code snippets that are supposed to work but don’t.

1 Like

If you read the Wix API reference links that I have already posted above they should give you code examples of the Wix API and any of its functions.

Here’s an example of a bulk add to the Cart:

Bulk Add to Cart

Let customers add multiple items to their cart—all at once.

The backend event of " wixStores_onNewOrder " does not work for the wix stores. I do save to an “events_log” table when each event occurs to track down and document issue of why not working.
Worked fine on our test site now that it’s live it fails. It either:
a) fires event before the order is saved in the “Stores/Orders” collection so getting the order out of the collection returns no rows
OR
b) The event is fired several hours (have examples of 5 hours) after the original purchase

This post is old, please open new thread with your own problem instead of bumping up old posts.

It’s against the Community Guidelines .