core/api/modules/cart/mod.js

27 lines
718 B
JavaScript

$(".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;
})