Isak Lyberth
Isak Lyberth

Reputation: 1

Wordpress woocommerce remove cart

Can someone show me how to remove the woo commerce cart on the theme?

I've tried to remove it from the code but can't find the code for removing cart.

Upvotes: 0

Views: 1323

Answers (3)

Developer Nilesh
Developer Nilesh

Reputation: 570

This must be done in two parts:

  1. Hide the cart icon
  2. Disable Cart functionality

1. To hide the cart icon

With Storefront Powerpack, you can remove the cart from header: https://cld.wthms.co/mX0uMs

The end result would be: https://cld.wthms.co/C2kv83

It also comes with a wide range of customization options: https://docs.woocommerce.com/document/storefront-powerpack/

If you only want to disable cart icon via CSS, you use the following CSS snippet:

/* Hide header - cart */

.site-header-cart {
    display: none;
}

Please navigate to Dashboard > Appearance > Customize > Additional CSS, add the above snippet and then click on Publish button to save changes.

Note that this will only remove the cart icon, but not the page, or the process itself.

2. Disable Cart functionality

Once that’s done, we can either disable cart via custom coding: https://www.cloudways.com/blog/skip-cart-page-go-straight-to-checkout-page-woocommerce/

Or you can disable the cart function by making use of any third party extension that will help you redirect your customers directly to the checkout page. You can find plugins by searching for WooCommerce Add to Cart Redirect in your favorite search engine.

Upvotes: 1

Binnie Poonian
Binnie Poonian

Reputation: 1

Install the 'code snippets' plugin, then create the following 2 snippets

  1. Add the following to redirect to checkout

https://www.codepile.net/pile/Gv2gK8wr

  1. Add the following to remove cart text on buttons

https://www.codepile.net/pile/rl54NXwv

Also in Woocommerce>Settings disbale 'add to cart behaviour' options.

Upvotes: 0

Ferrakkem Bhuiyan
Ferrakkem Bhuiyan

Reputation: 2783

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 );

remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );

try this . i wish may be its helps you

Upvotes: 0

Related Questions