Call WC_Cart->init() method directly from within the init hook

This commit is contained in:
Geert De Deckere 2012-03-20 14:50:19 +01:00
parent 7a510c55ac
commit 2e27ea3108
2 changed files with 1 additions and 2 deletions

View File

@ -44,8 +44,6 @@ class WC_Cart {
$this->prices_include_tax = (get_option('woocommerce_prices_include_tax')=='yes') ? true : false;
$this->display_totals_ex_tax = (get_option('woocommerce_display_totals_excluding_tax')=='yes') ? true : false;
$this->display_cart_ex_tax = (get_option('woocommerce_display_cart_prices_excluding_tax')=='yes') ? true : false;
add_action('init', array(&$this, 'init'), 5); // Get cart on init
}
/**

View File

@ -265,6 +265,7 @@ class Woocommerce {
// Class instances
$this->cart = new WC_Cart(); // Cart class, stores the cart contents
$this->cart->init();
$this->customer = new WC_Customer(); // Customer class, sorts out session data such as location
$this->query = new WC_Query(); // Query class, handles front-end queries and loops