- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
var data = "";
var delivery_type;
if (modes_object["delivery"] == true) delivery_type = "delivery";
else delivery_type = "no_delivery";
data += "delivery_type=" + delivery_type;
var shop_id = $(".order__shop_select").val();
data += "&shop_id=" + (shop_id);
if (modes_object["delivery"] == true) {
var address = $('[data-input="address"] .input_to_check').val();
data += "&address=" + (address);
}
var phone = $('[data-input="phone"] .input_to_check').val();
data += "&phone=" + (phone);
var client_name = $('[data-input="client_name"] .input_to_check').val();
data += "&client_name=" + (client_name);
var email = $('[data-input="email"] .input_to_check').val();
data += "&email=" + (email);
var comment = $('.order__textarea').val();
data += "&comment=" + (comment);
if (modes_object["new_addr"]) {
var new_addr_name = $('[data-block="new_addr"] .order__input').val();
data += "&new_addr_name=" + new_addr_name;
}
if ($('[data-input="tableware_quantity"]').length) {
var tableware_quantity = $('[data-input="tableware_quantity"] .input_to_check').val();
data += "&tableware_quantity=" + tableware_quantity;
}
if ($('[data-input="promo_code"]').length) {
var promo_code = $('[data-input="promo_code"] .input_to_check').val();
data += "&promo_code=" + promo_code;
}
data += ($(".order__save_checkbox").prop("checked") == true) ? "&save_address=1" : "";
var card_number = $('[data-input="card_number"] .order__input').val();
data += "&card_number=" + card_number;
if ($(".card_order__checkbox").prop("checked")) {
data += "&card_ordered=true";
}
var time_to_take;
if (modes_object["delivery"] == false) {
var day_to_take = $.trim($(".order__day option:selected").text());
var hour_to_take = $.trim($(".order__time--hour option:selected").text());
var minute_to_take = $.trim($(".order__time--minutes option:selected").text());
time_to_take = day_to_take + " в " + hour_to_take + ":" + minute_to_take;
data += "&time_to_take=" + time_to_take;
} else {
data += "&time_to_take=";
}
if (modes_object["bank"] == true) {
data += "&bank=true";
}
data += "&user_id=" + user_id;
data += "&source=" + order_source;
var modes = JSON.stringify(modes_object);
data += "&modes=" + modes;
Комментарии (0) RSS
Добавить комментарий