[Add On Request] Geotargeting Block

I would like to have an addon that would allow me to show content based on visitor's IP location.



For example, If I have a visitor from Canada, instead of showing US flag, I would like to show Canada flag. It should be HTML block since it gives more freedom compared to Banner block or others.



It should pull IP location database from Max Mind or another IP geolocation provider on a regular basis to make sure IP database is accurate.



Please let me know if you have any questions.



Thanks

You have two components.[list=1]

[]Update of the ip db (our EZ Admin Helper will do that for you)

[
]Create an html block with smarty support and use template code that will display images/text based on “Locations” information (Administration/Shipping/Locations).

[/list]

You will need to be a bit Smarty savvy to do the block but essentially you're going to want to:[list]

[]Get the country info based on $smarty.server.REMOTE_ADDR

[
]Use that country as the “condition” that enables different smarty code

[*]Dirty example:

[/list]

```php

{assign var=“country_code” value=$smarty.server.REMOTE_ADDR|ip_to_long|fn_get_country_by_ip}

{if $country_code == 'us'}


{elseif $country_code == 'ca'}


{else} {* default *}


{/if}

```

Note that this code has not been tested. It is provided as an example only.

That is Brilliant! Thank you, I'll look into smarty to see if I can get it do what I need to do.