• Resolved alx359

    (@alx359)


    While making some tests (*), bumped into an issue when trying to enter a shipping address in a different country than the one Fluid Checkout (FC) has decided I’m located. This has proven to be a difficult to an impossible scenario, as FC is now stubbornly changing the country back in every opportunity it gets.

    For example, say I’m in the US, but I’m filling a shipping address in the UK instead. After some page operation happens (ajax, reload, etc.), FC switches the country back to the US.

    1) For example: https://postimg.cc/9DKRp106
    2) Can’t edit an UK shipping address either, as it keeps putting it back to the US: https://postimg.cc/nXsFP8w3

    The helpful workflow here would be different: FC to set the country field only if option value=""and do nothing otherwise.

    (*) To test this, can use some VPN and fill a fluid checkout in a fresh incognito mode.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    I was not able to reproduce the problem on our demo site. It has Geolocation enabled and I tried with both my normal connection and a VPN.

    Please note that Fluid Checkout does not Geolocate and set the country field but only uses the values send by the browser. The component which sets the country to the value determined by Geolocation is WooCommerce itself, depending on the configuration.

    1. Could you confirm whether you can reproduce the issue on our demo site?
    https://demos.fluidcheckout.com/multi-step/cart/?add-to-cart=14&quantity=2

    2. If not, please follow the instructions from the article below to try find conflicting plugins:
    https://woocommerce.com/document/how-to-test-for-conflicts/

    3. Also try disabling Geolocation on the WooCommerce settings.

    If possible, it would be really helpful if you could make a screen recording video of the problem while it is happening.

    Best,
    Diego

    Thread Starter alx359

    (@alx359)

    Hi Diego,

    Thanks for looking into this. I quickly tested in your demo website, and was able to reproduce, but in a slightly different and less-pronounced manner than in my configuration (will re-test in debug mode and make a video if you feel it’s still necessary.)

    The most clear and simple way to see the issue right now is when one has a shipping address not in Germany (the default I got) already saved (e.g. in the UK). If you hit “refresh” (F5) in the browser (latest FF/W10), it reloads the page but the saved country in the shipping-to address has become now Germany, instead of UK. See: https://postimg.cc/grx1b4zt

    To reproduce, open a fresh incognito window, and visit the demo site while making sure you’re not in Germany ??

    Please confirm if you see what I see. Thanks!

    Please note that Fluid Checkout does not Geolocate and set the country field but only uses the values send by the browser. The component which sets the country to the value determined by Geolocation is WooCommerce itself, depending on the configuration.

    I understand, but in the issue at hand Fluid Checkout while reading that country from the environment (browser, WC) it becomes too eager to set it as the default. Scenarios like the address-to country differing from the environment aren’t handled too well. I don’t observe that issue with the ordinary checkout I got from Flatsome.

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    I was now able to reproduce it on the demo site using Firefox in incognito mode on MacOS.

    This seems to happen only with Firefox. I also tested it on Chrome, Safari, Microsoft Edge and Opera, and it worked as expected on those browsers.

    I checked the requests and responses while using Firefox and they seem normal to me, except that Firefox is sending “Germany” as the shipping country right after the refresh request.

    So something is happening between the time the page first loads and by the time the first automatic checkout update request is sent.

    Why it only happens with Firefox I don’t know.

    I’ll investigate it further and let you know of any progress.

    In the meanwhile, could you try to reproduce it with other browsers?

    Best,
    Diego

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    This was a tough one to find…

    What happens is:
    – Firefox preserves the form fields values when refreshing the page (F5/Reload);
    – When refreshing the checkout page, Firefox was setting the Country and State fields the value taken on the first time the page was loaded;
    – When Fluid Checkout/WooCommerce sends the request to update the checkout page via AJAX, the values of those fields were changed by Firefox;
    – The values were then stored in Fluid Checkout as if the user had selected those values;

    The fix:
    – Firefox relies on the autocomplete attribute to preserve the fields values. In order to avoid Firefox from changing the values, the autocomplete attribute has to be set to off.
    – Fluid Checkout will now set the autocomplete attributes to off, and restore the functionality after the page is loaded.

    I updated the demo site with this fix.

    1. Could you confirm that the problem does not happen anymore on the demo site?

    You can also use the beta version 2.0.3-beta-1 from the link below to test it on your website:
    https://t2449427.p.clickup-attachments.com/t2449427/81025251-9d61-419a-a05e-a96c140e3577/fluid-checkout-2.0.3-beta-1.zip

    After you confirm that the problem is solved, I’ll release a new version of the plugin with the fix.

    Best,
    Diego

    Thread Starter alx359

    (@alx359)

    Hi Diego,

    Great detective work. Interesting, now recall reporting the autocomplete issue with another plugin few months ago and the dev pulling some hair what’s going on.

    The demo website test went almost fine. Still encountered the sticky country issue hidden in the State/County field of the billing address though.
    To reproduce:
    – Open https://demos.fluidcheckout.com/multi-step/cart/?add-to-cart=14&quantity=2 on a fresh incognito with FF/W10
    – Notice the default country (my case Germany)
    – Enter an address not in the default country (e.g. UK)
    – Uncheck Billing-to Same as shipping address and open the State / County (optional) dropdown
    – The states are in Germany, not in the UK. See: https://postimg.cc/PPxbSVpt

    My end things aren’t so rosy with 2.0.3-beta-1 unfortunately. Still debugging where the culprit is.

    Cheers,
    Alex

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    At least some progress ??

    I’ll test the flow for the billing fields and let you know.

    1. What version did you have before installing 2.0.3-beta-1?

    2. What are the issues with version 2.0.3-beta-1?

    Best,
    Diego

    Thread Starter alx359

    (@alx359)

    Thanks for asking, Diego.

    Located the culprit in the CartBounty plugin. When it’s active, it always forces the shipping/billing country back to the default (i.e. the one read from the browser settings, as you explained). When CartBounty is deactivated, 2.0.3-beta-1 works for me as well as in your demo site (i.e. still has the issue with the State dropdown mismatch reported above.)

    It’s a bummer with CartBounty though. I like their plugin, but don’t know how to explain to their devs in a concise enough way what the issue actually is.

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    The problem with the state field not matching the country should be solved with the beta version 2.0.3-beta-2.

    When first switching from “Billing same as shipping” (checkbox checked) to using a new address (checkbox unchecked), the address fields should be empty except for country and state if a default location is defined.

    After entering the new billing address data, if the user back and forth from “Billing same as shipping” and “Billing (NOT) same as shipping”, the new address data will not be emptied again and the complete new billing address data will be persisted.

    The demo site has been updated with these changes.

    You can also download the beta version 2.0.3-beta-2 from the link below to test t on your own site:
    https://t2449427.p.clickup-attachments.com/t2449427/b597f365-5d02-417f-8c31-932207d500e5/fluid-checkout-2.0.3-beta-2.zip

    1. Could you confirm whether the problem is solved for you on our demo site, or on your own site?

    As for compatibility with CartBounty, I added a new task to our backlog and will consider adding compatibility with it in future releases.

    Best,
    Diego

    Thread Starter alx359

    (@alx359)

    Hi Diego,
    Tested the demo and my end. Everything seems working consistently now. Great work! ??

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    That’s great ??

    I’ll release an update later this week or early next week.

    I let you know once the update is available.

    Best,
    Diego

    Hi @diegoversiani @alx359

    Got notified about this thread and wanted to jump in the discussion ??

    Downloaded latest beta version of Fluid Checkout, enabled CartBounty and tried changing Shipping country. I can see that it is not possible ??

    Since CartBounty hasn’t really got any functions or features that would be interfering with Country or State input fields, not really sure if there is anything that could be done on our side. One thing that CartBounty does is try to restore input field value after page is reloaded so that the customer wouldn’t be loosing his previous input and would not have to fill it again.

    I noticed that when I’m changing the Country input field, it seems that the field is being “regenerated” via Ajax and then some other WooCommerce hooks are firing and that leads to CartBounty trying to restore input field. This at the moment seems to be the issue.

    Let me know your thoughts.

    Best,
    Nauris

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @alx359,

    Just released the version 2.0.3 with the fixes for the default country field with Firefox, along with other fixes related to addresses.

    Best,
    Diego

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @nauriskolats,

    Thanks for jumping in…

    The feature from CartBounty that tries to restore the input field values might interfere with a similar feature from Fluid Checkout (and vice-versa).

    1. Is there a way to disable that feature via code/hooks?

    Another possible cause for this problem is that Fluid Checkout replaces the addresses sections via AJAX whenever the checkout needs to be updated. This can cause issues with some plugins that do not expect that behavior.

    Best,
    Diego

    Hi @diegoversiani,

    Thanks for your response.

    Right now there is no filter that would allow to disable this feature.

    CartBounty “Remember user input” feature fires only when WooCommerce checkout fields are generated and is tied to “woocommerce_checkout_fields” filter.
    If this filter fires every time Country or State input is changed, then our restore function is going to be called. Are you using this filter after drop-down is changed?

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @nauriskolats,

    Yes. The filter woocommerce_checkout_fields is called on every request for many reasons, including after the Country and State fields are changed.

    It would be great if you could add a filter to your plugin that would allow our plugin to disable this feature.

    Perhaps you could already disable this feature from your side if Fluid Checkout is activated.

    Best,
    Diego

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘default country field bug’ is closed to new replies.