show a static block just when visitor's GeoIP is from GB
-
30-10-2019 - |
質問
I need to change the content of a static block in magento for visitors from some special countries.
This is the JavaScript embedded into the Magento:
<script src="http://j.maxmind.com/app/country.js" charset="ISO-8859-1"></script>
I use the following code in my static block :
if (geoip_country_code() == 'GB')
{
alert("Hello, you are in Great Britain");
}
But when i save this static block, magento changes it to this:
<p>if (geoip_country_code() == 'GB') { alert("Hello, you are in Great Britain"); }</p>
??!!
What should i do to determine the GeoIP of the visitors and change the Content to be shown in an static block?
正しい解決策はありません
所属していません magento.stackexchange