Add to Cart button change to Enquiry button linking to the Contact Us page

One of my customers asked me How to Add to Cart button change to Enquiry button linking to the Contact Us page. So, I will now discuss How to Add to Cart button change to Enquiry button linking to the Contact Us page. “Add to Cart” button is present on almost every page of a WooCommerce store.

However, some store owners wish to either disable or remove this button on some products, for instance, there are conditions when the store owners wish to list the product on the store but might not wish to make them available for sale. So they need to replace the “Add to Cart button” with an “Enquiry button” which links to the “Contact Us” page.

So Let’s have a look, how to do this. First, go to the WooCommerce store and add a product. Give it a name and try to fill as many details as possible for this test product. For help. please see the following screenshot:

In the front end of the store, you will now see the products. See the below screenshot. I have circled the Add to Cart button in red!

I will now demonstrate How to Add to Cart button change to Enquiry button linking to the Contact Us page. For this, you will add this code in your theme’s functions.php file of your active child theme (or theme).

//Remove Add to Cart Button

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

// Add Enquiry Button in  Shop Page

add_action( 'woocommerce_after_shop_loop_item', 'shop_inquiry_product_button', 10);
function shop_inquiry_product_button() {
global $product;
echo 'Inquiry Now';
}

Add Enquiry Button in the Single product page

add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_single_addtocart_text' );
function custom_single_addtocart_text() { 
global $product;
echo 'Inquiry Now';
}

Once done, save the file and refresh the page. Once the page loads, you will see that the Add to Cart button change to Enquiry button linking to the Contact Us page.

I presented the solution to a common problem of WooCommerce store owners. Not everyone wants the “Add to Cart button” on every page of their store. They also need to Remove “Add To Cart” From A Product Page in WooCommerce.

We take customer feedback seriously and ensure that we constantly update customer requirements. So keep the feedback coming! We’d like to hear your thoughts on the Add to Cart button change to Enquiry button linking to the Contact Us page. If you need help in implementing this idea in your store, do leave a comment and I will get back to you.

Leave a comment