Ability to add conditions with appconnect action events

I have a cart that I count the items when cart is updated. Truth is that I never set any value=0, it is just set to 1 when a product exists in the cart, but if I delete the product I do not set it as 0

Following expression will work when temp_cart_quantity is empty {{!get_items_in_cart.data.totalCost[0].temp_cart_quantity ? browser_empty_cart.goto('index.php') : console.log('')}}

I tried that too, but it always evaluates to true. It always executes the browser redirect. Checking something, else too. Thank you!

Faraway so close ughh not working. Will find it. Thank you!

Is this (temp_cart_quantity) a database field, returned by your query?

Yes it is let me check how it updates. Thank you

Yes the issue is that if eveything is deleted from the cart there is no database field to return. So I need to compare it to something else. Create a count or maybe if there is comparison when query return nothing

I think it’s been suggested that due to limitations in Wappler, it’s best to use a database table for a shopping cart, rather than cookies (which I think it the standard way to do it). However I think it’s possible with cookies - and there is no problem getting a count etc… I could send you a link to something I’m working on in case it’s of interest.

Thank you @TomD , yes I am working with tables too, it is just I get no results when query is empty

Niko,
Please send me a link to your page in a private message so i can see what exactly the data returned is.

Any luck on built in support in wappler for ternery operators for building conditions and nested conditions?

Using App Connect flows you can add any conditions and run any steps based on the condition output.