Can I make the Postal Code dissappear for a single country?

Posts: 114
Joined: 08/07/2007
Uber DonorBug FinderEarly adopter... addicted to alphas.Spreading the word - Ubercart for president.

A client in Hong Kong does not want the postal code field to appear in his store's checkout pane (/cart/checkout) in the delivery and billing portions of the page for orders that are delivered to Hong Kong (which does not use postal codes).

I have edited the Hong Kong address variables here: admin/store/settings/countries/edit/formats

Here is the code I am using.

!first_name
!last_name
!street1
!street2
!city
!country_name

But the postal code still shows in the delivery and billing areas of checkout. When I review my order, everything appears as it should, i.e., without the postal code. But for appearance sake I'd like to see if postal code can be removed for just Hong Kong.

Many thanks for any assistance.

Posts: 4686
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

In a case like this, the easiest option is most likely going to be use a custom JS snippet to add an onchange to the select that will hide the zone field when Hong Kong is selected. I'm not sure it would be worth the time to make the forms and such to add this feature to core. Sad

Posts: 114
Joined: 08/07/2007
Uber DonorBug FinderEarly adopter... addicted to alphas.Spreading the word - Ubercart for president.

Thanks Ryan. I agree... best, david

------------------------------------------------------------------
Greystoke Farm's Online Tack Shop
http://greystokefarm.com/store
----------------------------------------------------

Posts: 1212
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

However, I think this is good for some instances where .. well here's a test case from our site.

I need States for domestic orders, of course. If someone from Albany, NY orders a product, we need to know that it's not meant to go to Albany, GA.

Unfortunately there are many countries that don't have "Zones" per se, Finland being one of them. Which means we cannot require the Zone field be entered for an order to complete.

The result of this setup means that we've had some domestic orders come through, and the user has not specified a state. For most cases this works (since the majority of our content is downloadable) but I think giving an option to force a state requirement in a domestic order is the way to go. Perhaps a variable in UC such as "Force Zone field requirement in domestic orders" or something to that effect.

If this is something trivial, perhaps I could write a contrib, but it's something to consider IMO.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com