Make check_cart_items consistantly placed

Closes #6708
This commit is contained in:
Mike Jolley 2014-11-12 15:47:27 +00:00
parent 4b2ab00be3
commit 18ebded7c5
2 changed files with 7 additions and 4 deletions

View File

@ -1274,6 +1274,8 @@ class WC_Cart {
$this->apply_cart_discounts_after_tax();
}
do_action( 'woocommerce_after_calculate_totals', $this );
$this->set_session();
}

View File

@ -205,15 +205,16 @@ class WC_Shortcode_Checkout {
wc_print_notices();
// Check cart has contents
if ( sizeof( WC()->cart->get_cart() ) == 0 )
if ( sizeof( WC()->cart->get_cart() ) == 0 ) {
return;
}
// Check cart contents for errors
do_action( 'woocommerce_check_cart_items' );
// Calc totals
WC()->cart->calculate_totals();
// Check cart contents for errors
do_action('woocommerce_check_cart_items');
// Get checkout object
$checkout = WC()->checkout();