WooCommerce is extremely friendly for developers because it has a ton of actions and filters - called hooks. We use them often when we develop WooCommerce plugins and tweak our cart page, here at WP Desk. No matter if you are a beginner or advanced WooCommerce developer, we created this visual guide to help you find just the WooCommerce cart page hooks you're looking for. Let's begin!
Table of contents
- WooCommerce Cart Hooks
- Empty Cart Hook
- The List of Cart Hooks
- Remove the default actions on the cart page
- Add custom sections to the cart page
WooCommerce Cart Hooks
👀 Let's see all hooks available for the WooCommerce cart page. This guide is based on the official WooCommerce theme Storefront.
WooCommerce Empty Cart Hook
There is also 1 hook on the empty cart page:
You can use this hook, for example, to let your customers go to some specific categories, products, or homepage.
WooCommerce Cart Page 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 custom sections to the cart page
The following easy example shows how to add "free shipping" text above the cart table like this:
Checkout Editor Plugin to customize the checkout form
We have developed a plugin that will help you in editing the WooCommerce checkout form. Check it our here:
Flexible Checkout Fields PRO WooCommerce £59
Edit, add new or hide unnecessary fields from the WooCommerce checkout form. It's all about conversions and better user experience.Add to cart or View Details
Today, I've shown you the list of WooCommerce cart actions and filters, and how to use them to customize the cart page.
If you have any questions, let me know in the comment section below!