Disable Woocommerce add to cart

I’d like to do a few things with the woocommerce pages hoping it will apply to all instances of woo pages:

  1. Disable the woocommerce button so it can’t add to cart. I still want it there, but want to disable the add to cart functionality and change it to say “Call for more info”.

  2. Disable the quantity field.

  3. I don’t like the pill shape. How do I customize the submit button to be a square with rounded edges and to say “Call for more info”

I’d like it to look more like this at: https://www.preferredpump.com/product/2005-dodge-3500-flatbed/

  1. In the page that shows all products, I want the button when you hover over the image to say “call for more info”, again without the add to cart functionality.

Please also note that I tried using this CSS, like I did with the preferred pump site but it didn’t work.

.archive.woocommerce .add_to_cart_button,
.single_add_to_cart_button {
curson: default;
}

And here is the woocommerce.php file from preferredpump.com

Also wondering how to get edit and perhaps even remove the top row entirely. There’s obviously no need for two “descriptions”.

Hi,

  1. To disable the button, you can add the code below in your child theme’s functions.php file
add_filter( 'woocommerce_is_purchasable', '__return_false');
  1. To adjust the button radius, you can add the code below in Theme Options > CSS
.summary.entry-summary button {
   border-radius:5px;
}
  1. You can disable the description tab under Theme Options > Woocommerce > description tab

Hope that helps.

Regarding the first task, that code eliminated the add to cart button all together, but is there a way to keep the button, take away the add to cart functionality and for the button to say “Call for more info”, like in the example above seen here: https://www.preferredpump.com/product/2015-semco-s8000h-pump-hoist/

Regarding the description box, that option eliminates the description section entirely. I was wondering if there was a way to only eliminate the top row.

Forget about this one. I have decided to purchase the woocommerce custom tab manager plugin. For $29, I can easily add new tabs and delete default tabs.

But I still need help with turning the add to cart functionality off and changing the wording on the button to “call for more info”

Hello There,

Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

After the child theme is set up, please add the following code in your child theme’s functions.php file

function wc_custom_single_addtocart_text() {
  return "Call for more info";
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wc_custom_single_addtocart_text' );

And to disable the Add to support AJAX functionality, please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)

.woocommerce .add_to_cart_button,
.single_add_to_cart_button {
    pointer-events: none;
}

We would loved to know if this has work for you. Thank you.

This worked perfectly. Another home run, guys. Cheers!

Thanks @ppe29 for updating the thread, you are welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.