• Resolved sylvain68

    (@sylvain68)


    Hello APG Team,

    I hope all your team is okay.

    Thank you again for your very useful plugin.

    As you know, the list of available cities (when there are several) for a given postal code opens automatically when the order page is loaded. This happens for customers who have already entered a zip code and return to the order page (or the address page of their account).

    Of course, I understand why you did this. Indeed, in your plugin process the cities associated with a zip code are checked each time the form fields are loaded. And the first item in the list is automatically selected… so the user has to check his city again…

    The problem with this is that from time to time we have new/old customers who, after selecting the right city, go back to the order page but close this list (by clicking elsewhere) which has no real reason to reopen in their case.

    On the other hand the list of cities corresponding to the delivery address zipcode also opens in the top left corner of the screen.

    The result is that the user selected city is then replaced by the first one in the list and the packages we send to the wrong address are returned to us.

    Ideally, the city should remain stored (which is already the case natively in WooCommerce) and the list of cities should not reopen until there is a change of postcode. In addition to a better ergonomic process, performance will also be improved since in this case it will be useless to call the Geonames API (or other) as long as the postcode is not changed.

    Do you think you can improve this point in your javascript code? Perhaps you had already thought about it and this opening of the list was only a temporary solution, wasn’t it?

    For information, only WooCommerce and your plugin are activated (and up to date).

    Thank you in advance.

    Best Regards,
    Sylvain

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter sylvain68

    (@sylvain68)

    Just something I forgot to tell you about. The live() method has been deprecated from jQuery 1.7 (and removed from 1.9). It is now advised to use on() instead.

    Plugin Author Art Project Group

    (@artprojectgroup)

    We’ll check it as soon as possible.

    Thank you for your advice.

    Kind regards.

    Plugin Author Art Project Group

    (@artprojectgroup)

    Fixed in the next update.

    Kind regards.

    Thread Starter sylvain68

    (@sylvain68)

    Hello,

    Thank you for your prompt answer and fix.

    Indeed the list of cities no longer opens unnecessarily. However, after performing several tests, other problems now seem to be present.

    Example #1:
    A visitor comes for the first time on the order page. He selects his postal code “19500” (France) then his town “Meyssac”. He continues to fill out the form but decides to return to the shopping cart page (to change the quantity of items for example). On the shopping cart page you can see that the address has been saved (“Meyssac” appears in the shipping line of the cart_totals table). However, when he returns to the order page, the postal code is still present but the city is no longer there. Moreover his city no longer appears in the selection list (although the postal code is still present). The visitor must therefore remove the postal code and enter it again to see his city.

    Example #2:
    The logged-in customer makes new purchases. When he is on the order page, he decides to change his address: 75000 PARIS (instead of 19500 Meyssac). He forgot to add an item and therefore returns to the shopping cart page. There, you can see that the new address has been taken into account (cart_totals). But when he wants to finalize his order 75000 MEYSSAC is now present in the form (wrong address, the correct one is 75000 PARIS).

    On the other hand, sorry, but there’s one thing I didn’t think of when I advised you not to call the API until the zip code has changed. After the address is loaded, if a user just wants to replace his city with another nearby city (sharing the same zip code), he will have to remove his zip code to enter it again. Only after that he will be able to see the other cities.

    Finally, one way to solve this problem might be to systematically call the API and if a saved city is already present in the form field and it exists in the list, to select it automatically. That will probably also solve the problem described above (examples #1 and #2).

    What do you think?

    Hope this helps.

    Best Regards,
    Sylvain

    Plugin Author Art Project Group

    (@artprojectgroup)

    There’s no option to do all that you want without call to external Geonames or Google Maps API, sorry.

    We can read the city name from user data, but there’s no saved city name in customer data (cart without login). We can read city from user data, but we can’t update the full list of cities from postcode without call external API.

    Finally we’ll back to the old method in the next updates.

    Kind regards.

    Thread Starter sylvain68

    (@sylvain68)

    Hello,

    Thank you again for your responsiveness.

    In fact, I’m not asking for any extra features. My request is only to help you improve the ergonomics and the current behavior of your plugin to avoid address errors during the ordering process.

    If you read my previous post again, you’ll see that I finally think that you should indeed call the API systematically (and not only at zip code change as I initially suggested, again sorry).

    I understand that your plugin is free, thank you for that, the help I’m trying to give you is as well. I understand that improving your plugin requires some analysis and development work. But you should know that there is a solution to the problem I have taken the time to describe to you.

    Indeed, WooCommerce saves natively some address fields including the zip code and the city, even for shopping carts without login. In particular, this makes it possible to update shipping methods and costs (shipping calculator too). You can check this quite easily by simulating an order and navigating from the order page to the shopping cart page (and vice versa).

    So when the order page is loaded (or the account address page), you should check that the city normally pre-filled by WooCommerce is part of the list of cities returned by the API for the given zip code. If this is the case, you can select this city from the list by default. Otherwise, none should be selected, which should generate an error if the customer tries to validate the order without a city. This would prevent the city selection list from opening when it is not necessary and would correct the post-navigation inconsistency I mentioned earlier.

    Have a nice day. Of course I’m available if you need clarification.

    Best Regards,
    Sylvain

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem of systematic opening of cities list associated with a postal code’ is closed to new replies.