From b5850a7087b82e44ca79c30b283b45c98a0cf9ec Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 31 Oct 2011 15:00:06 +0000 Subject: [PATCH] Adding cart item resets shipping - so free shipping etc is selected when going over a threshold. Closes #116. --- classes/cart.class.php | 9 +++++++-- readme.txt | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/cart.class.php b/classes/cart.class.php index a06218b37a6..c8f9e463dc2 100644 --- a/classes/cart.class.php +++ b/classes/cart.class.php @@ -79,10 +79,15 @@ class woocommerce_cart { /** sets the php session data for the cart and coupon */ function set_session() { $cart = array(); - - $_SESSION['cart'] = $this->cart_contents; + // Set cart and coupon session data + $_SESSION['cart'] = $this->cart_contents; $_SESSION['coupons'] = $this->applied_coupons; + + // Cart contents change so reset shipping + unset($_SESSION['_chosen_shipping_method']); + + // Calculate totals $this->calculate_totals(); } diff --git a/readme.txt b/readme.txt index 1f2cf320b89..418f8cdface 100644 --- a/readme.txt +++ b/readme.txt @@ -94,6 +94,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo * Added functions which show tax/vat conditionally * Fixed variations - Incorrectly used instead $product_custom_fields of $parent_custom_fields * Made use of transients to store average ratings and improve performance +* Adding cart item resets shipping - so free shipping etc is selected when going over a threshold = 1.1.3 - 27/10/2011 = * Improved Force SSL Setting - now forces https urls for enqueued scripts and styles