Support » Plugin: WooCommerce » Dutch Postcode Validator in Shipping Calculator doesn’t normalize anymore

  • Resolved fvtl

    (@fvtl)


    We have noticed a change in the postcode validator in the Shipping Calculator in the cart. Before updating WooCommerce, the shipping calculator accepted Dutch postcode variations like 1234aa or 1234AA. At this point, the only acceptable input is 1234 AA (only with space and capitals). How can we solve this?

    We have tested with a default theme and deactivated other plugins and the problem stil appears. In older WooCommerce versions the problem doesn’t exist, we have tested that as well.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Would you mind elaborating a bit more which shipping calculator you’re using? Also, what errors are you getting on the postcode validation exactly – are you using a separate plugin for postcode validation?

    Thread Starter fvtl

    (@fvtl)

    Hi there,

    We are not using a separate plugin for postcode validation and we are using the standard WooCommerce Shipping Calcultor in the cart. We have tested with a default theme as well and without any other plugins and the problem still persists.

    On a different website with a default theme, no other plugins and with an older WooCommerce version, we didn’t experience problems with any kind of input of postcodes. All inputs are accepted: 1111aa, 1111 aa, 1111AA and 1111 AA. But after updating to the latest WooCommerce version, the shipping calculator in the cart only accepts one format as described above, 1111 AA. The problem only occurs in the shipping calculator, and not in the checkout.

    Thread Starter fvtl

    (@fvtl)

    Might be good to add: after filling in a wrong postcode format, we get an error on the left side of the cart ‘Please enter a valid postcode’.

    Stef

    (@serafinnyc)

    As far as I can see nothing has changed in either calculator, validation or formatting for over a year. Something either in your theme or some custom code added must be conflicting. If you compare all files you’ll see no difference, even from 3.6.2 to 3.6.3

    Unless I missed something. However, my software is quick at catching any differences.

    Thread Starter fvtl

    (@fvtl)

    Thanks a lot for the efforts. That’s just really strange. Like I said, I have tested with all plugins deactivated and with a default Twenty Nineteen theme and I have seen the problem in all cases with (one of) the newest WooCommerce updates. I don’t really see how it can still be a conflict with theme or custom code then. (I never change anything in source code, always work with child themes etc.)

    It could have been a change in another release for Woocommerce though, we might have missed the problem with earlier updates. But when you say it hasn’t changed in over a year, I don’t know where to look for the problem then. I’ll keep searching, thanks again!

    Plugin Support RK a11n

    (@riaanknoetze)

    Do you have a specific Dutch postcode that should work, but isn’t? Or vice versa? We can use that to test on our local testing installations 🙂

    Thread Starter fvtl

    (@fvtl)

    Not working: 3852GC (works in checkout)
    Working: 3852 GC

    Other zone;
    Not working: 9711ck
    Working: 9711 CK

    Stef

    (@serafinnyc)

    One thing I’d make sure of is that you don’t have cache on your cart or checkout pages. Testing shipping can be a pain if cache is present on them.

    Plugin Support RK a11n

    (@riaanknoetze)

    Thanks for those postcodes @fvtl – it helps a great deal to have something to test with 🙂

    I’ve discussed this with a Dutch colleague of mine and it looks like the postcode validation was indeed added in WC 3.6 with the regex being a tad too restrictive.

    I’ve opened a bug report for our developers to take a closer look into that. If you’re keen on following that, have a look at https://github.com/woocommerce/woocommerce/issues/23834

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Dutch Postcode Validator in Shipping Calculator doesn’t normalize anymore’ is closed to new replies.