Mission: Increase/decrease item qty by staying on the item, but when QTY reaches 0, remove item!
• Primarily, shopping carts but other uses too.
Some context first.
PRE-CUSTOM ACTION DAYS
It’s October 2020. X has added 3 items to wish list (cart). The flow is as follows (with individual variations, but whichever variation was deployed the outcome was nearly always the same):
• Select item> increment>go to cart>either decrement and/or remove item
• Select item > go to cart > increment/decrement/remove item.
• Some carts didn’t even let poor customer remove an item once selected.
• Made no difference whether we used a script, as script cleared entire order associated with an email. We were not targeting individual rows based on complete/in-progress.
• Introduction of Joined list –new life, as we all know, was injected into the Shopping cart.
• Introduction of twin buttons for +/- (they either don’t work or are not officially supported by Glide).
POST 17 NOV 2020 -
Watch the video (dark mode so you get a clear picture): What’s happening?
How to create your own plus/minus button.
• You have an orders sheet?
• Go to the editor, and create a USP Boolean- let’s call it the “decrement Boolean (“DB”) ”
• On the cart tab, tap open the inline list containing all you items, and set the layout to “Checklist”.
• Pull “DB” as the check value. This is no ordinary Boolean. It is your +/m Boolean.
• Open CNA
• Start action >
(1) if DB is not true>increment Qty by 1:
(2) if DB is true > decrement qty by -1:
(3) if DB is true & qty = 0, then view details of orders sheet.
(4) Give it a name, and save. Then return to the Cart.
Q. Why did I use a false value to increment, and not decrement?
The logic is quite simple. When customer goes to the cart, having viewed and selected the items, the first natural thing to do is to add qty. I wanted to maintain the flow. So I selected a false value for +, but if they wanted to decrease Qty to ask them simply to check the false value to turn it to a true –(minus) value, and then just keep tapping on the same item until they reached their desired number.
My next worry was I did not want them to get pass the Cart with items with a 0 qty value. Just doesn’t look nice on the final order. Hence, the 3rd condition. So as soon as qty reaches 0, the delete item page opens, prompting them to remove the item. Of course you would need to set the checkout visibility to when qty is not 0 (I will let you work it out)!
If it makes a difference, great!
If it doesn’t, sorry!