From ffec3a603693de490bc4df310482a81012aa0fee Mon Sep 17 00:00:00 2001
From: Mike Jolley
Date: Sun, 22 Jul 2012 14:44:01 +0100
Subject: [PATCH] Shipping calculator state box improvements
---
readme.txt | 1 +
templates/cart/shipping-calculator.php | 36 +++++++++++++++-----------
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/readme.txt b/readme.txt
index 0d0ddd0c68d..76d976a5c9a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -158,6 +158,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - wp_reset_postdata instead of wp_reset_query in product page loops
* Tweak - Option to enable coupon form on cart
* Tweak - Coupon codes added to order notes when used (thanks Max Rice)
+* Tweak - Shipping calculator state box improvements
* Fix - Product categories shortcode loop
* Fix - selected state for variation options
* Localization - Added Romanian translation (by silviu-bucsa)
diff --git a/templates/cart/shipping-calculator.php b/templates/cart/shipping-calculator.php
index 8d520a5a16e..246dba480bb 100644
--- a/templates/cart/shipping-calculator.php
+++ b/templates/cart/shipping-calculator.php
@@ -17,11 +17,8 @@ if ( get_option('woocommerce_enable_shipping_calc')=='no' || ! $woocommerce->car
@@ -29,27 +26,36 @@ if ( get_option('woocommerce_enable_shipping_calc')=='no' || ! $woocommerce->car
customer->get_shipping_country();
$current_r = $woocommerce->customer->get_shipping_state();
- $states = $woocommerce->countries->states;
-
- if (isset( $states[$current_cc][$current_r] )) :
+
+ $states = $woocommerce->countries->get_states( $current_cc );
+
+ if ( is_array( $states ) && empty( $states ) ) {
+
+ // Hidden
+ ?>
+
+