Hello,
There is no option available for this in the theme settings. This requires customization, which is beyond our support policy.
I have searched for a possible solution and found a custom function that you can add to your functions.php file. I have tested this code on our test site, and it is working fine.
If the provided code does not work as expected, unfortunately, we are unable to modify it further.
Add this to your theme’s functions.php file of the theme.
// Display "Contact Us" button on single product and shop page if price is missing
add_action( 'woocommerce_after_shop_loop_item', 'show_contact_us_button_on_archive', 20 );
add_action( 'woocommerce_single_product_summary', 'show_contact_us_button_on_single', 20 );
function show_contact_us_button_on_archive() {
global $product;
if ( ! $product->get_price() ) {
echo '<a href="' . esc_url( get_permalink( get_page_by_title( 'Contact Us' ) ) ) . '" class="button contact-us-button" style="background-color: #0073aa; color: #fff; padding: 10px 15px; display: inline-block; margin-top: 10px;">Contact Us</a>';
}
}
function show_contact_us_button_on_single() {
global $product;
if ( ! $product->get_price() ) {
echo '<a href="' . esc_url( get_permalink( get_page_by_title( 'Contact Us' ) ) ) . '" class="button contact-us-button" style="background-color: #0073aa; color: #fff; padding: 10px 20px; margin-top: 10px; display: inline-block;">Contact Us</a>';
}
}
Hope this Helps!
Best Regards,