Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Researched GeoIP solutions for Commerce 2.x: #2639280: Integrate with a GeoIP solution.
This module makes the most sense.
A D8 codebase would limit itself to the v2 API, get the library via Composer, and define a plugin type for GeoHandlers (or whatever they end up being called).
One plugin could support getting the info from $_SERVER (for CDNs), the other could use the maxmind library/db itself.
The plugin API allows for plugins to have settings (credentials, path to a db file, etc). The main method would return a value object with the result (country code, continent, etc).
Comment | File | Size | Author |
---|---|---|---|
#3 | port_to_drupal_8-2639412-3.patch | 75.19 KB | mglaman |
#2 | Screen Shot 2015-12-30 at 9.46.20 AM.png | 75.14 KB | mglaman |
Comments
Comment #2
mglamanI've got a working port here: https://github.com/mglaman/geoip.
Here's result using Devel's PHP form and the Local (Maxmind) plugin
Comment #3
mglamanHere is my patch for the port, found here https://github.com/mglaman/geoip. I've got it working where it
Comment #4
colanThanks for the patch!
Looks like it depends on Composer Manager , which is now deprecated given the Composer support in Drupal core 8.1.x. The installation instructions & such should be updated just as Address was.
Comment #5
bojanz CreditAttribution: bojanz at Centarro commentedWe also need to remove the Address dependency, no reason to have it. The moduile should use its own value object for the result.
Comment #7
das-peter CreditAttribution: das-peter at Cando commented@mglaman Thank you very much for porting & sorry for my horrible response time. I just created a 8.x-2.x branch, committed & pushed the patch and for your convenience I added you as maintainer. So if you like feel free to go ahead and push directly to the new 8.x branch.
As soon the branch shows up on d.o. I'll activate dev releases too.
Comment #8
colanAs #3 was committed, we need to create follow-up issues for #4 and #5.
Comment #9
colanUpdating version.
Comment #10
colanI just found out about the Smart IP module via #2755723: Support geo-IP lookup option in default currency selector, which has had a stable Drupal 8 release for almost a year. As we don't have one here yet, should we redirect our energies towards that module and deprecate this one (for D8)? It would be a shame to duplicate our efforts.
Comment #11
bojanz CreditAttribution: bojanz at Centarro commented@colan
Matt and I will be continuing to devote our attention to this module.
We use it for Commerce sites, and prefer its architecture.
Comment #12
colan#11: Sounds good. In that case, could we list the other one as an alternative module on the project page? Thanks.
Comment #13
sumanthkumarc CreditAttribution: sumanthkumarc at Azri Solutions commented@colan , i used the d8 version of this module for production and works fine. I prefer this over other ip lookup modules.
Comment #14
nterbogt CreditAttribution: nterbogt at Flight Centre Travel Group commentedIs a stable release of the 8.x branch scheduled?
Comment #15
bojanz CreditAttribution: bojanz at Centarro commentedI've tagged a beta1, let's continue discussing the plans for RC1 and beyond in #3013319: 8.x-2.0 stable roadmap.