|
Доставка
';
var loader2=' получение данных...
';
$(document).ready(function(){
city_change();
$(document).on("click",".map-path", function(){
$(".ymaps-balloon__content").children().css("height","auto");
$(".map-path-text").show(0);
return false;
});
$(document).on('click',".map-point-btn", function(e) {
e.preventDefault();
});
$(document).on("click","#d_reload", function(){
city_change();
return false;
});
$(document).on("click",".btn-delivery", function(e){
e.preventDefault();
if($(this).attr("disabled")!="disabled"){
$(".btn-delivery").removeClass("btn-delivery-act");
$(this).addClass("btn-delivery-act");
type_change($(this).attr("data-id"));
}
});
// new!!---------------------
$('#autocomplete').focus(function () { // select text on focus
$(this).select();
});
$('#autocomplete').autocomplete({
serviceUrl: '/get_kladr.php',
deferRequestBy: 300,
width: 450,
minChars:2,
autoSelectFirst: true,
onSelect: function (suggestion) {
$(this).val(suggestion.name);
var text=suggestion.value;
text=text.replace(/ /i,"");
text=text.replace(//i,"");
$("#city_result").text(text);
$("#city").val(suggestion.data);
city_change();
}
});
// new!!---------------------
$('#btn_param').click(function(e){
e.preventDefault();
$('#dop_param').slideToggle(200);
//alert("vcbxcvbvcb");
});
$("input[name=oplata]").click(city_change);
$("#sum").change(city_change);
$("#weight").change(city_change);
});
function type_change(id){
weight=$("#weight").val();
sum=$("#sum").val();
city=$("#city").val();
payment=$("input:radio[name=oplata]:checked").val();
$("#div_zakaz").html("");
$("#div_tarifs").html(loader2);
$.ajax({
dataType: "html",
cache: false,
url: "delivery_funcs.php",
data: {"city": city, "type": "city", "sum": sum, "weight": weight, "payment": payment, "type_id": id},
success: function(msg){
$("#div_tarifs").html(msg);
}
});
return false;
}
function city_change(){
weight=$("#weight").val();
sum=$("#sum").val();
city=$("#city").val();
payment=$("input:radio[name=oplata]:checked").val();
$("#div_zakaz").html("");
$("#div_type").html(loader2);
$.ajax({
dataType: "html",
cache: false,
url: "delivery_funcs.php",
data: {"city": city, "type": "city", "sum": sum, "weight": weight, "payment": payment},
success: function(msg){
$("#div_type").html(msg);
}
});
}
Расчет стоимости доставки
Чтобы увидеть возможные способы доставки выберите свой населенный пункт.
Обратите внимание, что стоимость доставки зависит от суммы заказа, его веса и способа оплаты.
|
|