Jump to content

When product->quantity = 0 set background color red


Recommended Posts

Hello Forum,

I'm working on optimizing my product page. I have a product with multiple product attributes (colors, sizes) only now I want that if the stock of the product 0 is that the background color is red, but when the stock 1 is green.

For all product attributes I use the color_to_pick_list function.

So if the stock of the product is 0 then the background color to change to red but as the stock one or more than the background color should be green.


I have attached two pictures. The image (first.png) is what it is today. And the image (result.png) is the end result.


I hope someone knows this.

thanks in advance




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...