Dev - Moved WC_Cart::get_cart_from_session() to a later hook (was init, now wp_loaded).

Closes #6873
This commit is contained in:
Mike Jolley 2015-01-05 14:43:01 +00:00
parent 116e1130ae
commit 1c696a10d3
4 changed files with 16 additions and 15 deletions

View File

@ -104,7 +104,7 @@ class WC_Cart {
$this->display_totals_ex_tax = $this->tax_display_cart == 'excl';
$this->display_cart_ex_tax = $this->tax_display_cart == 'excl';
add_action( 'init', array( $this, 'init' ), 5 ); // Get cart on init
add_action( 'wp_loaded', array( $this, 'init' ) ); // Get cart after WP and plugins are loaded.
add_action( 'wp', array( $this, 'maybe_set_cart_cookies' ), 99 ); // Set cookies
add_action( 'shutdown', array( $this, 'maybe_set_cart_cookies' ), 0 ); // Set cookies before shutdown and ob flushing
}
@ -116,14 +116,14 @@ class WC_Cart {
* @return mixed
*/
public function __get( $key ) {
switch( $key ) {
switch ( $key ) {
case 'tax':
_deprecated_argument( 'WC_Cart->tax', '2.3', 'Use WC_Tax:: directly' );
$this->tax = new WC_Tax();
return $this->tax;
return $this->tax;
case 'discount_total':
_deprecated_argument( 'WC_Cart->discount_total', '2.3', 'After tax coupons are no longer supported. For more information see: http://develop.woothemes.com/woocommerce/2014/12/upcoming-coupon-changes-in-woocommerce-2-3/' );
return 0;
return 0;
}
}

View File

@ -21,16 +21,16 @@ class WC_Form_Handler {
public static function init() {
add_action( 'template_redirect', array( __CLASS__, 'save_address' ) );
add_action( 'template_redirect', array( __CLASS__, 'save_account_details' ) );
add_action( 'init', array( __CLASS__, 'checkout_action' ), 20 );
add_action( 'init', array( __CLASS__, 'process_login' ), 20 );
add_action( 'init', array( __CLASS__, 'process_registration' ), 20 );
add_action( 'init', array( __CLASS__, 'process_reset_password' ), 20 );
add_action( 'init', array( __CLASS__, 'cancel_order' ), 20 );
add_action( 'init', array( __CLASS__, 'order_again' ), 20 );
add_action( 'init', array( __CLASS__, 'update_cart_action' ), 20 );
add_action( 'init', array( __CLASS__, 'add_to_cart_action' ), 20 );
add_action( 'wp', array( __CLASS__, 'pay_action' ), 20 );
add_action( 'wp', array( __CLASS__, 'add_payment_method_action' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'checkout_action' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'process_login' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'process_registration' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'process_reset_password' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'cancel_order' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'order_again' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'update_cart_action' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'add_to_cart_action' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'pay_action' ), 20 );
add_action( 'wp_loaded', array( __CLASS__, 'add_payment_method_action' ), 20 );
}
/**

View File

@ -55,7 +55,7 @@ class WC_Query {
add_action( 'init', array( $this, 'price_filter_init' ) );
if ( ! is_admin() ) {
add_action( 'init', array( $this, 'get_errors' ) );
add_action( 'wp_loaded', array( $this, 'get_errors' ), 20 );
add_filter( 'query_vars', array( $this, 'add_query_vars'), 0 );
add_action( 'parse_request', array( $this, 'parse_request'), 0 );
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );

View File

@ -171,6 +171,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Dev - Switched to .scss from .less for all styles.
* Dev - Included bourbon for scss mixins.
* Dev - Decoupled the order summary and payments area. Both are updated independently via ajax fragments and can be moved around via actions. TEMPLATES OVERRIDING THESE TEMPLATES WILL NEED TO UPDATE THEIR FILES.
* Dev - Moved WC_Cart::get_cart_from_session() and dependencies to a later hook (was init, now wp_loaded).
* Localisation - Add Ukrainian currency and symbol.
= 2.2.5 - 07/10/2014 =