http://drupal.org/sandbox/rocketeerbkw/1074022

Gives site builders the ability to disable states in the state dropdown on the checkout page. States in the billing and shipping pane can be disabled separately (to allow someone to buy a product from Hawaii address without shipping there for example).

Other methods I've seen to accomplish this are:

Tested with Ubercart 2.4 only

Comments

rocketeerbkw’s picture

Status: Active » Needs review

I have a completed MVP module in my sandbox repo on 6.x-1.x branch

venutip’s picture

Assigned: Unassigned » venutip

At the DrupalCon code review sprint and am reviewing this module. Stand by.

venutip’s picture

Assigned: venutip » Unassigned

Needs @file blocks:

http://drupal.org/node/1354#files

Other than that, looks good.

rocketeerbkw’s picture

Status: Needs review » Reviewed & tested by the community

Thanks a ton for reviewing, I've added and committed the @file blocks to the sandbox.

Marking as RTBC.

laura s’s picture

Status: Reviewed & tested by the community » Needs review

@rocketeerbkw, I appreciate your enthusiasm, but a reviewer must change the status to "reviewed & tested by the community".

tr’s picture

Status: Needs review » Needs work

I think this project fills a need, does not duplicate any other module, and adheres to Drupal coding standards. I filed several issues with the sandbox project to make some minor changes, but I don't think those are significant enough to hold up approval - they can be handled through the normal issue queue.

I downloaded the project and tested it out, and it has one big problem. It only works to restrict zones for the store default country when the checkout form is first loaded, and only if the customer never changes the billing or shipping country. If the customer changes the country on the checkout form, none of the "disable" selections work, even if the country is then changed back to the store default. I think this big problem should be addressed before the module is released.

rocketeerbkw’s picture

Thanks for the review!

I noticed that changing the country shows all the zones and opened an issue on the project #1074564: Form AHAH shows disabled states. Since the form will generate an error when choosing a disabled zone I marked it as non-critical. The module still prevents you from shipping to disabled zones.

I will work on getting that (and #1074890: Copy address checkbox copies states even if they should be disabled which is very similar) fixed.

clemens.tolboom’s picture

Each project application ticket needs a reference to the sandbox git file

Powered by dreditor (triage patch) and Triage transitions

tr’s picture

@clemens.tolboom: The link to his sandbox is the very first line of his original post ...

rocketeerbkw’s picture

Status: Needs work » Needs review

I was finally able to fix #1074890: Copy address checkbox copies states even if they should be disabled

There is one minor issue left #1117632: Please change name to uc_disable_zones but I believe it's ready for a review again.

sreynen’s picture

Issue tags: +PAReview: Ubercart

Tagging for easier finding.

ralt’s picture

Component: new project application » module
Priority: Normal » Critical

Changing priority according to the new priority guidelines.

tr’s picture

Priority: Critical » Normal
Status: Needs review » Needs work
rocketeerbkw’s picture

Status: Needs work » Needs review

Thought that was only for d7 modules but fixed in my d6 branch anyway

alexreinhart’s picture

I just have one question about this module. The function _uc_disable_zones_get_country_zone_list performs a db_query for every country in the list. Can this list become long (more than one or two dozen countries)? If so, I'd suggest selecting all zones beforehand and processing in PHP, rather than performing dozens of MySQL queries.

rocketeerbkw’s picture

That's a good point. I tested it with all default ubercart countries/zones imported and didn't notice any performance issues (testing locally is probably not a great test for that though).

That function is only used in the administration sections so I'll probably refactor it when I upgrade the module for 7.x-3.x (I hope to do so soon)

alexreinhart’s picture

Status: Needs review » Reviewed & tested by the community

Well, I can't say I have any other comments. It looks good to me. I didn't review the JS, since I don't know much of it, so I trust you'll test it thoroughly.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -PAReview: Ubercart

Congrats!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.