I'm thinking about using Drupal for a take away (delivery) ecommerce site and was wondering if there is a module that could calculate the the distance between the postcode added by the user and the shop locations (a few) and if its within a certain radius go ahead and allow the user to place the order. Is there such module available for drupal? if not, is there a similar module(s) that could be adapted to it?



There's no single module for this, but you can use a suite of modules. For example, you can take addresses stored in the Address Field module and then use Geocoder to geocode them and save the results in a Geofield. You can then use Rules to check the distance.

That said, there is no simple way to do this. In fact, there's an entire book about Mapping with Drupal.

| improve this answer | |
  • Would you say that'd be reasonable to do with drupal or should I look for a different solution? Would the end result be good (as in robust)? Thanks for your help. – WagnerMatosUK May 22 '13 at 11:01
  • @WagnerMatosUK That's impossible to say without knowing the details of your situation, but it's certainly not going to be a point and click solution. It will probably require some custom PHP glue code and you will also probably have a few obscure bugs that you will have to hunt down patches for (just speaking roughly from experience). That said, it's much easier than writing the whole tool yourself. – Patrick Kenny May 22 '13 at 11:03

There is a Commerce Postal Code Filter module

Postal code (US ZIP codes, UK postcodes etc) filtering functionality for the Drupal Commerce checkout process. This module provides 2 main modes (whitelisting and blacklisting) which allow shop owners to restrict the areas of a country that they deliver to:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.