Woocommerce overriding the “Add to Cart” Button based on a true/false ACF

Currently working with this code, changed some stuff to display some data based on price, but I am attempting to target the “Add to Cart” button instead of the $price. Any help on reformatting?

//* This Function Displays Text When Price Is NOT Set *//
add_filter( ‘woocommerce_get_price_html’, ‘set_request_quote’, 100, 2 );

function set_request_quote( $price, $product ){

if ( get_field(‘is_quotable’) === true ): {
$price = ‘price is quotable’;
return $price;
}
else: {
return $price;
}
endif; }

Read more here:: Woocommerce overriding the “Add to Cart” Button based on a true/false ACF

Leave a Reply

Your email address will not be published. Required fields are marked *