Can Adalo set a time limit on a customers cart (basket) items?
For example, if my app sells event tickets with a limited capacity I want to avoid customers holding available tickets in their cart (or basket). I would like to advise them they have 5 minutes to complete the purchase with their secured spaces on the event before those spaces are put back into the availability pool.
You may want to start a countdown timer on the Cart page once user selects the tickets, and inform the user that the tickets are available for next 5 mins (for example).
When the 5 mins timer is complete, check whether the temp cart is still active, if it is active, trigger action to remove items from the cart and redirect user to start again.
If the user already checked out when the timer ends, do nothing.
Hi Ash. You must remember that the solution Bhanu offered will only work if the user stays on the same screen. The countdown timer does not carry over to another screen. To achieve this you must set actions on screen load that calculate the current time compared to when the order was started and then you can delete the items if a certain amount of time has elapsed.
āDo you have any idea on how to empty the cart / delete the order if a user simply force closes the app?ā Unfortunately at the moment there is no way to empty the cart when a person force closes the app. For this you would have to use the same process as mentioned above.
Will either of the solutions continue to count down if a user closes the app? For example, if a user force closes the app does the 5 minute timer continue to count down and when it reaches 0 delete the cart items?
Iāve just been looking at the screen load options but I can only work it how it will calculate if users have exceeded 5 minutes when they first load the page. How would I have the action refresh every 30 seconds or so?
To be honest I have never tested the countdown timer when closing the app but I have a strong feeling the answer is no. It may continue counting when the app is opened again but this defeats the object of what you are trying to achieve.
The other solution will not work until the user opens the app and then visits another page as it only works with an action set on screen load or button click. You can set an action to run every 30 seconds by using the countdown timer but this would erase everything on the screen so would not be a good experience for a user.
Iāve just tested the timer to see if it does empty the cart / delete the order after expiring if a user closes the app. Sadly it doesnāt. As Iāve understood it then there is realistically no way in Adalo to either:
Set a time limit from when a user adds a product to their cart for it to be deleted if the purchase is not completed (it seems normal that they will move from an add items to a payment screen)
Empty the cart / delete the order if a user force quits the app
So how are people who run eCommerce sites replenishing their stock count from incomplete orders?
@Ash1 If you want to clear if the user closes the app or goes away from the screen, one way is to use integromat and trigger the process of clearing the cart.
When the user comes to the cart page, you send a webhook to integromat to start timer and when the timer ends you call the http module to check the data in the cart, if it exists, go ahead and clear the cart. This works even if the app is closed or user is in another screen
Iāve been trying to get my head around Integromat today and I think Iāve created the 5 minute timer correctly using the āsleepā fuction. I then wasnāt sure what the Record ID should be so Iāve created a random Record ID property in āOrder Itemsā and used that. Is that the correct thing to do?
Iām a little unsure about exactly how to set up Integromat and if my database needs updating. Hereās what Iāve got at the moment:
Database Structure
Timeslot - Timeslots are created with a specific event, date, time & maximum capacity
Order
Order Items
Products
Purchase Flow
User creates āOrderā by clicking on an available āTimeslotā
User creates āOrder Itemā belonging to current order
User selects quantity of āOrder Itemā (this reduces the remaining capacity field in the āTimeslotsā collection by the selected quantity)
User pays on the next screen and āOrderā is updated to show āPaid?ā as Yes
Once a user has created an āOrder Itemā they have the option to edit the quantity or delete it all together. This also updates the āTimeslotsā remaining capacity field to add back on the delete amount.
Currently, I have a āPaid?ā property on the āOrdersā collection but not on the āOrder Itemā collection. Do I need to add this so the http module checks whether that value is true/false and Integromat triggers an action accordingly - like below?
Check if āOrder Itemā property āPaid?ā is true - if true do nothing
If it is not true:
Update āTimeslot - remaining capacityā to Timeslot - remaining capacity + current order item quantity
Delete āCurrent Order Itemsā
Based on the above how should the http request look? This is the Integromat scenario Iāve got at the moment:
If you have a date time property at the left behind cart, you can check them before going to the order screen and use interim screen to delete them using countdown, if the count is 0 for the filtered of that date time property you can link back and show cleared cart.
Iām not sure if this is the best solution to the problem that I have or for eCommerce sites with limited stock.
In the app that Iām building there are only a certain amount of tickets available and potentially lots of users trying to book them. I need the app to secure the tickets for the logged in user once theyāve added them to the cart. However, if that user doesnāt complete the purchase I then need those tickets to go back into the available market.
I feel like this is the correct purchase flow for most eCommerce type apps where the user should be given a certain amount of time to secure their purchase. Perhaps this isnāt a problem if you have a large amount of stock of the same item but in the case of tickets, limited edition sales etc. it will be.
To have actions in Adalo, we need trigger which can be interactive such as clicking button by user or countdown, so if you canāt get those triggers, you may need other integration tools.
But just one more idea, can you put countdown at home screen and update the number in seconds with magic text that can save and resume between screens, so each time you link to another screen, you save this number, then resume again whenever user returns to home screen.
If the user never return to home screen, then you need to put countdown to every screen, so it will still run everywhere.
When finished, link to interim screen that will do clearing cart.
for the http module, you should use the recordID received in webhook trigger when a new order (unpaid) is created.
After you get the record, you need to add a filter module and check if the order is PAID, if not trigger a delete order + a for loop to go through the order items with the current unpaid order and delete those order items from the DB. for each delete, go back to the stock and update the QTY to QTY+1
If the order is PAID when checking with the filter, do nothing.
Iām setting up the HTTP module at the moment but Iāve ran into another issue. I canāt get the webhook data sent to Adalo to include the true / false field for āPaid?ā which is stopping me using it as a filter.
Anyone got any ideas? Hereās a screenshot of where Iām at the moment:
Also - Does anyone see a potential issue with deleting the order and order items?
Iām wondering what would happen if a user clicks on the payment button within the time limit, but it goes over 5 minutes during their payment. I assume their order will still be deleted but they might be able to complete payment still and end up with an order that doesn
@Ash1 I think you can modify the webhook data triggered by Adalo to receive the True/False field information.
I would probably do this a little differently, instead of targeting a delete for every order, Iād just mark the OrderID invalid after 5mins.
And then do a batch cleanup everyday once for all the invalid orders.
For the front end check, you could probably approach in a different way too. Hereās what I think will work.
When the user comes to checkout page, take a timestamp and store it in a separate field
When the user clicks āProceed to Payā (immediately or later); check the current time - timestamp of the checkout page
If the time difference is more than 5 mins, bring up a modal or error screen and mark the order invalid
Redirect user to start fresh when #3 happens
Do not subtract order items from inventory unless the checkout was successful (this can help your inventory tracking clearer)
At #3 - if youāre worried about double-selling due to not tracking of inventory - you can add a check to see if the stock position is still valid to proceed with checkout, to avoid selling more than you have.
Create a batch run EOD to check all invalid orders and clear them to save the space in your db.
Thanks again for another very detailed reply @bhanu!
I really like the idea of making the orders invalid rather than deleting individually and then doing a batch clear up - will definitely implement this! I also think your front end flow is cleaner than what I had in mind and will probably reduce any issues with constantly updating stock count (especially if a lot of users are purchasing the same product at the same time).
Iām still having an issue sending the āPaid?ā true/false field to Integromat though as itās just not appearing - see below:
Iāve been playing around with the order flow today and Iāve come to another issue (sorry!..).
If I use your suggestion above and do not remove the stock count until payment is made how will I ensure there is enough stock before a user pays?
All I can see on the stripe payment component is āafter successful paymentā which doesnāt give me the option to check if the quantity the user has selected is still available and therefore could lead to a payment being made where I cannot supply the product.