How to Change colour in button

In add to favourite button ,how to do that it will change colour when i add the product in add to favouritr  then button colour changed  and also when i remove the product in add to favourite   it come back to it’s default colour? Pls kindly give some solution for this.
1 answers

Hi Surya,

Use dynamic classes property of the button , which checks the the status if Favourite product is added -
For example , create FavoriteProduct entity and associate it with the selected Product when adding to favorites. Delete the associated object when removing from favorites.

create css classes - button-red, button-blue

Add this to the namic classes property of the button AddToFavourite

if $FavouriteProduct/FavouriteProduct_Product = empty then 'button-red' else 'button-green'