Change “add to cart” button color based on Woocommerce product category [closed]

This is a filter. It should return value, not render HTML/CSS/JS inside. For your color change, why didn’t you override the template file. eg: woocomerce\single-product\add-to-cart\simple.php