To add text, an image or a whole block to the WooCommerce cart page, you use hooks: locations provided by WooCommerce where you attach your own content with a few lines of PHP. Combined with an Elementor template, they let you insert a real layout, exactly where you want it. One condition: use the classic cart.
In short
- A hook is a named location where you can add content without editing WooCommerce.
- The cart page has about twenty of them: above the table, below the totals, near the checkout button…
- A shortcode goes through
do_shortcode()to display an Elementor template. - Hooks work with the classic cart; the Cart block, the default on recent shops, does not use them.
What is a hook?
A hook is an attachment point provided by the developer of a plugin, here WooCommerce. It lets you add content or change a behavior at a precise moment, without touching the plugin’s files. So your code survives updates.
Classic cart or Cart block?
Since WooCommerce 8.3, new shops use the Cart block by default. It does not fire these hooks: you customize it in the block editor. The hooks apply to the classic cart, the one from the [woocommerce_cart] shortcode, still maintained by WooCommerce. If your cart page contains the block, replace it with a Shortcode block containing [woocommerce_cart].
The cart page hooks
In display order:
woocommerce_before_cartwoocommerce_before_cart_tablewoocommerce_before_cart_contentswoocommerce_cart_contentswoocommerce_cart_couponwoocommerce_after_cart_contentswoocommerce_after_cart_tablewoocommerce_cart_collateralswoocommerce_before_cart_totalswoocommerce_cart_totals_before_shippingwoocommerce_before_shipping_calculatorwoocommerce_after_shipping_calculatorwoocommerce_cart_totals_after_shippingwoocommerce_cart_totals_before_order_totalwoocommerce_cart_totals_after_order_totalwoocommerce_proceed_to_checkoutwoocommerce_after_cart_totalswoocommerce_after_cart
Example 1: add a simple line of text
To show text above the cart total, use woocommerce_before_cart_totals. Add this code to the functions.php file of your child theme (otherwise it will be overwritten at the next theme update), or in the Code Snippets plugin:
add_action( 'woocommerce_before_cart_totals', 'wycan_texte_avant_total_panier' );
function wycan_texte_avant_total_panier() {
echo '<p>Free shipping on orders of €60 or more.</p>';
}The first line names the hook; the text in quotes is what appears on screen. The result:

Example 2: insert an Elementor template
A line of text is good. Two columns with an image and a button are better. With Elementor Pro, every template in your library has a shortcode in the form .
1. Create the template
In Templates, then Add New, create a template of the Section (or Container) type, build the content you want and publish it. In the list of templates, copy its shortcode from the right-hand column.
2. Insert it with a hook
To place the template between the product table and the total, use woocommerce_after_cart_table. A shortcode is not interpreted on its own in PHP: you have to pass it to do_shortcode().
add_action( 'woocommerce_after_cart_table', 'wycan_modele_apres_tableau_panier' );
function wycan_modele_apres_tableau_panier() {
echo do_shortcode( '[elementor-template id="701"]' );
}Replace 701 with the ID of your template, save, then reload the cart page.

Without Elementor Pro
The principle is the same with any shortcode: a form’s, a reusable block’s or one from your theme’s library. The OceanWP theme, for example, provides a shortcode for each item in its library.
Several additions on the same page
You can attach as many pieces of content as you like, on different hooks or on the same one. Just one rule: each function needs a unique name. Two functions with the same name cause a fatal error and take the site down. Prefix them, as here with wycan_.
Want a cart that encourages people to buy, with free shipping, complementary products and reassurance? We design custom WooCommerce shops, or let’s talk about your shop.



