Forum Documentation Showcase Pricing Learn more

Conditional formatting for button when "In shopping cart"


#1

Hi there,

I am trying to format an “Order” button with a different color and different text under a certain condition. The condition of interest is to change the “Order” button to an “In Cart” button when the product has been clicked (i.e. ordered) and thus already “In Cart”. And again, back to “Order” once button is clicked again.

Currently the “Order” button sends the data to another repeating group for “Items in Cart”. I’ve tried several different logics to get the conditional formatting. However, for some reason, the logic just turns red with any kind of logic that could work. Examples such as:

  1. When Shopping Cart’s List of Orders contains Current cell’s Order
  2. When Current Page User’s Cart’s List of Bookings contains Current cell Order
    etc.

Might there be some easier way to do this. Basically I guess the logic should work a little like a toggle switch…

Thanks very much in advance!

Br,
Jonas


#2

Any support on this one?
Many thanks!
Brgrds,
Jonas


#3

Can you show your data structure?


#4

Thanks for replying Beau!

User (2 types buyer/seller) - the seller posts what he/she sells
Product - the item the seller has posted
Order - When an order button of one product is pressed, and order is created
Cart - created as a list of orders

So basically, when an product has been pressed, i.e. an order created and added to the cart, I’d like to add a conditional formatting to the Order button of that specific cell (in a repeating group).

Thx Beau for your help!


#5

something like this?



#6

Yupp!


#7

30

It seems like it should be working but still when actually trying it out it does not change the text…


#8

hi, send me a private message with your editor & i will get it working for you


#9

Thx Beau - I got it working by matching the unique id for the class and the booking in cart. Don’t really understand why my data structure did not understand your example :S.

How do I “send a private with my editor”?

Brgrds,

Jonas


#10

in settings/general you have an option to change your editors viewing permission, private, anyone can edit, anyone can view. Message; you click on my name and theres a button. to share editor you copy the url