WooCommerce Visual Hook Guide Cart Page

Woocommerce visual hooks guide for the cart page. With this guide you’ll be able to gain an understanding of how the cart page is assembled and thr actions of each part. You’ll also be able to use this guide to add additional snippets of code and further extend the woocommerce cart page.

Once you have found the hook that you want to use simply copy it into your custom function and then into your theme functions.php file or functions plugin.

WooCommerce Visual Hook Guide Cart Page

Cart

woocommerce_before_cart

woocommerce_before_cart_table

PRODUCT

PRICE

QUANTITY

TOTAL

woocommerce_before_cart_contents

PRODUCT 52

$17.00

1

$17.00

PRODUCT 12

$53.00

2

$106.00

woocommerce_cart_contents

Coupon code

woocommerce_cart_coupon

woocommerce_after_cart_contents

woocommerce_after_cart_table

woocommerce_cart_collaterals

woocommerce_before_cart_totals

You may be interested in…

Cart Totals

Incredible Product

$18.00

Subtotal

$123.00

woocommerce_cart_totals_before_shipping

Shipping

woocommerce_before_shipping_calculator

woocommerce_after_shipping_calculator

woocommerce_cart_totals_after_shipping

woocommerce_cart_totals_before_order_total

Total

$129.00

woocommerce_cart_totals_after_order_total

woocommerce_proceed_to_checkout

woocommerce_after_cart_totals

woocommerce_after_cart

Default WooCommerce Cart add_actions

// These are actions you can unhook/remove!

add_action( 'wp_loaded', array( WC_Cart, 'init' ) );

add_action( 'wp', array( WC_Cart, 'maybe_set_cart_cookies' ), 99 );

add_action( 'shutdown', array( WC_Cart, 'maybe_set_cart_cookies' ), 0 );

add_action( 'woocommerce_add_to_cart', array( WC_Cart, 'calculate_totals' ), 20, 0 );

add_action( 'woocommerce_applied_coupon', array( WC_Cart, 'calculate_totals' ), 20, 0 );

add_action( 'woocommerce_check_cart_items', array( WC_Cart, 'check_cart_items' ), 1 );

add_action( 'woocommerce_check_cart_items', array( WC_Cart, 'check_cart_coupons' ), 1 );

add_action( 'woocommerce_after_checkout_validation', array( WC_Cart, 'check_customer_coupons' ), 1 );

add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );

add_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 );

add_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );

Where to place this code?

As with all other code snippets, once you have selected the location to place it simply add th code to the theme functions.php file before the closing ?> (if it has it) or in a functions plugin.
Written by John Cook
I've been using WordPress for over 6 years and Woocommerce for over 4 years. In that time I have explored the depths of customizations and helped many online retailers grow and expand their business using the Woocommerce selling platform. My aim here is to help enable Woo users around the globe get even more out of their e-commerce platform of choice.