2023-07-12 20:02:20 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
24.06.2023
|
|
|
|
|
Оформление заказа зареганного пользователя
|
|
|
|
|
ligat - юр и не юр лицо
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$( "#a-zak-auth" ).click( function( event ){
|
|
|
|
|
//Выбираем организацию
|
|
|
|
|
var o = $("#selectOrg").val();
|
|
|
|
|
//Выбираем способ доставки
|
|
|
|
|
var d = $("#selectDostavka").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
type:"POST",
|
|
|
|
|
url:'/act/cart',
|
|
|
|
|
data:"act=zak-auth&o=" + o + "&d="+d,
|
2023-08-14 09:15:58 +05:00
|
|
|
|
success:function(data){
|
|
|
|
|
$(".shop-cart-list").html("<h2>Заказ успешно оформлен, номер заказа - " + data + "<h2>");
|
|
|
|
|
}
|
2023-07-12 20:02:20 +05:00
|
|
|
|
});
|
2023-08-14 09:15:58 +05:00
|
|
|
|
|
2023-07-12 20:02:20 +05:00
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
})
|
2022-12-11 13:55:49 +05:00
|
|
|
|
|
2023-07-12 20:02:20 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
22.06.2023
|
|
|
|
|
Удаление из корзины
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$( ".a-del-from-cart" ).click( function( event ){
|
|
|
|
|
//alert(1);
|
|
|
|
|
var id=$(this).data('id');
|
|
|
|
|
$.ajax({
|
|
|
|
|
type:"POST",
|
|
|
|
|
url:'/act/cart',
|
|
|
|
|
data:"act=del-from-cart&id=" + $(this).data('id'),
|
|
|
|
|
success:function(data){ }
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$( "#div-" + id).addClass("hidden");
|
|
|
|
|
/*$("#alert-zakaz-ok").removeClass('hidden');
|
|
|
|
|
$(".table").addClass('hidden');*/
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
2023-03-11 21:03:29 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
06.03.2023
|
|
|
|
|
Простое оформление заказа на зарегистрированного физ лица
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$( "#btn-zakaz-fz" ).click( function( event ){
|
|
|
|
|
|
2022-12-11 13:55:49 +05:00
|
|
|
|
$.ajax({
|
2022-12-24 21:12:23 +05:00
|
|
|
|
type:"POST",
|
|
|
|
|
url:'/act/cart',
|
2023-03-11 21:03:29 +05:00
|
|
|
|
data:"act=zakazFz",
|
|
|
|
|
success:function(data){ }
|
2022-12-11 13:55:49 +05:00
|
|
|
|
});
|
2023-03-11 21:03:29 +05:00
|
|
|
|
$("#alert-zakaz-ok").removeClass('hidden');
|
|
|
|
|
$(".table").addClass('hidden');
|
2022-12-11 13:55:49 +05:00
|
|
|
|
return false;
|
2023-03-11 21:03:29 +05:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
06.03.2023
|
|
|
|
|
Простое оформление заказа на НЕ зарегистрированного физ лица
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$("#order-fio").val(localStorage.getItem('fio'));
|
|
|
|
|
$("#order-tel").val(localStorage.getItem('tel'));
|
|
|
|
|
$("#order-email").val(localStorage.getItem('email'));
|
|
|
|
|
|
|
|
|
|
$( "#btn-zakaz-fz-anonim" ).click( function( event ){
|
|
|
|
|
var fio = $("#order-fio").val();
|
|
|
|
|
var tel = $("#order-tel").val();
|
|
|
|
|
var email = $("#order-email").val();
|
|
|
|
|
|
|
|
|
|
localStorage.setItem('fio', fio);
|
|
|
|
|
localStorage.setItem('tel', tel);
|
|
|
|
|
localStorage.setItem('email', email);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type:"POST",
|
|
|
|
|
url:'/act/cart',
|
|
|
|
|
data:"act=zakazFzAnonim&fio=" + fio + "&tel=" + tel + "&email=" + email,
|
|
|
|
|
success:function(data){ }
|
|
|
|
|
});
|
|
|
|
|
$("#alert-zakaz-ok").removeClass('hidden');
|
|
|
|
|
$(".table").addClass('hidden');
|
|
|
|
|
return false;
|
|
|
|
|
})
|