I want to get cart contents total in woocommerce within woocommerce_before_calculate_totals hook. So to achieve this I am using this code
add_action( 'woocommerce_before_calculate_totals', 'get_before_calculate_totals', 10 );
function get_before_calculate_totals( $cart_object ) {
global $woocommerce;
echo WC()->cart->get_cart_contents_total(); //returns 0
}
But it returns 0 every time. So can someone tell me how to get cart total without currency within woocommerce_before_calculate_totals hook?
Any help and suggestion would be really appreciable.