WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories
You can just add another check within that filter – get the category of the product the filter is currently active on and compare it with the category you want to target. add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘replace_loop_add_to_cart_button’, 10, 2 ); function replace_loop_add_to_cart_button( $button, $product ) { if( $product->is_type( ‘variable’ ) ) return $button; // array of slugs … Read more