Support postal codes with and without spaces for Canada

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 8 reply threads
  • Author
    Posts
    • #101091
      Craig
      Participant

      Hi There,

      I’m not sure if this is an issue with your plugin or with WooCommerce BUT I have seen older wooCommerce forums talking about this so assumed they have fixed on their side? So perhaps it is your marketplace plugin forcing the error? I had seen a similar discussion in a Magento forum and they said they would fix so I’m assuming this issue is in the marketplace plugins?

      The problem is that the shopping cart produces a shipping error dependent on if the Canadian postal code has a space in it or not and in Canada people use both variations often.

      Postal Code Example : V9R 4G3 and V9R4G3

      Right now V9R 4G3 works (with the space) V9R4G3 produces shipping error (without the space)
      See Attached Screenshots

      Can you please review and advise?

      Attachments:
      You must be logged in to view attached files.
    • #105911
      WCFM Forum
      Keymaster

      Hi,

      Do you have set postal code restrict at vendor setting?

      If so, then what postal codes you have added there, show me screenshot please?

      Thank You

    • #105926
      Craig
      Participant

      Hi thanks for getting back to me.

      The “set postal code restrict at vendor setting” is not working correctly and has been logged and is being worked on through support ticket
      “Shipping zones not working with CANADA – #48647”
      ALSO has been identified and discussed through this thread for that and screenshots
      https://wclovers.com/forums/topic/wild-cards-for-postal-codes-shipping-zones/

      The issue there is Basically The postal code limiting option does not seem to work for the Vendor. I can set postal code limits at the ADMIN level and the shipping zones work but the zones don’t work when the VENDOR enters the postal code limiting from their vendor dashboard shipping settings.

      BUT setting the postal code liits at the ADMIN level means those limits apply to every vendor and that is not correct. For a marketplace with many stores Each vendor should be able to set their own postal code limits.

      Please see the attached email conversation with WC Lover support that has yet to be resolved.

      BUT To answer your question currently the postal code matching is dependent on if there is or is not a “space” between the code and it should not be dependnat because there is no standard in Canada and everyone does it with or without space so it is causing many incorrect shopping carts.
      -Vendor listed Postal Code with the space
      -Customer entered postal code without a space

      Can the system be made so that the cart will see “V9R 4G3” and “V9R4G3” as the same?

      Attachments:
      You must be logged in to view attached files.
    • #106515
      Sushobhan
      Keymaster

      Hi,
      Please check, I think you have a trailing space in “Set your postcode” field.
      Thanks

    • #106596
      Craig
      Participant

      I have checked and that is not the issue.

      See attached screenshots.

      Can the system be made so that the cart will see “V9R 4G3” and “V9R4G3” as the same?

      Attachments:
      You must be logged in to view attached files.
    • #106600
      Craig
      Participant

      Can you please test your system to verify if it works so that the cart will see “V9R 4G3” and “V9R4G3” as the same.
      Are you able to get your system to accept the customers postal code regardless of the space with in the postal code in the vendor settings?

      I have been running many many many tests to confirm this “space” issue and I’m convinced it is some coding that need to happen within your plugin.

      Maybe this will help:

      In a previous marketplace plugin I used and had similar issue they needed to do this:

      “In the file admin/class-wcvendors-shipping.php lines 824 – 878 is a function called ‘check_postcode’
      Replace that function with this one:

      https://gist.github.com/digitalchild/ff81b9702b303ea1c13138c740b0f72a

      and then some additional code was also required because the above still was not clearing out the space in the postal code:

      “WooCommerce puts that space in there on the front end forms. In that same code block replace the first two lines to this

      // clean both codes before doing anything to them
      $customer_postcode = strtolower( str_replace( ‘ ‘, ”, $customer_postcode ) );
      $rate_postcode = strtolower( str_replace( ‘ ‘, ”, $rate_postcode ) );

    • #106638
      Sushobhan
      Keymaster

      Hello,
      There was a misunderstanding, I thought you are using postcode field value something like ‘V9R ‘. But now I got your point. This checking will get added in our next update.
      Thanks.

    • #106735
      Craig
      Participant

      Hi Sushobhan,

      I was using that wild card also but I can assure you I have tried many renditions and testing in trying to verify the issue.

      Having the update code as you suggested will be awesome. Thanks so much for doing that!

      One question – when you say next update. Which plugin are you referring to (just so I can keep an eye out for it)?

    • #106844
      Sushobhan
      Keymaster

      Hi,
      I referred to WC Multivendor Marketplace plugin. Though normally both WCFM and WCFM Marketplace receives simultaneous updates because of their interdependence.
      Thanks!

Viewing 8 reply threads
  • You must be logged in to reply to this topic.