Last active
September 5, 2019 19:14
-
-
Save ASDAFF/43e58e2fd55182b1915f3165546e8486 to your computer and use it in GitHub Desktop.
ajax обновление корзины
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
| //удаление товара из корзины в попапе | |
| $(document).on("click", '.t-basket__close', function(e) { | |
| e.preventDefault(); | |
| var id = $(this).attr('itemId'); | |
| $.ajax({ | |
| url: '/local/ajax/delforbasket.php', | |
| data: { | |
| id: id, | |
| }, | |
| dataType: 'json', | |
| success: function(result){ | |
| $('.header__h-info li.h-info__item-basket span.h-info__count').text(parseInt($('.header__h-info li.h-info__item-basket span.h-info__count').text())-1); | |
| // начало аджакс запроса обновления корзины | |
| $.ajax({ | |
| url:'/local/ajax/addtocart.php', | |
| type:'POST', | |
| data:{'basket':'refresh'}, | |
| success: function(data) { | |
| $('#basket_popup').html(data); | |
| }, | |
| }) | |
| // конец запроса | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment