How to use the new Data Store

The new App Connect Data Store is excellent and the timing is perfect. I’m literally just starting the cart part of a project.

I’ve added it to the product detail page and use the mouse click action on the ‘add to cart’ button to insert a record and it’s showing perfectly in the local storage. I’ve also spotted the structure is added to the config.js file so I’m assuming it can be picked up in another page (the cart, for example) but am not sure how.

Would you be able to give a very quick how-to on using this? I know it’s just the start of the new feature but I’m thinking there’s enough there already for me to start actively using it.

Cheers.

Please check:

Thanks @Teodor, I did try to find any existing posts but didn’t see that one.

I’ve read that whole thread but just want to check one thing.

If I store some data using the Data Store on one page (I’ve confirmed it’s stored fine in the local storage) and then want to access it from another page, what’s the process? If I add another Data Store on another page, do I just call it the same and it will then have access to the data? I would have expected some kind of selection of existing stores but this might be coming in the next release?

Not sure if its the correct way but I just have the data store defined in an include file so it is accessible on any page.

That’s not a bad idea. I’ve actually just added a Data Store on my cart page, given it the same ID as on my previous page and the data is all there as I’d hoped.

What an amazing new feature. I’ve now, easily, created a shopping cart simply by adding the Data Store App Connect, creating various array fields and then populating it whenever the ‘add to cart’ button is clicked. I then added a Data Store to the cart page, gave it the same ID and all that data is there. Using the Bootstrap Form Generator I have created the cart view.

SS,
You make it sound so easy. This is basically the 1st report I’ve read on the Data Store/Cart in Wappler - it just hasn’t been on my radar.
I’m at a point where I could add a cart to my app for auxiliary/merchandise purchases - its one of the reasons we were not going with a true mobile app and giving away $ on purchases to the App stores in commissions. We are using Stripe on our WordPress site for Registrations.

So, just wondering how you’ve felt 2 years on about Carts in Wappler - and I imagine its even better since they improved integration with Stripe!

Hi @Robert_LM

The datastore in Wappler is perfect for shopping carts and I’m loving them just as much now as I did 2 years ago. You just create the data structure however you want it - product name, id, colour, size, price, quantity, etc. - and then it’s a simple process adding items to it and your cart is a simple repeater which shows the datastore data.

I’ve still not used the Stripe integration after already doing manually but my next project will use it so I’m sure it will be much better.