Jump to content

Smarty snippet / addon (or similar) to display Geo Targeted Content for State


cdeese8

Recommended Posts

May you please point me into the right direction on how I could achieve this? This is what I imagine would just magically work if I typed into a .tpl file...

{if statecode = "AK"}
hi people from Alaska
{elseif statecode = "CO"}
hi people from Colorado
{else}
hi everyone else...
{/if}

Right now I'm still doing research, here are some notes I have:

* https://www.docs.modulesgarden.com/Geolocation_Hook_For_WHMCS
* site:whmcs.community conditional logic geo localization
* maxmind Geolocation whmcs -fraud
* https://dev.maxmind.com/geoip/geoip2/geolite2/
* https://ipinfo.io/
* https://whmcs.community/topic/249129-custom-html-panel-for-specific-country/
* http://www.smarty.net/docs/en/language.function.if.tpl
* https://www.smarty.net/docs/en/plugins

Any wisdom you may have that can help me achieve what I desire would be awesome. Thanks!

:)

Edited by cdeese8
updated title
Link to comment
Share on other sites

16 hours ago, cdeese8 said:

May you please point me into the right direction on how I could achieve this?

you missed out one vital piece of information - do you want to do this for everyone or just for logged in clients ?

if logged in clients, then it's simple as "state" will be one of the values in the $clientsdetails array and all clientarea pages will have access to that.

if everyone, then you're in the realms of utilising a third-party Geo-IP location service (e.g one of the ones that you've listed that includes city/states)... although bear in mind that no such service is 100% accurate, and certainly not if the visitor is using a VPN to view the site.

Link to comment
Share on other sites

This addon might be overkill, but perhaps the Geolocation Hook For WHMCS config.php (geolocation_hook_2.0.1_whmcs\includes\Geolocation\config.php) file might be the best starting point. I can add the GeoLite2 City.mmdb and see what kind of damage I can do in a couple of hours.

Maybe you know this kind of stuff just because... 😃... if you had to guess, do you think, by adding a 59 meg file to the addon will make website load speed noticeably slower?

qerGUDj.png

Of course! I didn't think about doing something for logged in clients but yea, you make good point about VPN. Using WHMCS 7.4.* and stock template, I thought it would be fancy for logged out clients to see something a tad-bit more welcoming. The idea is to make a landing page that converts and having a little bit extra touch of personal might help (or deter because it's creepy).

Alright, gonna dig my fingers into the keyboard.. thanks for feedback

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated