var swiper = new Swiper(".offer_slider", {
loop: true,
autoplay: {
delay: 4900,
},
// effect: 'fade',
// fadeEffect: {
// crossFade: true
// },
pagination: {
el: ".swiper-pagination",
},
on: {
init: function () {
console.log('swiper initialized');
let video = document.querySelector(".swiper-slide-active .mainscreen__video");
video.currentTime = 0;
},
},
});
swiper.on('slideChange', function () {
console.log('slide changed');
let video = document.querySelector(".swiper-slide-active .mainscreen__video");
video.currentTime = 0;
});
add_action('wp_footer', 'skryt_block_sposoba_oplaty', 9999);
function skryt_block_sposoba_oplaty()
{
// Создадим переменну со значением выбора способа доставки
$chosen_shipping_methods = WC()->session->get('chosen_shipping_methods')[0];
// Проверяем выбран ли по умолчанию т.е. при загрузки страницы "самовывоз"?
?>
<!-- Если да , то... -->
<script type="text/javascript">
jQuery(document).ready(function($) {
// Ждём когда на странице закончится Ajax
$(document).ajaxStop(function() {
// После окончания (спустя мгновение) монипулируем DOM-элементами
setTimeout(function() {
// Это наш список с выбором способа оплаты
var ViborMetodaOplaty = $(' #billing_sum_field, #billing_address_1_field, #billing_state_field, #billing_sdacha_field');
// Это пункт выбора способа доставки "самовывоз"
var Samovyvoz = $('input#shipping_method_0_flexible_shipping_single37, input#shipping_method_0_flexible_shipping_single22, input#shipping_method_0_flexible_shipping_single32, input#shipping_method_0_flexible_shipping_single22, input#shipping_method_0_flexible_shipping_single28, input#shipping_method_0_flexible_shipping_single33, input#shipping_method_0_flexible_shipping_single26, input#shipping_method_0_flexible_shipping_single30, input#shipping_method_0_flexible_shipping_single22, input#shipping_method_0_flexible_shipping_single32, input#shipping_method_0_flexible_shipping_single22, input#shipping_method_0_flexible_shipping_single28, input#shipping_method_0_flexible_shipping_single33, input#shipping_method_0_flexible_shipping_single26, input#shipping_method_0_flexible_shipping_single24');
// Курьерская доставка ->>
// var Samovyvoz = $('input#shipping_method_0_flexible_shipping_single26') ;
// Если НЕ выбран "самовывоз",то...
//console.log(Samovyvoz);
if (!Samovyvoz.is(':checked')) {
// то показываем список с выбором способа оплаты
ViborMetodaOplaty.fadeIn("fast");
// Если ВЫБРАН "самовывоз",то...
} else {
// то через slideUp скрываем список с выбором способа оплаты
ViborMetodaOplaty.slideUp("fast", function() {
ViborMetodaOplaty.fadeOut();
});
}
if ($('#shipping_method li').length == 1) {
ViborMetodaOplaty.slideUp("fast", function() {
ViborMetodaOplaty.fadeOut();
});
};
$('#billing_sdacha_field').hide();
$('#billing_sum_nalichka').click(function(e) {
e.preventDefault();
$('p#billing_sdacha_field').show();
$(this).attr('checked', 'checked').addClass('checked');
$('#billing_sum_card').removeAttr('checked').removeClass('checked');
});
$('#billing_sum_card').click(function(e) {
e.preventDefault();
$('#billing_sum_nalichka').removeAttr('checked').removeClass('checked');
$('p#billing_sdacha_field').hide();
$(this).attr('checked', 'checked').addClass('checked');
});
if ($('.timework-2 input[type=checkbox]').prop('checked')) {
$('.cart_totals').slideDown();
} else {
if ($('.timework-2').length > 0) {
$('.cart_totals').slideUp();
}
};
}, 100);
});
});
</script>
<?php
}