Categories
Drupal Development Resources

Restricting Shipping States in Ubercart, Drupal 6

We recently had to do some work for a client where they were only allowed to ship to certain states due to alcohol license shipping restrictions. Our needs were pretty simple and we didn’t want unnecessary overhead to affect performance, so we rolled our own solution with a custom module.

This example is a very simple case, where users can purchase from anywhere, but only ship within California. To accomplish this, we used Drupal hook_form_alter to modify a form element only on the shipping panel:

 'California'
    );
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.