store less crap in the sessions

This commit is contained in:
Mike Jolley 2012-03-07 20:12:14 +00:00
parent ed9d57d04a
commit 7a0167d494
2 changed files with 12 additions and 1 deletions

View File

@ -139,7 +139,17 @@ class WC_Cart {
$this->calculate_totals();
// Set cart and coupon session data
$_SESSION['cart'] = $this->cart_contents;
$cart_session = array();
if ($this->cart_contents) foreach ($this->cart_contents as $key => $values) {
$cart_session[$key] = $values;
// Unset product object
unset($cart_session[$key]['data']);
}
$_SESSION['cart'] = $cart_session;
$_SESSION['coupons'] = $this->applied_coupons;
// Store totals to avoid re-calc on page load

View File

@ -162,6 +162,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Hooks for locate template functions (Thanks Lucas)
* Better language loading (GeertDD and deckerweb #win)
* Fix for grouped product from price
* Store less cart data in sessions to reduce file sizes
= 1.5 - 01/03/2012 =
* Quick edit products