Доброго времени суток уважаемые форумчани !
Возникла такая проблема, при оформлении заказа в логе появляется ошибка, может у кого ты было, помогите пожалуйста.
PHP Notice: Undefined variable: zone_id in C:\OpenServer\domains\bs.loc\catalog\view\theme\default\template\checkout\checkout.tpl on line 245
245 строка - это скрипт ( if (json['zone']['zone_id'] == '<?php echo $zone_id; ?>') {
html += ' selected="selected"'; )
Версия движка 1.5.5.1.2
Сам сайт bigsam-russia.ru
<script type="text/javascript"><!--
$('#checkout_form select[name=\'country_id\']').bind('change', function() {
$.ajax({
url: 'index.php?route=checkout/checkout/country&country_id=' + this.value,
dataType: 'json',
beforeSend: function() {
$('#checkout_form select[name=\'country_id\']').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('.wait').remove();
},
success: function(json) {
if (json['postcode_required'] == '1') {
$('#shipping-postcode-required').show();
} else {
$('#shipping-postcode-required').hide();
}
html = '<option value=""><?php echo $text_select; ?></option>';
if (json['zone'] != undefined) {
for (i = 0; i < json['zone'].length; i++) {
html += '<option value="' + json['zone'][i]['zone_id'] + '"';
if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
html += ' selected="selected"';
}
html += '>' + json['zone'][i]['name'] + '</option>';
}
} else {
html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
}
$('#checkout_form select[name=\'zone_id\']').html(html);
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('#checkout_form select[name=\'country_id\']').trigger('change');
$('#confirm').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/checkout',
type: 'post',
data: $('#checkout_form').serialize(),
dataType: 'json',
beforeSend: function() {
$('#confirm').bind('click', false);
$('#confirm').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#confirm').unbind('click', false);
$('.wait').remove();
},
success: function(json) {
$('.warning').remove();
$('.error').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json.errors) {
for (var key in json.errors) {
$('#checkout .checkout-content :input[name=\'' + key + '\']').
after('<span class="error" >' + json.errors[key] + '</span>');
}
var eTop = $('#checkout').offset().top;
$('html, body').animate({scrollTop: eTop}, 'slow');
} else {
if (json.result = "success") {
var confirm_btn = $('#button-confirm');
if (!confirm_btn){
confirm_btn =$('.payment . buttons input.button')
}
confirm_btn.trigger('click');
}
}
}
});
});
$('input[name=payment_method]').live('change', function() {
$(".checkout-product").mask();
$.ajax({
url: 'index.php?route=checkout/checkout/change_payment',
type: 'post',
data: 'payment_code='+$("input[name=payment_method]:checked").val(),
dataType: 'json',
success: function(json) {
if (json.payment){
$(".payment").html(json.payment);
}
$(".checkout-product").unmask();
}
})
});
$('input[name=shipping_method]').live('change', function() {
$(".checkout-product").mask();
$.ajax({
url: 'index.php?route=checkout/checkout/change_shipping',
type: 'post',
data: 'shipping_method='+$("input[name=shipping_method]:checked").val(),
dataType: 'json',
success: function(json) {
$('#total_data').html(json['totals_data']);
$('.payment-content').html(json['payment_data']);
$(".checkout-product").unmask();
}
})
});
//--></script>
Спасибо всем !