Fix for free shipping min amount

This commit is contained in:
Mike Jolley 2011-12-06 14:30:25 +00:00
parent 7dd4b7ce6e
commit 49d24b09aa
1 changed files with 11 additions and 1 deletions

View File

@ -113,8 +113,18 @@ class free_shipping extends woocommerce_shipping_method {
global $woocommerce;
if ($this->enabled=="no") return false;
if (isset($woocommerce->cart->cart_contents_total)) :
if (isset($woocommerce->cart->cart_contents_total) && isset($this->min_amount) && $this->min_amount && $this->min_amount > $woocommerce->cart->cart_contents_total) return false;
if ($woocommerce->cart->prices_include_tax) :
$total = $woocommerce->cart->tax_total + $woocommerce->cart->cart_contents_total;
else :
$total = $woocommerce->cart->cart_contents_total;
endif;
if (isset($this->min_amount) && $this->min_amount && $this->min_amount > $total) return false;
endif;
$ship_to_countries = '';