Не Отображается Описание Способа Доставки
#1
Отправлено 18 Ноябрь 2017 - 11:00
При заполнении формы быстрого заказа под выбранным способом доставки не отображается его описание.
В чате уже сутки никто не отвечает.
#2
Отправлено 19 Ноябрь 2017 - 16:00
customer8765 (18 Ноябрь 2017 - 11:00) писал:
При заполнении формы быстрого заказа под выбранным способом доставки не отображается его описание.
В чате уже сутки никто не отвечает.
Здравствуйте. Попробуйте в шаблоне main.js заменить код:
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').attr('description') $('.currentDeliveryDescription').html(DeliveryDescription); }) })
на
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').next('div').html(); $('.currentDeliveryDescription').html(DeliveryDescription); PaymentDescription = $('input.paymentRadio:checked').next('div').html(); $('.currentPaymentDescription').html(PaymentDescription); if ($('input.paymentRadio:checked').next('div').html().trim() === '') { $('.currentPaymentDesc').css("display", "none"); }else{ $('.currentPaymentDesc').css("display", "block"); } }); });
#3
Отправлено 24 Ноябрь 2017 - 03:24
MikDark (19 Ноябрь 2017 - 16:00) писал:
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').attr('description') $('.currentDeliveryDescription').html(DeliveryDescription); }) })
на
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').next('div').html(); $('.currentDeliveryDescription').html(DeliveryDescription); PaymentDescription = $('input.paymentRadio:checked').next('div').html(); $('.currentPaymentDescription').html(PaymentDescription); if ($('input.paymentRadio:checked').next('div').html().trim() === '') { $('.currentPaymentDesc').css("display", "none"); }else{ $('.currentPaymentDesc').css("display", "block"); } }); });
Не помогло.
У меня 3 магазина на этом шаблоне, в двух других все отображается.
#4
Отправлено 24 Ноябрь 2017 - 03:39
MikDark (19 Ноябрь 2017 - 16:00) писал:
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').attr('description') $('.currentDeliveryDescription').html(DeliveryDescription); }) })
на
$('.mainSelect').change(function(){ selectedDelId = $(this).find('option:selected').attr('delid'); $('.zoneSelect select').hide(); $('.zoneSelect select[del="'+selectedDelId+'"]').show(); $('.zoneSelect select option').attr('selected',false) $('.zoneSelect select[del="'+selectedDelId+'"] option:first-of-type').attr('selected',true); $('.deliveryOption .deliveryRadio[value="'+selectedDelId+'"]').click(); WithoutZone = $('input.deliveryRadio:checked').attr('pricewithoutzones'); WithZone = $('input.deliveryZoneRadio:checked').attr('price'); if(WithZone > 0){startprice = WithZone;}else{startprice = WithoutZone;} $('.changeprice').text(startprice); $('.quick_order_payment').hide(); $('.quick_order_payment[rel="'+ selectedDelId +'"]').show(); startInputId = $('input.deliveryRadio:checked').attr('value'); $('.hiddenpayment input').attr('checked',false); $('.hiddenpayment[rel="'+startInputId+'"] input').each(function(){ $(this).click(); return false; }) DeliveryDescription = $('input.deliveryRadio:checked').next('div').html(); $('.currentDeliveryDescription').html(DeliveryDescription); PaymentDescription = $('input.paymentRadio:checked').next('div').html(); $('.currentPaymentDescription').html(PaymentDescription); if ($('input.paymentRadio:checked').next('div').html().trim() === '') { $('.currentPaymentDesc').css("display", "none"); }else{ $('.currentPaymentDesc').css("display", "block"); } }); });
На самом деле отображается, но некорректно. При открытии формы быстрого оформления заказа не отображается. При смене способа доставки отображается, но при этом каждый раз выдается ошибка JS
Uncaught TypeError: Cannot read property 'trim' of undefined на строке: 1077
#5
Отправлено 11 Декабрь 2017 - 14:38
customer8765 (24 Ноябрь 2017 - 03:39) писал:
Uncaught TypeError: Cannot read property 'trim' of undefined на строке: 1077
if ($('input.paymentRadio:checked').next('div').html().trim() === '') {и замените ее на
if ($('input.paymentRadio:checked').next('div').text().trim() === '') {
#6
Отправлено 23 Декабрь 2017 - 01:32
Stasya (11 Декабрь 2017 - 14:38) писал:
if ($('input.paymentRadio:checked').next('div').html().trim() === '') {и замените ее на
if ($('input.paymentRadio:checked').next('div').text().trim() === '') {
Ошибка вроде перестала появляться. Но при открытии формы быстрого оформления заказа описание все равно не отображается.
Количество пользователей, читающих эту тему: 0
0 пользователей, 0 гостей, 0 анонимных