Best practice/best way to create Shopping Cart

Hello together,

i am now so far with my App and need to create in my next step a Add to Cart + Shopping Cart function.

Basically i have 4 product which are static pages and for each the collection is static as well with xano.

Now i really don’t know how to start to create that without Snipcart.

Maybe someone of you has done that before or can give me a basic idea i can start with.

At the moment each product page has a input field for the amount of products and a add to cart button. In a drawer it should show the added products.

Any help and support i would appreciate.

Many thanks in advance

You mean an array of items that you store in the local storage and (in an ideal world) you do the logic in a backend?

Man I wish your videos were also translated in English, I’d watch them all.

From what I understood, this is not the best idea though. It is a great proof of concept. BUT… If you have many users buying, and a product runs out of stock, without communicating to the backend, you won’t be able to tell and let the user add the item to the cart anyway. The best way would be to do this also with backend, and add the items to the cart based on that.

Thanks guys.

One question regarding here: https://youtu.be/8Myqh94AiNQ?t=727,
if i do that, it will update me the quantity by adding the amount at the end.

Example i have this already in the cart
“quantity”: 32

but in my case if i add the prodduct one more time to cart the result will be
“quantity”: 321 and not 33

Thats strange,

if i use an other operators it works, but with “+” its not working.
Did i type it wrong?

image

one of the values that you are adding is actually a string, use the toNumber formula in the math section to transform the value before the addition

@dorilama Thanks…

That was it. :slight_smile:

1 Like