Alejandro Troncoso
2022-01-19T14:57:40Z

geocoder_detect_country_select_Currency.js

| /*
| $(function() {
| fetch("/geocoder/ip", {
| method: "get"
| }).then(function (response) {
| if (response.ok) {
| return response.json().then(function(json) {
| var country_code = json["country_code"];
|
| switch(country_code) {
| case 'KR':
| {% if store.currency_code != "KRW" %}Jumpseller.setCurrency('KRW');{% endif %}
| break;
| case 'SG':
| {% if store.currency_code != "SGD" %}Jumpseller.setCurrency('SGD');{% endif %}
| break;
| case 'PL':
| {% if store.currency_code != "PLN" %}Jumpseller.setCurrency('PLN');{% endif %}
| break;
| case 'CH':
| {% if store.currency_code != "CHF" %}Jumpseller.setCurrency('CHF');{% endif %}
| break;
| case 'CO':
| {% if store.currency_code != "COP" %}Jumpseller.setCurrency('COP');{% endif %}
| break;
| case 'MX':
| {% if store.currency_code != "MXN" %}Jumpseller.setCurrency('MXN');{% endif %}
| break;
| case 'AR':
| {% if store.currency_code != "ARS" %}Jumpseller.setCurrency('ARS');{% endif %}
| break;
| case 'BR':
| {% if store.currency_code != "BRL" %}Jumpseller.setCurrency('BRL');{% endif %}
| break;
| case 'AU':
| {% if store.currency_code != "AUD" %}Jumpseller.setCurrency('AUD');{% endif %}
| break;
| case 'CA':
| {% if store.currency_code != "CAD" %}Jumpseller.setCurrency('CAD');{% endif %}
| break;
| case 'GB':
| {% if store.currency_code != "GBP" %}Jumpseller.setCurrency('GBP');{% endif %}
| break;
| case 'US':
| {% if store.currency_code != "USD" %}Jumpseller.setCurrency('USD');{% endif %}
| break;
| case 'BR':
| {% if store.currency_code != "BRL" %}Jumpseller.setCurrency('BRL');{% endif %}
| break;
| default:
| {% if store.currency_code != "EUR" %}Jumpseller.setCurrency('EUR');{% endif %}
| break;
| }
| });
|
| }
| })
| });