• Hi,

    I’d like to report a bug in the plugin (pertinent to v3.0.18), where on the checkout page the shipping select2 fields aren’t initialized. It doesn’t affect the billing fields, though.

    This is completely reproducible, as I installed the plugin on different WooCommerce site as well, activated it, didn’t even configure it, and the problem was on that site’s checkout page too. So there are no particular plugin settings that would seem to cause or remedy this issue and it doesn’t matter if WooCommerce is set to default to the billing or the shipping address. I also tried deactivating everything bar WooCommerce and this plugin, and the issue was still present.

    Update: It only affects the shipping fields on initialization but if you change the shipping country in the plain select box, it re-initializes select2 on the shipping fields thereafter.

    Thanks in advance for your consideration.

    Best,
    Dave

    • This topic was modified 4 years, 1 month ago by davethedon.
    • This topic was modified 4 years, 1 month ago by davethedon.
    • This topic was modified 4 years, 1 month ago by davethedon. Reason: Update
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi Dave

    Thanks for your report
    Anyway I tested this scenario locally, and I cannot reproduce the issue

    On my installation, running just WooCommerce and YITH WooCommerce Wishlist plugin, I can correctly see the Shipping Country fields initializated to its selectWoo form (here a screenshot)
    I’ve also made sure to test this with two distinct themes, one of which was a default Twenty theme

    Could you plesae check if you have JS errors on your checkout page?

    Thread Starter davethedon

    (@davethedon)

    Hi,

    Thanks for getting back to me. That’s very strange. I’m not seeing any JS errors in the console at all. See my screenshot.

    I’ll try it on a fresh WP installation and get back to you.

    Thread Starter davethedon

    (@davethedon)

    Hi @yithemes,

    Upon further testing on a fresh installation of WordPress using StoreFront, the issue doesn’t present itself. However, I previously tried StoreFront on the site I’m currently developing and it was presenting itself, but for some reason, I switched to StoreFront again today and the problem went away until switching back. The theme the dev site going to use is Flatsome, and that’s where the issue does present. So I installed Flatsome (3.13.1) on the fresh WordPress test site, and the issue presented itself then.

    The conclusion is, it is theme related, and something in Flatsome is not playing nice with YITH WooCommerce Wishlist, even though it’s a recommended plugin. At this point it’s difficult to know where the bug is without investigating further…

    Plugin Author YITHEMES

    (@yithemes)

    Hi there

    I was able to reproduce the issue with Flatsome theme, but I hadn’t any luck trying to track the issue down
    Anyway, maybe I could suggest a workaround: try to add the following snippet of PHP code at the end of functions.php file of your theme or child theme

    if ( ! function_exists( 'yith_wcwl_fix_flatsome_checkout' ) ) {
    	function yith_wcwl_fix_flatsome_checkout() {
    		wp_add_inline_script(
    			'wc-checkout',
    			"
    			jQuery( function( $ ) {
    				$('form.checkout').on( 'change', '#ship-to-different-address input', function() {
    					$( 'select.country_select:visible, select.state_select:visible' ).selectWoo();
    				} );
    			} );
    			"
    		);
    	}
    
    	add_action( 'wp_enqueue_scripts', 'yith_wcwl_fix_flatsome_checkout' );
    }
    

    This will re-init selectWoo for checkout, whenever status of “Ship to a different address” checkbox changes

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shipping County and County Select2 not Initializing at Checkout (v3.0.18)’ is closed to new replies.