Skip to content

Instantly share code, notes, and snippets.

@megabayt
Created April 19, 2018 11:52
Show Gist options
  • Save megabayt/f5a68a5aa7211b2cb7232bf67c4ba58e to your computer and use it in GitHub Desktop.
Save megabayt/f5a68a5aa7211b2cb7232bf67c4ba58e to your computer and use it in GitHub Desktop.
abaris ugps
if ($('#header .button-ugps span').hasClass('choose-city')) {
$.ajax({
url: '/index.php?route=ugps/city/get&json=Y',
type: 'GET',
dataType: 'json',
error: function() {
return console.error();
},
success: function(res) {
if (res.name !== void 0) {
$('#header .button-ugps span').text(res.name);
return $('.ugps button.city').text(res.name);
}
}
});
$.ajax({
url: '/index.php?route=ugps/city/phone&json=Y',
type: 'GET',
dataType: 'json',
error: function() {
return console.error();
},
success: function(res) {
if (res.name !== void 0) {
return $('#header .button-call span').text(res);
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment