[Skip to main content](#vessel-content)

#   Canada Post - Postal Code formatting breaks shipping rates

##

- **[jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")**
- [![jukeboxjunkey's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar15117.png)](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile") Topic Author
- [ Offline](/forum/user/15117-jukeboxjunkey)

Less More

- Posts: 33
- Thank you received: 2
-
-
-
-

8 years 6 months ago [\#292046](#292046) by [jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")  *[Canada Post - Postal Code formatting breaks shipping rates](/forum/28-shipping-methods/894593-canada-post-postal-code-formatting-breaks-shipping-rates#292046 "-- url of the page with the problem -- :   www.habbyjacks.com  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.7  When I type in a postal code like: - V1T3K4 the shipping module works fine.  If I mistype the postal code like: - V1T 3K3 (which is a common Canadian postal code format) then shipping indicates: Free Shipping.  How can this module be configured to accept only the one format that works?  Thanks.")* was created by *[jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")*

-- url of the page with the problem -- : [ www.habbyjacks.com](https://www.habbyjacks.com)
-- HikaShop version -- : 3.4
-- Joomla version -- : 3.8.7

When I type in a postal code like:
- V1T3K4 the shipping module works fine.

If I mistype the postal code like:
- V1T 3K3 (which is a common Canadian postal code format) then shipping indicates: Free Shipping.

How can this module be configured to accept only the one format that works?

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0NTkzLWNhbmFkYS1wb3N0LXBvc3RhbC1jb2RlLWZvcm1hdHRpbmctYnJlYWtzLXNoaXBwaW5nLXJhdGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

8 years 6 months ago [\#292068](#292068) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Canada Post - Postal Code formatting breaks shipping rates](/forum/28-shipping-methods/894593-canada-post-postal-code-formatting-breaks-shipping-rates#292068 "-- url of the page with the problem -- :   www.habbyjacks.com  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.7  When I type in a postal code like: - V1T3K4 the shipping module works fine.  If I mistype the postal code like: - V1T 3K3 (which is a common Canadian postal code format) then shipping indicates: Free Shipping.  How can this module be configured to accept only the one format that works?  Thanks.")*

Hi,

You want to edit the post code custom field via the menu Display&gt;Custom fields and use the "regular expression check" field to restrict what can be entered as post code.
For example: Code:

[0-9a-zA-Z]+

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0NTkzLWNhbmFkYS1wb3N0LXBvc3RhbC1jb2RlLWZvcm1hdHRpbmctYnJlYWtzLXNoaXBwaW5nLXJhdGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")**
- [![jukeboxjunkey's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar15117.png)](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile") Topic Author
- [ Offline](/forum/user/15117-jukeboxjunkey)

Less More

- Posts: 33
- Thank you received: 2
-
-
-
-

8 years 6 months ago -  8 years 6 months ago [\#292108](#292108) by [jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")  Replied by *[jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile")* on topic *[Canada Post - Postal Code formatting breaks shipping rates](/forum/28-shipping-methods/894593-canada-post-postal-code-formatting-breaks-shipping-rates#292108 "-- url of the page with the problem -- :   www.habbyjacks.com  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.7  When I type in a postal code like: - V1T3K4 the shipping module works fine.  If I mistype the postal code like: - V1T 3K3 (which is a common Canadian postal code format) then shipping indicates: Free Shipping.  How can this module be configured to accept only the one format that works?  Thanks.")*

I am using the following for my regular expression check.

(^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]?\d[ABCEGHJKLMNPRSTVWXYZ]\d$)&#124;(^\d{5}(-\d{4})?$)

This permits Canadian Postal Codes without the space and American Postal Codes.

- If a purchaser enters an invalid postal code (ie: X1X 1X1) which is supposed to be Canada Post's format but doesn't work with the Canada Post plugin, then they receive a custom error message, however they are STILL PERMITTED to continue with the purchase which indicates Free Canada Post shipping.

It looks like I need a way to prevent the user from entering the incorrect Postal Code format at the time they are entering it, or somehow convert it to the correct format.

- [ ![hikashop-18-05-01a.jpg](/forum/attachment/43544) ](/forum/attachment/43544 "...-18-05-01a.jpg") [ ](/forum/attachment/43544?download=1 "...-18-05-01a.jpg")

Last edit: 8 years 6 months ago by [jukeboxjunkey](/forum/user/15117-jukeboxjunkey "View jukeboxjunkey's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0NTkzLWNhbmFkYS1wb3N0LXBvc3RhbC1jb2RlLWZvcm1hdHRpbmctYnJlYWtzLXNoaXBwaW5nLXJhdGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

8 years 6 months ago [\#292137](#292137) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Canada Post - Postal Code formatting breaks shipping rates](/forum/28-shipping-methods/894593-canada-post-postal-code-formatting-breaks-shipping-rates#292137 "-- url of the page with the problem -- :   www.habbyjacks.com  -- HikaShop version -- : 3.4 -- Joomla version -- : 3.8.7  When I type in a postal code like: - V1T3K4 the shipping module works fine.  If I mistype the postal code like: - V1T 3K3 (which is a common Canadian postal code format) then shipping indicates: Free Shipping.  How can this module be configured to accept only the one format that works?  Thanks.")*

Hi,

I'm not able to reproduce the issue on your website.
When I try to enter a new address with a wrong post code, the creation of the address is refused, I get an error message, and I can't go to the next step:
[ monosnap.com/file/UHBjbTsg4dOOXKkbWlK6tJOW3sU3mn](https://monosnap.com/file/UHBjbTsg4dOOXKkbWlK6tJOW3sU3mn)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0NTkzLWNhbmFkYS1wb3N0LXBvc3RhbC1jb2RlLWZvcm1hdHRpbmctYnJlYWtzLXNoaXBwaW5nLXJhdGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.058 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
