WooCommerce is extremely friendly for developers because it has a ton of actions and filters - or just hooks. We use them often when we develop WooCommerce plugins and to tweak our cart page, here at WP Desk. No matter if you are a beginner or advanced WooCommerce developer, we created this WooCommerce cart hooks guide to help you find just the right hooks you're looking for.
This is a post in a WooCommerce Hooks Visual Guide series. Make sure to read every one of them to find out everything about WooCommerce hooks and where to find them.
WooCommerce Cart Hooks - Visual Guide
Below you will find all hooks available in the WooCommerce cart page. This guide is based on the official WooCommerce theme Storefront.
To see it in action on a live page, scroll to the live guide ↓
WooCommerce Empty Cart Hooks - Visual Guide
There is also 1 hook in the empty cart page:
WooCommerce Cart Hooks - Live Visual Guide
Apart from the static visual guide above we created the whole WooCommerce cart experience on a live page. You can view all hooks live, add or remove products from the cart, click through the whole shop or even manipulate it with your developer tools in the browser.
Visit the live WooCommerce cart hooks guide by clicking the button below:See Cart Hooks in Action →
WooCommerce Cart Hooks - The Complete List
Remove the default actions on the cart page
By default only some of the hooks are used by WooCommerce to add:
- cross sells next to cart totals (
- cart totals next to cross sells (
- proceed to checkout button under cart totals (
You can easily remove these functions by pasting the following code to the functions.php file in your theme or preferably child theme.
Add your own sections to the cart page
You can also easy add some texts or sections to the cart page and you do not need to edit WooCommerce templates! The following easy example shows how to add "free shipping" text above the cart table like this: