I try to add a div underneath the WooCommerce Add To Cart button on product pages within certain categories.
I'm a bit at a loss here. This code is not breaking anything, but the text is not showing.
I've tried: .woocommerce div.product form.cart::after
, but that applies to all products.
Here's the PHP snippet:
function add_polarity_info() {
global $product;
if( is_product() && has_term( ['telecaster-pickups', 'strat-pickups', 'bass-pickups', 'p90-pickups', 'humbuckers', 'dynasonic-pickups', 'mini-humbuckers'], 'product_cat' )) {
echo 'If you are pairing with pickups from another manufacturer and are concerned about polarity and phasing, please let us know in the NOTES field on the checkout screen';
}};
add_action( 'woocommerce_after_add_to_cart_button', add_polarity_info() );
Can someone point out the problem with my code?