Support » Plugin: WooCommerce » Checkout page state select dropdown bug in IE11

Viewing 15 replies - 1 through 15 (of 19 total)
  • Same here.

    I am having this issue as well

    I was able to get around this temporarily by commenting out the files for the select2 JavaScript library inside the woocommerce plugin folder. That disables the state selectors.

    Confirmed, bug in latest WooCommerce released last night.

    I reported it to Woo on GitHub so they can patch it:

    https://github.com/woothemes/woocommerce/issues/7729

    The quickest solution is:

    https://downloads.wordpress.org/plugin/woocommerce.2.3.5.zip

    Revert to 2.3.5. I just reverted our sites to 2.3.5 and all works fine again.

    @developerjustin

    Thanks – it worked.

    For anyone else it’s in the woocommerce plugin folder:
    includes/class-wc-frontend-scripts.php
    approx. line 118 – comment out
    //self::register_script( 'select2', $assets_path . 'js/select2/select2' . $suffix . '.js', array( 'jquery' ), '3.5.2' );

    If you disable the select scripts, you could create other problems with plugins that piggyback off of that script running. It’s much safer to simply revert to 2.3.5 for now.

    @wcvendors

    In many cases, true. This seems more a redundant script for effect. State select still exists in the form without the overlay select2 scripts call.

    ** edit – downgrading brings back the security issue that was addressed in the recent update

    Or edit this file:
    /wp-content/plugins/woocommerce/includes/class-wc-countries.php

    And for all countries you sell to – comment out the placeholder tag in the state section. I only sell in US so it was easy for me.

    For example in line 861, for US:

    This:

    'US' => array(
    	'postcode'  => array(
    		'label'       => __( 'Zip', 'woocommerce' ),
    		'placeholder' => __( 'Zip', 'woocommerce' ),
    	),
    	'state'     => array(
    		'label'       => __( 'State', 'woocommerce' ),
    		'placeholder' => __( 'State', 'woocommerce' ),
    	)
    ),

    becomes

    'US' => array(
    		'postcode'  => array(
    		'label'       => __( 'Zip', 'woocommerce' ),
    		'placeholder' => __( 'Zip', 'woocommerce' ),
    	),
    	'state'     => array(
    		'label'       => __( 'State', 'woocommerce' ),
    		/*'placeholder' => __( 'State', 'woocommerce' ),*/
    	)
    ),

    This can be patched temporarily without modifying core by adding the following to the active theme’s functions.php or to a new plugin. You could also add an if-check to only do this for version 2.3.6 I suppose.

    add_filter( 'woocommerce_get_country_locale', 'gowp_fix_wp_issue_7729', 99 );
    function gowp_fix_wp_issue_7729( $locales ) {
            if ( 'specific' == get_option( 'woocommerce_allowed_countries' ) ) {
                    $countries = get_option( 'woocommerce_specific_allowed_countries' );
                    foreach ( $countries as $country ) {
                            $locales[$country]['state']['placeholder'] = "";
                    }
            } else {
                    foreach ( $locales as $key => $locale ) {
                            $locales[$key]['state']['placeholder'] = "";
                    }
            }
            return $locales;
    }

    Or do what woocommerce dev has done to fix in their branch: https://github.com/woothemes/woocommerce/blob/90a78780be0c96a6b8d4da7b9aac1416d570824b/includes/class-wc-countries.php

    Just replace your class-wc-countries.php with the one from github which is the fixed version from 2.3.7

    Thanks for all the replies. Replacing the class-wc-countries.php from github worked for me and seems like a pretty good fix until the next release.

    Plugin Author Claudio Sanches

    (@claudiosanches)

    Fixed in WooCommerce 2.3.7.

    For me its no working, and im updated to version 2.3.7
    [IMG]http://i61.tinypic.com/65pax4.jpg[/IMG]

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Checkout page state select dropdown bug in IE11’ is closed to new replies.