Skip to content

Instantly share code, notes, and snippets.

@growdev
Created October 14, 2014 14:10
Show Gist options
  • Save growdev/3e084f833a3f27bf54af to your computer and use it in GitHub Desktop.
Save growdev/3e084f833a3f27bf54af to your computer and use it in GitHub Desktop.
Getting WooCommerce Cart Subtotal
<?php
add_action('woocommerce_cart_updated', 'growdev_woocommerce_cart_updated', 90);
function growdev_woocommerce_cart_updated ( $cart ){
// output subtotal
error_log( "subtotal: " . WC()->cart->subtotal );
// output the
error_log( "get_cart_subtotal: " . WC()->cart->get_cart_subtotal() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment