I am trying to add a custom button on my product page if it belongs in a certain category. For some reason the code is not working, I have used it on some of my other sites so I know it is good code. I tried deactivating all my plugins as well as changing my theme to see if either of those had conflicts but it still was not working. Here is my code:
add_action( 'woocommerce_before_single_variation', 'lp_call_to_order_button' );
function lp_call_to_order_button() {
if ( is_product() && has_term( 'equipment', 'product_cat' ) ) {
//Show Link
?>
<a href="tel:(903)939-3369" class="x-btn x-btn-global"><i class="x-icon mvn mln mrs x-icon-phone" data-x-icon="" aria-hidden="true"></i> Call to Order</a>
<?php
}
}