Forked from flayder/ajax обновление корзины битрикс
Created
November 11, 2017 20:31
-
-
Save ASDAFF/136980a8cbd61744a44fd51abd81f6fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.order').click(function(){ | |
var ide = $(this).parent().find('input:hidden').val(); | |
$.ajax({ | |
type: "POST", | |
data: 'action=ADD2BASKET&ajax_basket=Y&id='+ide, | |
url: '/', | |
success: function(data){ | |
data = data.split('\'').join('\u0022'); | |
var obj = JSON && JSON.parse(data) || $.parseJSON(data); | |
if (obj.STATUS == 'OK'){ | |
BX.onCustomEvent('OnBasketChange'); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment