Skip to content

Instantly share code, notes, and snippets.

@vorvulev
Created May 1, 2019 11:53
Show Gist options
  • Save vorvulev/2e34dd4066cee97f2391c4dfcaf19fff to your computer and use it in GitHub Desktop.
Save vorvulev/2e34dd4066cee97f2391c4dfcaf19fff to your computer and use it in GitHub Desktop.
$.ajaxSetup({
beforeSend: function (xhr,settings) {
var str = settings.url;
if(str.indexOf('https://insales.boxberry.ru/box/insales/get-price-courier.php') + 1) {
settings.url = str.replace(/zip/g,'zip_none');
$('#order_delivery_variant_id_1302944').on('updated:insales:delivery', function(e) {
if(e.originalEvent.detail.available == true){
$(this).parent().parent().css({'display': 'table-row', 'visibility': 'visible'})
}else{
$(this).parent().parent().css({'display': 'none', 'visibility': 'hidden'})
}
})
return true;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment