This article was last manually reviewed for data accuracy on 15 November 2025.
The WooCommerce cart page is a critical part of any online store, where visitors review their selected products before proceeding to checkout. This visual guide explores these cart page hooks, detailing their locations and typical uses, helping you tailor your store’s cart page precisely to your needs.
Note: The hooks listed in this visual guide are all classic hooks tied to PHP templates. They are available only on classic cart pages using the [woocommerce_cart] shortcode or via the standard WooCommerce cart endpoint. The modern Block page supports different hooks which we will list separately.
Visual Guide: WooCommerce Classic Cart Page Hooks

Complete List of WooCommerce Classic Cart Page Action Hooks
| Group & Location | Hook Name | Description & Usage | Default Functions |
|---|---|---|---|
| Cart | woocommerce_before_cart | Fires before the cart form is rendered. Useful for notices or custom markup. | None |
| woocommerce_before_cart_table | Runs before the cart table markup. | None | |
| woocommerce_before_cart_contents | Before cart items loop. | None | |
| woocommerce_cart_contents | Inside cart items loop. | None | |
| woocommerce_cart_coupon | Displays coupon form. | woocommerce_cart_coupon() | |
| woocommerce_cart_actions | Displays update cart button. | woocommerce_cart_actions() | |
| woocommerce_after_cart_contents | After cart items loop. | None | |
| woocommerce_after_cart_table | After cart table markup. | None | |
| woocommerce_after_cart | After entire cart form. | None | |
| Cart Totals | woocommerce_before_cart_totals | Before cart totals table. | None |
| woocommerce_cart_totals_before_shipping | Before shipping rows. | None | |
| woocommerce_cart_totals_before_shipping_label | Before shipping label cell. | None | |
| woocommerce_cart_totals_after_shipping_label | After shipping label cell. | None | |
| woocommerce_cart_totals_after_shipping | After shipping rows. | None | |
| woocommerce_cart_totals_before_order_total | Before order total row. | None | |
| woocommerce_cart_totals_after_order_total | After order total row. | None | |
| woocommerce_after_cart_totals | After totals table. | None | |
| woocommerce_cart_totals_before_proceed_to_checkout | Before checkout button. | None | |
| woocommerce_proceed_to_checkout | Displays checkout button. | woocommerce_button_proceed_to_checkout() | |
| Cart Shipping | woocommerce_before_shipping_calculator | Before shipping calculator form. | None |
| woocommerce_after_shipping_calculator | After shipping calculator form. | None | |
| Cart Empty | woocommerce_cart_is_empty | Displays message when cart is empty. | wc_empty_cart_message() |
| Cart Collaterals | woocommerce_before_cart_collaterals | Before cross-sells / totals section. | None |
| woocommerce_cart_collaterals | Displays cross-sells and totals. | woocommerce_cart_collaterals() |
Essential List of WooCommerce Classic Cart Page Filters
| Group & Location | Hook Name | Description & Parameters |
|---|---|---|
| Cart Items | woocommerce_cart_item_product | Filters product object for cart item. Params: $product, $cart_item, $cart_item_key |
| woocommerce_cart_item_product_id | Filters product ID for cart item. Params: $product_id, $cart_item, $cart_item_key | |
| woocommerce_cart_item_permalink | Filters product permalink. Params: $permalink, $cart_item, $cart_item_key | |
| woocommerce_cart_item_thumbnail | Filters product thumbnail HTML. Params: $thumbnail, $cart_item, $cart_item_key | |
| woocommerce_cart_item_name | Filters product name HTML. Params: $name, $cart_item, $cart_item_key | |
| woocommerce_cart_item_quantity | Filters quantity input HTML. Params: $quantity, $cart_item, $cart_item_key | |
| woocommerce_cart_item_price | Filters price HTML. Params: $price, $cart_item, $cart_item_key | |
| woocommerce_cart_item_subtotal | Filters subtotal HTML. Params: $subtotal, $cart_item, $cart_item_key | |
| woocommerce_cart_item_remove_link | Filters remove link HTML. Params: $link, $cart_item_key | |
| woocommerce_cart_item_class | Filters CSS class for cart row. Params: $class, $cart_item, $cart_item_key | |
| woocommerce_cart_item_data | Filters custom meta data display. Params: $item_data, $cart_item | |
| woocommerce_cart_item_visible | Controls visibility of cart item. Params: $visible, $cart_item, $cart_item_key | |
| woocommerce_cart_item_key | Filters cart item key. Params: $cart_item_key, $cart_item | |
| Cart Totals | woocommerce_cart_totals_shipping_html | Filters shipping row HTML. Params: $shipping_html |
| Cart Shipping | woocommerce_shipping_calculator_enable_city | Enable/disable city field. Params: $enabled |
| woocommerce_shipping_calculator_enable_postcode | Enable/disable postcode field. Params: $enabled | |
| woocommerce_shipping_calculator_enable_state | Enable/disable state field. Params: $enabled | |
| woocommerce_cart_hide_shipping_when_free_is_available | Controls hiding of other methods when free shipping is available. Params: $hide, $available_methods | |
| Cart Collaterals | woocommerce_cross_sells_columns | Filters number of columns in cross-sells. Params: $columns |
| woocommerce_cross_sells_total | Filters number of products in cross-sells. Params: $limit |
Code Examples: Actions vs. Filters in WooCommerce Classic Cart Page
Deep Dive: For a comprehensive understanding of WooCommerce Filter and Hooks refer to WooCommerce Hooks and Filters: Complete Guide with Examples.
WooCommerce Classic cart Page Action Hook Example : Add Custom Notics
Let us Add a custom notice above the cart totals section using the woocommerce_before_cart_totals hook.
php
/**
* Add a custom message before cart totals.
*/
function able_rabbit_custom_cart_notice() {
echo '<div class="custom-cart-notice">';
echo '<p>Don’t forget to apply your coupon before checkout!</p>';
echo '</div>';
}
add_action( 'woocommerce_before_cart_totals', 'able_rabbit_custom_cart_notice' );Explanation:
- This runs right before the cart totals table.
- Useful for promotional messages, upsells, or reminders.
- No parameters are passed — you simply echo HTML.
WooCommerce Classic Cart Page Filter Hook Example : Append product SKU to the cart item name.
In this example, we will see how we can use the filter woocommerce_cart_item_name to append product SKU to the cart item name.
php
/**
* Append SKU to product name in cart.
*
* @param string $product_name The product name HTML.
* @param array $cart_item The cart item array.
* @param string $cart_item_key Unique cart item key.
* @return string Modified product name.
*/
function able_rabbit_cart_item_name_with_sku( $product_name, $cart_item, $cart_item_key ) {
$product = $cart_item['data'];
if ( $product && $product->get_sku() ) {
$product_name .= '<br><small>SKU: ' . esc_html( $product->get_sku() ) . '</small>';
}
return $product_name;
}
add_filter( 'woocommerce_cart_item_name', 'able_rabbit_cart_item_name_with_sku', 10, 3 );Explanation:
- This filter modifies the product name output in the cart.
- Parameters give you access to the product object and cart item data.
- You can append SKU, custom meta, or any other info.
Summary: Mastering WooCommerce Classic Cart Page Customization
WooCommerce cart page hooks enables you to create a more engaging and user-friendly cart experience. By using the appropriate action and filter hooks, you can add, modify, or remove content, and optimize the functionality and design.
Bookmark this visual guide of WooCommerce Classic Cart page hooks to help you customize your WooCommerce cart confidently.
FAQs: WooCommerce Clasic Cart Page Hooks
What are WooCommerce cart page hooks?
WooCommerce cart page hooks are predefined points in the cart page template where developers can add or modify content or functionality. They include action hooks for inserting content and filter hooks for modifying existing data or HTML output. These hooks allow customization without editing core WooCommerce files.
How do I use action hooks on the WooCommerce classic cart page?
Action hooks on the WooCommerce cart page let you insert content at specific locations, such as before the cart form (woocommerce_before_cart), inside the cart contents (woocommerce_cart_contents), or after the cart totals (woocommerce_after_cart_totals). You add custom PHP functions hooked to these actions to extend or alter the cart UI.
What are common filter hooks used on the WooCommerce classic cart page?
Common WooCommerce cart page filters include hooks like woocommerce_cart_item_price, which lets you modify the displayed price of each cart item, or woocommerce_cart_item_thumbnail, to change the product image shown. Filters are used to tweak cart item data or presentation dynamically.
Why is it important to know WooCommerce cart page hooks for SEO?
Understanding WooCommerce cart page hooks enables developers to optimize the cart experience, improve page speed by selectively loading content, and add SEO-friendly enhancements such as structured data or custom messaging. Proper use of hooks can reduce bounce rates and improve user experience signals important for SEO.
Where can I find a comprehensive list of WooCommerce cart page hooks?
A comprehensive and up-to-date list of WooCommerce cart page hooks, both action and filter types, is available in WooCommerce developer documentation and community visual guides.
What is the difference between WooCommerce classic Cart page and the WooCommerce block Cart page?
The Classic Cart uses shortcode-based templates and fully supports PHP hooks and custom snippets, making it highly flexible and compatible. The Block Cart uses Gutenberg blocks with limited PHP hook support—customizations often require block filters or React-based code instead of traditional PHP snippets.
Can WooCommerce classic Cart page hooks work on modern block based cart page?
No, the classic cart page hooks do not fire on the modern block based cart page. You must use the hooks for the block based cart page.
PRO Tip: Bookmark all our Visual WooCommerce Hook Guides for ready reference.
Did this help? Send a sip
Leave a Reply