Disable Add to Cart Button on Product Page

This topic has 8 replies, 4 voices, and was last updated 2 years, 5 months ago ago by Awais Ahmed

  • Avatar: Stanley Ezeokeke
    Stanley Ezeokeke
    Participant
    June 20, 2022 at 00:52

    Hello,

    Pls how do i disable add to cart button on selected product pages.

    I have some products that are appointments and just require Bookings not Adding to cart.

    An example is this – Check Private content

    The Add to cart and ruining the page. If i take out the price then the Add to cart button wont show, but then again i am not able to checkout as no price is attached to the item.

    Or is there a way i can checkout without attaching a price to a specific product? Either way would work for me.

    Thanks

    Please, contact administrator
    for this information.
    7 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    June 20, 2022 at 15:29

    Hello,

    There is no such option by default in our theme or WooCommerce plugin settings.
    I think you need to look for some booking plugin that will allow you to change the product type from simple to booking. For example,
    https://wordpress.org/plugins/mwb-bookings-for-woocommerce/
    https://wordpress.org/plugins/booking-for-woocommerce/

    Or something similar that suit your needs.

    Regards

    Avatar: Stanley Ezeokeke
    Stanley Ezeokeke
    Participant
    June 20, 2022 at 21:45

    Ok but how do i disable Add to Cart or Buy now from Specific Categories.

    I used this code snippet on my functions.php and it didn’t work

    add_action( 'wp', 'rudr_remove_add_to_cart_product_categories' );
    
    function rudr_remove_add_to_cart_product_categories(){
    	if( is_product_category( 'virtual-consultations' ) ) {
    		remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    	}
    }
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 22, 2022 at 09:42

    Hello,

    You are using Single Product Builder, it is the reason.
    Using the Builder, you can create Multiple templates, and remove the add to cart element from the page content for a specific category
    https://prnt.sc/ahsbMPWcNclg

    Regards

    Avatar: Stanley Ezeokeke
    Stanley Ezeokeke
    Participant
    June 22, 2022 at 20:56

    This worked beautifully well.

    Thank you very much!!

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 23, 2022 at 06:44

    You’re welcome!
    Have a nice day!

    Regards

    Avatar: Stanley Ezeokeke
    Stanley Ezeokeke
    Participant
    July 13, 2022 at 00:34

    Hello,

    I noticed this my issues was not fully resolved because from the Catalog page people can still add to cart and that ruins the entire checkout flow. IS there a way i can disable add to cart to these category of products from the catalog view not only single product view?

    Thanks

    Avatar: Awais Ahmed
    Awais Ahmed
    Participant
    July 13, 2022 at 07:06

    Hello, @Stanley Ezeokeke,

    No, sorry to say, because the catalog view of all products shows all the products from all the categories and there is an option in the theme to disable the add to cart button from just specific categories of the products. Disabling add to cart from catalog view will hide it from all of the categories. And changes that you require need customization. We cannot cover the customization issues in our support policy.

    If you want paid Customization services submit a customization request to WPKraken team.

    I hope you understand.

    Regards 8Themes Team.

  • Viewing 8 results - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.