Prevent an error notice

It only shows when country has states and state was leave in blanc on
the form.
This commit is contained in:
Art Project Group 2014-02-16 15:44:24 +01:00
parent d5482d00d0
commit 7d9a1e77a6
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ class WC_Shortcode_Cart {
WC()->shipping->reset_shipping();
$country = wc_clean( $_POST['calc_shipping_country'] );
$state = wc_clean( $_POST['calc_shipping_state'] );
$state = '';
if ( isset($_POST['calc_shipping_state']) ) $state = wc_clean( $_POST['calc_shipping_state'] );
$postcode = apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true ) ? wc_clean( $_POST['calc_shipping_postcode'] ) : '';
$city = apply_filters( 'woocommerce_shipping_calculator_enable_city', false ) ? wc_clean( $_POST['calc_shipping_city'] ) : '';