Перейти к содержимому


Не Отображается Описание Способа Доставки


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 5

#1 customer8765

customer8765

    Активный участник

  • Пользователи
  • PipPipPipPip
  • 328 сообщений

Отправлено 18 Ноябрь 2017 - 11:00

SL-388618

При заполнении формы быстрого заказа под выбранным способом доставки не отображается его описание.
В чате уже сутки никто не отвечает.

#2 MikDark

MikDark

    Активный участник

  • Модераторы
  • 6 468 сообщений

Отправлено 19 Ноябрь 2017 - 16:00

Просмотр сообщенияcustomer8765 (18 Ноябрь 2017 - 11:00) писал:

SL-388618

При заполнении формы быстрого заказа под выбранным способом доставки не отображается его описание.
В чате уже сутки никто не отвечает.

Здравствуйте. Попробуйте в шаблоне 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 customer8765

customer8765

    Активный участник

  • Пользователи
  • PipPipPipPip
  • 328 сообщений

Отправлено 24 Ноябрь 2017 - 03:24

Просмотр сообщенияMikDark (19 Ноябрь 2017 - 16: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 магазина на этом шаблоне, в двух других все отображается.

#4 customer8765

customer8765

    Активный участник

  • Пользователи
  • PipPipPipPip
  • 328 сообщений

Отправлено 24 Ноябрь 2017 - 03:39

Просмотр сообщенияMikDark (19 Ноябрь 2017 - 16: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");
	 }
});
});

На самом деле отображается, но некорректно. При открытии формы быстрого  оформления заказа не отображается. При смене способа доставки отображается, но при этом каждый раз выдается ошибка JS

Uncaught TypeError: Cannot read property 'trim' of undefined на строке: 1077



#5 Stasya

Stasya

    Активный участник

  • Модератоpы
  • 4 007 сообщений

Отправлено 11 Декабрь 2017 - 14:38

Просмотр сообщенияcustomer8765 (24 Ноябрь 2017 - 03:39) писал:

На самом деле отображается, но некорректно. При открытии формы быстрого  оформления заказа не отображается. При смене способа доставки отображается, но при этом каждый раз выдается ошибка JS

Uncaught TypeError: Cannot read property 'trim' of undefined на строке: 1077


Здравствуйте. В файле main.js найдите код
if ($('input.paymentRadio:checked').next('div').html().trim() === '') {
и замените ее на
if ($('input.paymentRadio:checked').next('div').text().trim() === '') {


#6 customer8765

customer8765

    Активный участник

  • Пользователи
  • PipPipPipPip
  • 328 сообщений

Отправлено 23 Декабрь 2017 - 01:32

Просмотр сообщенияStasya (11 Декабрь 2017 - 14:38) писал:

Здравствуйте. В файле main.js найдите код
if ($('input.paymentRadio:checked').next('div').html().trim() === '') {
и замените ее на
if ($('input.paymentRadio:checked').next('div').text().trim() === '') {

Ошибка вроде перестала появляться. Но при открытии формы быстрого оформления заказа описание все равно не отображается.




Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных