• I’m not sure when this started being an issue, but the checkout page will load very slowly when using Microsoft Edge with this plugin active. It seems to be working fine on Google Chrome.

    The issue is caused by the huge amount of cities being added to the City Select element in the billing/shipping forms. For Romania, that is about 13000 cities, and it halts the page loading for about 1 minute while it’s creating and adding all those options.

    This only happens when there isn’t a county/state already selected. If there is a county/state selected, the City Select element will only contain the cities from the selected county/state, which is fine.

    I don’t understand why all the cities need to be added to the Select before the page is even rendered, since the City Select will be disabled until a county/state is selected, at which point the City Select element will be populated with the cities from the wc_city_select_params javascript object. So we never need all the cities to be present in the select.

    My quick fix was to comment the line 147 from wc-city-select.php, which says this:
    array_walk_recursive( $cities, array( $this, 'add_to_dropdown' ) );
    If no city is added to the $this->dropdown_cities property, no option element has to be created. I’m sure there is a more elegant solution, but I needed something that works, and this works, without breaking the existing functionality.

Viewing 1 replies (of 1 total)
  • You can use a plugin that defers script loading until the page has already loaded and the user took an action like WP Meteor to prevent the script from kicking in until the user has moved the mouse.

    This will improve loading time and prevent any scripts in your page from triggering until you’ve moved your mouse (or any other custom interval).

Viewing 1 replies (of 1 total)
  • The topic ‘Slow Checkout loading’ is closed to new replies.