core/api/modules/cart/mod.js

27 lines
718 B
JavaScript
Raw Normal View History

2022-12-24 21:12:23 +05:00
$(".change-kolvo").keyup(function(event){
var id=$(this).data('id');
var kolvo=$(this).val();
2022-12-11 13:55:49 +05:00
$.ajax({
2022-12-24 21:12:23 +05:00
type:"POST",
url:'/act/cart',
data:"act=change-kolvo&kolvo=" + kolvo + "&id=" + id,
success:function(data){$("#summ").text(data)}
2022-12-11 13:55:49 +05:00
});
2022-12-24 21:12:23 +05:00
})
//удалялка
2023-01-07 18:55:55 +05:00
function deleteFromCart( id, summ ){
$( "#div-" + id ).hide( 600 );
$( "#summ" ).text( summ );
}
2022-12-24 21:12:23 +05:00
2022-12-11 13:55:49 +05:00
2022-12-24 21:12:23 +05:00
$( ".a-del-from-cart" ).click( function( event ){
var id = $(this).data( 'id' );
2022-12-11 13:55:49 +05:00
$.ajax({
2022-12-24 21:12:23 +05:00
type:"POST",
url:'/act/cart',
data:"act=del-from-cart&id=" + id,
success:function(data){ deleteFromCart( id, data ) }
2022-12-11 13:55:49 +05:00
});
return false;
2022-12-24 21:12:23 +05:00
})