📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
catalog
/
view
/
javascript
📝
city.js
← Geri Dön
$(document).ready(function () { $(document).on('change', 'select[name="zone_id"]', function () { var city_node = $(this).parent().parent().parent().find('select[name="city"]'); getcities($(this).val(), city_node); }); $(document).ajaxComplete(function (event, xhr, settings) { // journal checkout var res_action = settings.url.split("journal3/checkout/payment"); if (res_action.length > 1) { $('select[name="zone_id"]').each(function (index) { if ($(this).val()) { var city_node = $(this).parent().parent().find('select[name="city"]'); getcities($(this).val(), city_node); } }); } // register var res_action1 = settings.url.split("account/account/country"); if (res_action1.length > 1) { var json = $.parseJSON(xhr.responseText); if (!json['error']) { zone_id = $('select[name="zone_id"]'); var city_node = zone_id.parent().parent().parent().find('input[name="city"]'); getcities(zone_id.val(), city_node); } } // default checkout var res_action2 = settings.url.split("checkout/checkout/country"); if (res_action2.length > 1) { var json = $.parseJSON(xhr.responseText); if (!json['error']) { $('select[name="zone_id"]').each(function (index) { var city_node = $(this).parent().parent().parent().find('input[name="city"]'); if ($(this).val()) { getcities($(this).val(), city_node); } else { if (!city_node.hasClass('city')) { city_node.replaceWith('<select name="city" class="form-control city"></select>'); } } }); } } // Xtensions Best Checkout var res_action2 = settings.url.split("extension/module/xtensions/checkout/checkout/country"); if (res_action2.length > 1) { var json = $.parseJSON(xhr.responseText); if (!json['error']) { $('select[name="zone_id"]').each(function (index) { var city_node = $(this).parent().parent().parent().find('input[name="city"]'); if ($(this).val()) { getcities($(this).val(), city_node); } else { if (!city_node.hasClass('city')) { city_node.replaceWith('<select name="city" class="form-control city"></select>'); } } }); } } // register affiliate var res_action3 = settings.url.split("affiliate/register/country"); if (res_action3.length > 1) { var json = $.parseJSON(xhr.responseText); if (!json['error']) { zone_id = $('select[name="zone_id"]'); var city_node = zone_id.parent().parent().parent().find('input[name="city"]'); getcities(zone_id.val(), city_node); } } }); }); function getcities(zone_id, city_node) { if(zone_id) { $.ajax({ url: 'index.php?route=extension/module/city&zone_id=' + zone_id, dataType: 'json', success: function (json) { html = ''; var city = city_node.val(); if (city_node.prop("tagName") != 'SELECT') { html += '<select name="city" class="form-control city">'; } html += '<option value="">' + json['text_select'] + '</option>'; if (json['cities'] && json['cities'] != '') { for (i = 0; i < json['cities'].length; i++) { html += '<option value="' + json['cities'][i]['name'] + '"'; if (json['cities'][i]['name'] == city) { html += ' selected="selected"'; } html += ' data-code="' + json['cities'][i]['post_code'] + '">' + json['cities'][i]['name'] + '</option>'; } } else { html += '<option value="0" selected="selected">' + json['text_none'] + '</option>'; } if (city_node.prop("tagName") != 'SELECT') { html += '</select>'; city_node.replaceWith(html); } else { city_node.html(html); } }, error: function (xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); } else { html = ''; var city = city_node.val(); if (city_node.prop("tagName") != 'SELECT') { html += '<select name="city" class="form-control city">'; } if (city_node.prop("tagName") != 'SELECT') { html += '</select>'; city_node.replaceWith(html); } else { city_node.html(html); } } } $(document).on('change', 'select[name="city"]', function () { if (window['_QuickCheckout'] != undefined) { window['_QuickCheckout']['order_data']['payment_postcode'] = $(this).children("option:selected").attr('data-code'); } else { $(this).parent().parent().parent().find('input[name="postcode"]').val($(this).children("option:selected").attr('data-code')); } });
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula