|
|
|
@ -1,133 +1,5 @@ |
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
jQuery(document).ready(function ($) { |
|
|
|
|
// OVERLAY
|
|
|
|
|
// $('.product__main').on('click', '.open-overlay', function () {
|
|
|
|
|
// let product = $(this).closest('.product__item'),
|
|
|
|
|
// overlay = product.find('.product-item__overlay');
|
|
|
|
|
|
|
|
|
|
// $('.product__item').find('.product-item__overlay').css('top', '100%');
|
|
|
|
|
// overlay.css('top', 0);
|
|
|
|
|
// })
|
|
|
|
|
// END OVERLAY
|
|
|
|
|
|
|
|
|
|
// $('.product__main').on('click', '.state__button', function(evt) {
|
|
|
|
|
// evt.preventDefault();
|
|
|
|
|
// let product = $(this).closest('.product__item');
|
|
|
|
|
// let price = $(this).data('product_price');
|
|
|
|
|
// let id = $(this).data('product_id');
|
|
|
|
|
// let qty = product.find('.counter__input').val();
|
|
|
|
|
// product.find('.product-item-overlay__price').html(price * qty + ' ');
|
|
|
|
|
// product.find('.select__state').data('product_price', price).data('product_id', id).val($(this).text().trim());
|
|
|
|
|
// product.find('.state__block').removeClass('expanded').css('height', '0');
|
|
|
|
|
|
|
|
|
|
// product.find('.add_to_cart_button').detach();
|
|
|
|
|
// product.find('.product-item-overlay__button').prepend('<a href="?add-to-cart=' + id + '" data-quantity="' + qty +'" class="ajax_add_to_cart add_to_cart_button button button--gradient button--base button--100-perc" data-product_id="'+id+'">Добавить в корзину</a>');
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// $('.product__main').on('click', '.counter__button', function(evt) {
|
|
|
|
|
// evt.preventDefault();
|
|
|
|
|
// let product = $(this).closest('.product__item');
|
|
|
|
|
// let price = parseFloat(product.find('.select__state').data('product_price'));
|
|
|
|
|
|
|
|
|
|
// if (!price){
|
|
|
|
|
// price = parseFloat(product.find('.product-item__price p').html());
|
|
|
|
|
// }
|
|
|
|
|
// let qty = product.find('.counter__input');
|
|
|
|
|
|
|
|
|
|
// if ($(this).hasClass('minus') && parseInt(qty.val()) >= 2) {
|
|
|
|
|
// qty.val(parseInt(qty.val()) - 1);
|
|
|
|
|
// } else {
|
|
|
|
|
// if ($(this).hasClass('plus')) {
|
|
|
|
|
// qty.val(parseInt(qty.val()) + 1);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// product.find('.product-item-overlay__button a').attr('data-quantity', qty.val())
|
|
|
|
|
// product.find('.product-item-overlay__price').html(price * qty.val() + ' ');
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// $('.product__main').on('click', '.select__state', function(evt) {
|
|
|
|
|
// evt.preventDefault();
|
|
|
|
|
// let product = $(this).closest('.product__item'),
|
|
|
|
|
// listing = product.find('.state__block');
|
|
|
|
|
|
|
|
|
|
// if (listing.hasClass('expanded')) {
|
|
|
|
|
// listing.removeClass('expanded').css('height', '0');
|
|
|
|
|
// } else {
|
|
|
|
|
// listing.addClass('expanded').css('height', 'auto');
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// product.find('.state__block').find('.state__button').removeClass('active');
|
|
|
|
|
// product.find('.state__button').each(function () {
|
|
|
|
|
// if (product.find('.select__state').data('product_id') === $(this).data('product_id')) {
|
|
|
|
|
// $(this).addClass('active');
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// let page = 1;
|
|
|
|
|
|
|
|
|
|
// jQuery('body').on('click', '#load-more-products', function(e) {
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
// page++;
|
|
|
|
|
|
|
|
|
|
// let category = $(this).data('category_id');
|
|
|
|
|
// let category_type = $(this).data('category_type');
|
|
|
|
|
|
|
|
|
|
// $.ajax({
|
|
|
|
|
// type: 'POST',
|
|
|
|
|
// url: '/wp-admin/admin-ajax.php',
|
|
|
|
|
// dataType: 'html',
|
|
|
|
|
// data: {
|
|
|
|
|
// 'action' : 'get_products',
|
|
|
|
|
// 'get_page' : page,
|
|
|
|
|
// 'get_category' : category,
|
|
|
|
|
// 'get_category_type' : category_type,
|
|
|
|
|
// },
|
|
|
|
|
// success: function(data) {
|
|
|
|
|
// // if($('<div></div>').html(data).find('.archive__item.ended').size() > 0) $('#load-more-products').parents('.cta').remove();
|
|
|
|
|
// // else $('#load-more-products').parents('.cta').show();
|
|
|
|
|
|
|
|
|
|
// $('#load-more-products').detach();
|
|
|
|
|
// $('.product__main').append(data);
|
|
|
|
|
// $('#load-more-products').prependTo('.product__footer');
|
|
|
|
|
// },
|
|
|
|
|
// error: function(data) {
|
|
|
|
|
// console.log(data);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// $('.wpfMainWrapper').prepend('<div class="wpfFilters"></div>');
|
|
|
|
|
// $('.wpfMainWrapper').find('.wpfFilterWrapper').appendTo($('.wpfFilters'));
|
|
|
|
|
|
|
|
|
|
// $('.wpfFilterWrapper').each(function () {
|
|
|
|
|
// if ($(this).data('filter-type') === 'wpfPrice') {
|
|
|
|
|
// $(this).find('.wpfFilterContent').append('<div class="wpfExpandablePart"></div>');
|
|
|
|
|
// $(this).find('.wpfPriceFilterRange').appendTo('.wpfExpandablePart');
|
|
|
|
|
// $(this).find('.wpfPriceInputs').appendTo('.wpfExpandablePart');
|
|
|
|
|
|
|
|
|
|
// $(this).find('.wpfCurrencySymbol').detach();
|
|
|
|
|
// $(this).find('.wpfFilterDelimeter').detach();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// $('.wfpDescription').on('click', function () {
|
|
|
|
|
// $(this).closest('.wpfFilterWrapper').toggleClass('expanded').find('.wpfCheckboxHier').slideToggle();
|
|
|
|
|
// $(this).parent().find('.wpfExpandablePart').slideToggle();
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// header
|
|
|
|
|
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false); |
|
|
|
|
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white'); |
|
|
|
@ -304,50 +176,3 @@ jQuery(document).ready(function($) { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// // Находим все элементы с классом login-open
|
|
|
|
|
// document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
// const loginButtons = document.querySelectorAll('.login-open');
|
|
|
|
|
|
|
|
|
|
// loginButtons.forEach(button => {
|
|
|
|
|
// button.addEventListener('click', function(event) {
|
|
|
|
|
// event.preventDefault();
|
|
|
|
|
|
|
|
|
|
// const modal = document.querySelector('.modal');
|
|
|
|
|
// const modalAside = document.querySelector('.modal__aside');
|
|
|
|
|
// const modalLogin = document.querySelector('.modal__login');
|
|
|
|
|
|
|
|
|
|
// modal.classList.add('active');
|
|
|
|
|
// modalLogin.classList.add('active');
|
|
|
|
|
|
|
|
|
|
// // Set width and slide in from right
|
|
|
|
|
// modalAside.style.width = '20vw';
|
|
|
|
|
// modalAside.style.right = '0';
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// const closeButtons = document.querySelectorAll('.modal-close');
|
|
|
|
|
// const modal = document.querySelector('.modal');
|
|
|
|
|
|
|
|
|
|
// closeButtons.forEach(button => {
|
|
|
|
|
// button.addEventListener('click', closeModal);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// modal.addEventListener('click', function(event) {
|
|
|
|
|
// if (event.target === modal) {
|
|
|
|
|
// closeModal();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// function closeModal() {
|
|
|
|
|
// const modal = document.querySelector('.modal');
|
|
|
|
|
// const modalAside = document.querySelector('.modal__aside');
|
|
|
|
|
// const modalLogin = document.querySelector('.modal__login');
|
|
|
|
|
|
|
|
|
|
// modal.classList.remove('active');
|
|
|
|
|
// modalLogin.classList.remove('active');
|
|
|
|
|
|
|
|
|
|
// // Reset styles
|
|
|
|
|
// modalAside.style.width = '';
|
|
|
|
|
// modalAside.style.right = '-30vw';
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|