core/api/modules/cart/mod (conflicted copy 2022-1...

26 lines
721 B
JavaScript
Raw Normal View History

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