diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 9210656..4b71c88 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -501,7 +501,7 @@ function get_products() { $context['get_category_type'] = isset($_POST['get_category_type']) ? $_POST['get_category_type'] : NULL; // Задаем количество постов для подзагрузки Ajax - $posts_per_page = 1; + $posts_per_page = 12; $args = array( 'post_type' => 'product', @@ -546,7 +546,9 @@ function get_products() { $context['count'] = count(Timber::get_posts($count_args)); - if ($context['count'] <= $context['get_page'] * 1) $context['ended'] = true; + if ($context['count'] <= $context['get_page'] * $posts_per_page) { + $context['ended'] = true; + } Timber::render( 'woocommerce/archive-product/archive-product-ajaxload.twig', $context ); diff --git a/wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css b/wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css index f9f3988..054aca4 100644 --- a/wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css +++ b/wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css @@ -731,26 +731,26 @@ width: 0px; -.mini-profile__button--counter{ - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - padding: 2px; - position: absolute; - background: var(--gradient-turquoise); - border-radius: 10px; - width: 16px; - height: 16px; - - border-radius: 50%; - top: 6px; - right: 6px; - font-style: normal; - font-weight: 700; - font-size: 9px; - line-height: 16px; - color: #121212; +.mini-profile__button--counter { + display: flex +; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 2px; + position: absolute; + background: var(--gradient-turquoise); + border-radius: 10px; + width: 16px; + height: 16px; + border-radius: 50%; + right: 30px; + bottom: 20px; + font-style: normal; + font-weight: 700; + font-size: 9px; + line-height: 16px; + color: #121212; } .mini-profile__button--counter.disabled{ diff --git a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js index 2338e28..a46047a 100644 --- a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js +++ b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js @@ -22,13 +22,17 @@ jQuery(document).ready(function ($) { product.find('.state__block').removeClass('expanded').css('height', '0'); product.find('.add_to_cart_button').detach(); - product.find('.product-item-overlay__button').prepend('Добавить в корзину'); + product.find('.product-item-overlay__button').prepend('Добавить в корзину'); }) $('.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) { @@ -38,7 +42,7 @@ jQuery(document).ready(function ($) { 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() + ' '); }) diff --git a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js index bb96745..4d94394 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js +++ b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js @@ -39,7 +39,7 @@ jQuery(document).ready(function($) { input.val(quantity).trigger('change'); }); - $(document).on('click', '.remove-item', function() { + $(document).on('click', '.remove-item', function() { const key = $(this).data('key'); removeItem(key); }); @@ -266,11 +266,18 @@ jQuery(document).ready(function($) { if (response.success) { $('#modal-basket-content').html(response.data.contents); $('.modal-block-price__price').html(response.data.total); - $('.cart-count').text(response.data.count); - + $('.mini-profile__button--counter').text(response.data.count); + if(response.data.count > 0){ + $('.mini-profile__button--counter').removeClass('disabled') + } + else( + $('.mini-profile__button--counter').addClass('disabled') + ) } } }); } -}); \ No newline at end of file +}); + + diff --git a/wp-content/themes/cosmopet/modules/shop/components/cart/component-controller.php b/wp-content/themes/cosmopet/modules/shop/components/cart/component-controller.php index bfad3cb..2a423c1 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/cart/component-controller.php +++ b/wp-content/themes/cosmopet/modules/shop/components/cart/component-controller.php @@ -1,8 +1,13 @@ cart->get_cart_contents_count(); + return $context; +}); \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/header.twig b/wp-content/themes/cosmopet/templates/header.twig index 2c03b5e..a36322f 100644 --- a/wp-content/themes/cosmopet/templates/header.twig +++ b/wp-content/themes/cosmopet/templates/header.twig @@ -232,8 +232,8 @@ diff --git a/wp-content/themes/cosmopet/woocommerce/archive-product.php b/wp-content/themes/cosmopet/woocommerce/archive-product.php index b4ed0c0..895e8c6 100644 --- a/wp-content/themes/cosmopet/woocommerce/archive-product.php +++ b/wp-content/themes/cosmopet/woocommerce/archive-product.php @@ -13,7 +13,7 @@ $context['criteria_for_new_product'] = date('Y-m-d', strtotime('-30 days')); // Задаем количество постов для подзагрузки Ajax - $context['posts_per_page'] = 1; + $context['posts_per_page'] = 12; $queried_object = get_queried_object(); diff --git a/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product-tease.twig b/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product-tease.twig index 306fa6e..6678af7 100644 --- a/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product-tease.twig +++ b/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product-tease.twig @@ -6,13 +6,13 @@
{% if post.date('Y-m-d') >= criteria_for_new_product %} - + {{ function('pll_e', 'Новинка') }} {% endif %} {% if post._sale_price %} - + {{ function('pll_e', 'Распродажа %') }} {% endif %} @@ -53,14 +53,16 @@
+ {% set collection = fn('wc_get_product_terms', post.id, 'pa_collection') %} + {% if collection %}
-

Объем

- +

{{ fn('pll_e', 'Объем') }}

+
    - {% set collection = fn('wc_get_product_terms', post.id, 'pa_collection') %} + {% for option in collection %} {% set term = get_term(option) %} {% set siblings = function('get_collection_siblings' , term.id) %} @@ -84,8 +86,9 @@
+ {% endif %}
-

Количество

+

{{ fn('pll_e', 'Количество') }}

- -
- - -
-
- - - - - -
-
-
- - -
- -
- -
- - - - - -
- - - -
- - diff --git a/wp-content/themes/cosmopet/woocommerce/cart/cross-sells.php b/wp-content/themes/cosmopet/woocommerce/cart/cross-sells.php deleted file mode 100644 index c7a7c53..0000000 --- a/wp-content/themes/cosmopet/woocommerce/cart/cross-sells.php +++ /dev/null @@ -1,57 +0,0 @@ - - -
- - -

- - - apply_filters( 'woodmart_cross_sells_products_per_view', 4 ), - 'hide_pagination_control' => true, - 'hide_prev_next_buttons' => true, - 'img_size' => 'woocommerce_thumbnail', - 'custom_sizes' => apply_filters( 'woodmart_cross_sells_custom_sizes', false ), - 'product_quantity' => woodmart_get_opt( 'product_quantity' ), - 'products_bordered_grid' => woodmart_get_opt( 'products_bordered_grid' ), - 'products_bordered_grid_style' => woodmart_get_opt( 'products_bordered_grid_style' ), - 'products_with_background' => woodmart_get_opt( 'products_with_background' ), - 'products_shadow' => woodmart_get_opt( 'products_shadow' ), - 'products_color_scheme' => woodmart_get_opt( 'products_color_scheme' ), - ); - - woodmart_set_loop_prop( 'products_view', 'carousel' ); - - echo woodmart_generate_posts_slider( $slider_args, false, $cross_sells ); - - ?> - -
- - - -
-
- - cart->is_empty() ) : ?> - - - - - -
-

- 0 ) : ?> - - - - -
- - - -
-
- -
- cart->is_empty() ) : ?> - - version, '3.7.0', '<' ) ) : ?> -

: cart->get_cart_subtotal(); ?>

- -

- -

- - - - -

- - - - - - -