• Hi there,

    I have been unable to get the city select to operate on the checkout page, although it works fine for addresses on the account page.

    I have switched themes to Twenty Twenty-Four and the result is the same. Different browsers also don’t seem to make any difference.

    Is there perhaps a compatibility issue, or are you able to offer any advice as to why it isn’t operating?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author mantish

    (@mantish)

    Hi,
    The plugin should work fine in the checkout page.
    Do you see any errors?

    It’s possible that another plugin is conflicting with this one. Maybe you can try disabling other plugins to test that out.

    Thread Starter chrissu

    (@chrissu)

    It doesn’t seem to be a plugin conflict problem.

    I have reverted to the twenty twenty-four theme and disabled all plugins except WooCommerce and WC City Select and the behaviour is exactly the same.

    I also don’t see any php errors being logged.

    Plugin Author mantish

    (@mantish)

    What versions of WordPress and Woocommerce are you using?

    Does it behave as if the plugin wasn’t there? or is it broken in some other way?

    Thread Starter chrissu

    (@chrissu)

    I’m using WordPress 6.4.2 and WooCommerce 8.3.1

    In the WooCommerce MyAccount section, the addresses behave exactly as expected. State/County are available as list selections and Town/City field is also a list selection that gets populated based on the State selection.

    However, in the address fields at checkout, only the State/County is available as a list selection. The Town/City field remains as a freeform text input field.

    Plugin Author mantish

    (@mantish)

    It should work fine with those WP and WC versions. It’s very strange that it works fine in the MyAccount section but not in the Checkout page.
    Are you using any of the countries included in the plugin or your own list? Maybe you can check if the selected country affects it somehow

    Thread Starter chrissu

    (@chrissu)

    I am using a country that is not included with the plugin.

    I first added it to the functions.php as explained in the documentation, but when the cities did not display, I removed the code from functions.php and instead added the cities as a separate file into the plugin’s cities directory with the relevant country code.

    The result was the same, country, state and cities work in my account, but cities do not work in checkout.

    I have tried a different country, Egypt, which is included in the plugin, but the result is exactly the same. All works as expected in my account, but cities do not appear as a list in checkout.

    I suppose the next logical step is to do a fresh wordpress and woocommerce install and then implement this plugin only and observe the results.

    I have the same issue. The plugin is working in My Account section, but not in Checkout or Cart sections. I am using WP 6.4.3 and WC 8.6.1.

    Also other plugins like States, Cities, and Places for WooCommerce, that I used to install to fill the city fields and now it is not working also.

    Maybe WP or WC changed something in the new versions that is causing this.

    Plugin Author mantish

    (@mantish)

    Hi, I checked again with the latest versions of WP and WC and it’s still working fine on my end.
    I’m sorry to hear it isn’t working for you ??
    Please let me know if you find out any other information about the error

    I am getting the exact same behaviour, will troubleshoot and share the solution as a pull request if I manage to resolve it

    Update:

    I managed to find the root cause of the issue.

    WooCommerce checkout page now has the city field IDs as follows “billing-city” and “shipping-city”

    While my account page and backend pages has the following IDs “billing_city” and “shipping_city”

    So the plugin only triggers a list for element IDs with an underscroll not a dash, and the checkout page now for some reason has it as a dash instead.

    Plugin Author mantish

    (@mantish)

    Wow, that’s super weird.
    Thanks for figuring it out @yward
    If you manage to fix it and can contribute a PR it would be highly appreciated!

    @mantish

    I was able to resolve the issue with no modifications to your plugin here’s the issue’s root:

    In?WooCommerce 8.3?and later versions, cart and checkout pages will be created using the new WooCommerce blocks.

    And like everything else blocks touch, this broke compatibility with 100s of plugins that modified the checkout page. This is why everything still worked fine in “my account” page as that one is luckily still not blocked page.

    Thankfully, the legacy checkout is still supported, so to resolve the issue simply delete the checkout page created by woocommerce (or delete its content) and replace it with the legacy shortcode which is:

    [woocommerce_checkout]

    This also applies to cart, which can be reverted back to non-blocks based legacy version by using a page with the shortcode:

    [woocommerce_cart]

    Since I have no interest in using block-based editor and also use Classic Editor and Classic Widget plugins in all my projects, so I sadly will not be able to invest the time to make a block-compatible hook and will be using the solution above, however, if you have the time it’s good to invest it into that given blocks may eventually be forced and classic editor retired.

    Hi! Did someone manage to get this plugin working with blocks in latest WooCommerce (v9.3.3?at the moment)?

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.