See below, our visual guide displaying all the WooCommerce cart page hooks which are available on your cart page in WooCommerce.
The WooCommerce cart page offers all these hooks on the cart page so that you can add your own functions to your theme files to add extra functionality to the cart page.
Simply grab the hook name from the guide below and read further down how to implement it with your functions.php file.
Have a look at our StoreCustomizer plugin which has lots of extra useful features for your cart page which you will enjoy from auto-update cart, add banners or custom text, remove the cart product links and more.
Visual display of the WooCommerce Cart Page Hooks:
WooCommerce Cart Page
Product
Price
Quantity
Total
You may be interested in...
Cart Totals
SubTotal
Shipping
Total
Available WooCommerce Cart Page Hooks:
- woocommerce_before_cart
- woocommerce_before_cart_table
- woocommerce_before_cart_contents
- woocommerce_cart_contents
- woocommerce_cart_coupon
- woocommerce_after_cart_contents
- woocommerce_after_cart_table
- woocommerce_cart_collaterals
- woocommerce_before_cart_totals
- woocommerce_cart_totals_before_shipping
- woocommerce_before_shipping_calculator
- woocommerce_after_shipping_calculator
- woocommerce_cart_totals_after_shipping
- woocommerce_cart_totals_before_order_total
- woocommerce_cart_totals_after_order_total
- woocommerce_proceed_to_checkout
- woocommerce_after_cart_totals
- woocommerce_after_cart
All of these hooks are available in the WooCommerce cart page, they are pretty self explanatory in their position but do refer to the visual hook guide if you’re not 100% sure on where exactly they hook into on the WooCommerce shop page.
If your theme is overriding the WooCommerce templates then it’s possible that these hooks could be missing, or placed in a slightly different position.
Happy Coding!
How to use a PHP hooks on your website:
To use these page hooks you will need a little understanding of php code… You can add the following function to your website using by creating a child theme and then adding this code to the child themes functions.php file, or you can install our Site Customizations plugin and add the php code via the php file provided.
If you are not comfortable using code then please try out our StoreCustomizer plugin which offers a lot of useful functionality using all these hooks for you to customize your WooCommerce store… No coding knowledge needed.
/*
* My Custom Function
*/
function my_custom_function( array $params ) {
// Some Code Here
}
add_filter( 'woocommerce_after_cart_contents', 'my_custom_function', 20 );
Our free StoreCustomizer plugin offers different functionality to add sold out banners, product sales statistics, stock amounts and lots more to your WooCommerce shop page, all from a visual interface so you don’t need to touch any code… Have a look yourself and see what all StoreCustomizer offers.