WordPress action hook
woocommerce_cart_totals_before_order_total
Defined by WooCommerce and fired by 18 plugins in total, running on 8.1M+ sites between them.
How to use woocommerce_cart_totals_before_order_total
It's an action: your callback runs at that point. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'woocommerce_cart_totals_before_order_total', function() {
// Your code runs here.
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
18 plugins that fire woocommerce_cart_totals_before_order_total
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/cart/cart-totals.php:95 -
Essential Addons for Elementor1+ million installs
do_action( 'woocommerce_cart_totals_before_order_total' )includes/Template/Woocommerce/Cart/Woo_Cart_Helper.php:363 -
ShopEngine90,000+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )widgets/cart-totals/screens/default.php:126 -
CoDesigner4,000+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )widgets/cart-overview/assets/templates/cart-totals.php:158 -
WowStore4,000+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )blocks/woo/cart_total/Template.php:88 -
ShopEngine Gutenberg WooCommerce Builder Blocks Addon3,000+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )blocks/cart-totals/screen.php:120 -
Cart PDF for WooCommerce1,000+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/cart-table.php:189 -
WC Booster700+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )woocommerce/cart/cart-totals.php:93 -
ShopPress600+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )public/templates/cart/cart-totals.php:88 -
KiriminAja Official200+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/woocommerce/cart/cart-totals.php:130 -
Shopready100+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )src/extension/templates/tpl/cart/cart-totals.php:94 -
WebSync Checkout for Elementor50+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/cart/custom-cart-totals.php:106 -
Max Elements for Elementor10+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )elementor/helpers/woo_cart.php:327 -
Global Seller Services for WooCommerce10+ installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/TaxCalculation/cart-totals.php:147 -
Cresta Checkout for WooCommerceFewer than 10 installs
do_action( 'woocommerce_cart_totals_before_order_total' )inc/blocks/blocks-cart.php:315 -
StoreBoosterFewer than 10 installs
do_action( 'woocommerce_cart_totals_before_order_total' )templates/cart/cart-totals.php:40 -
MCOD Minimalist Checkout for WooCommerceFewer than 10 installs
do_action( 'woocommerce_cart_totals_before_order_total' )includes/class-mcrpd-checkout-loader.php:1838 -
BazarioFewer than 10 installs
do_action( 'woocommerce_cart_totals_before_order_total' )elements/widgets/cart-totals/cart-totals.php:1179
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.