I'm trying to add a custom link button that leads to Contact page - within first if condition that displays "Contact us" text with custom URL on the button instead of "Add to Basket" button.
How to do that? This is my code so far. It shows custom button text for each product which is part of category "64". That's exactly what I want. But how to add that button changes function from cart button to custom link button? Im figuring If have to change this cart buttons function. How?
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' );
function woo_custom_cart_button_text() {
global $product;
$cat_id = 64;
$product->get_category_ids();
if ( in_array( $cat_id, $product->get_category_ids() ) ) {
return __( 'Contact us', 'woocommerce' );
}
else {
return __( 'Add to Basket', 'woocommerce' );
}
}