Since there doesn’t appear to be any way to build a shopping cart and integrate it with Paypal in Wappler, if I build a site in Wappler and then take it into DW to use the Sliding Paypal extension will I run into issues?
I have a site that I need to rebuild soon and I’d really like to use Wappler. Going back to DW is painful now.
I too have been wondering how best to approach the need for adding a shopping cart in Wappler… The last shopping cart I used was eCart from Webassit in DW. I do not want to go back to using DW. I’d really like to port everything over to Wappler. Anyone know of a solution or a timeline to one?
Well just a simple shopping cart you can do yourself pretty easy with the App Connect and State Manager.
I think @Teodor has a step by step guide somewhere.
Will do - we were already looking for building more close integration with Stripe - because they are the best
Something like Stripe Connector - having both front-end side (App Connect components) and also back-end side (Server Connect) for handling the stripe hooks for full blown integration.
I am creating an ecart with AppConnect and it is not that difficut. I am using a table to set the items in the cart, a cookie value to remember the user who is adding the items in the cart. Once you have this set it is super easy is to create the add | update | delete to cart. I had a chat with Teo a few months ago about this but can’t find our conversation. If I find it I will post it here.
Hey Armen,
I am afraid no such a tutorial is available - just a couple of guideline posts in DMXzone forums.
I will try to setup a step by step guide in the how to section about creating a shopping cart, storing the users session IDs in a cookie and filtering the database table using it.
I think this would be very useful - not just to demonstrate an extremely common website feature (a shopping cart), but I would imagine it would also cover several techniques which may be puzzling to someone new to Wappler. It could be a very good example to show off Wappler’s power.
I had decided there were too many features missing - at least from the DMX extensions - to create a shopping cart, and decided it was simpler just to use PHP. I would prefer to use Wappler if possible.
The main problem was the it seemed not to be possible to use sessions or cookies to store the cart information. I don’t know if this possible in Wappler. I see ‘Add Array’ and ‘Add Object’ options in Wappler - do these work? I would really appreciate some information on adding/removing elements to/from sessions/cookies if it’s now possible. When we discussed this some time ago, you suggested using a database table as an alternative.
The other problem was that it didn’t seem possible to send order confirmation emails etc. - because dynamic content can’t be included using the mail feature (I think this is still the case in Wappler). If you can suggest an alternative approach, that would be very helpful (or perhaps this extension will be improved). I realise this is not directly related to shopping carts but it’s something someone developing one will probably need - and might be surprised to discover wasn’t possible (if it’s not).
Hi, it is possible to sotre cart details using a cookie value. I am already building a shopping cart using AppConnect. My issue is that I am still working on it and can not send link to this website.
Okay i will try to explain the logic here, so you can get the idea.
First you need a session cookie and a session which we use to identify the users (no matter if they are logged in or not).
This can be done using the following code, placed on top of your page:
What this code does is to set a session cookie for 86400 seconds - i.e. it will keep the cookie for 1 day. Change this to whatever you like it to be. This is what keeps the products in the cart when the users enter the site after a certain amount of time.
Then it sets a session called “cart_session” which gets a random (unique value) for each user.
Then you define this session under globals in every server action related to the cart - in add, update, delete actions and in the cart contents action:
Create a table which stores cart content. It will store the content for all the users carts. Then we filter it by this cart_session value.
So in add products to cart server action you insert the product ID and use cart_session in the database:
And when displaying the cart content you use the same cart_session for the cart content action to filter the cart content table.
Same for update and delete actions - filter by the cart_session value. Then on successful checkout, you just remove everything related to this cart_session value from the cart content table.
These are the basics required for basic shopping cart functionality. Of course, you can extend it to check if a product exists in the cart content table for this user on add product - run database update instead of insert.
You can extend it to use coupon codes etc. but for basic shopping cart/wish list functionality the above is functioning perfectly.