Skip to content
Advertisement

How to restrict a div for on sale products in woocommerce

I have made a div with a specific class that shows the sale percentage of a product that is on sale. But i want to remove this div when the product is not on sale. I don`t know how to write the php code. please help me.

This is my div with php code that works well with on sale products:

JavaScript

Advertisement

Answer

My problem solved with this snippet:

JavaScript

It`s important to know how to use html in php.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement