Removing Add to cart button, View cart, Checkout pages from woocommerce

Is it possible to Remove the chekout, view cart from woocommerce and Add to cart button from each product?

if yes please i need help to do it?

Read More

Thanks

Related posts

2 comments

  1. You can remove checkout and cart page from woocommerce -> settings -> checkout -> checkout pages.Remove selected cart page and checkout page from settings.

    For removing ‘Add to Cart’ button from shop page and single product page insert following code in your themes function.php file –

    function remove_loop_button(){
         remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
         remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    }
    add_action('init','remove_loop_button');
    
  2. Yes, It is possible, there are many methods to do it, let me provide you the easiest trick.

    Step #1: first find the Unique ID or Class identifier name of the button that you like to be removed. You can find it easily with the help of Browser Developer Tools.

    for example, say your button html is like:

    <button type="submit" class="add_to_cart">Add To Cart</button>
    

    So, now in the above code we get its class name is .add_to_cart

    Step#2:

    you just need to add following line into the style.css of your theme.

    .add_to_cart {
    display: none;
    }   
    

    now reload the page and you will see that the button is gone, completely removed.

Comments are closed.