From 348c9bbf681c1c075c88325c8db36b114421deae Mon Sep 17 00:00:00 2001 From: Andrei-10 Date: Wed, 18 Jun 2025 11:12:31 +0000 Subject: [PATCH] =?UTF-8?q?Task=206807,=206831=20|=20=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D1=81=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2=20=D0=B2=20=D0=BA=D0=B0?= =?UTF-8?q?=D1=82=D0=B0=D0=BB=D0=BE=D0=B3=D0=B5=20=D0=B8=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D1=87=D0=B5=D0=BA=D0=B0?= =?UTF-8?q?=D1=83=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrei Reviewed-on: https://git.good-production.xyz/Good-Production/cosmopet-architecture/pulls/35 --- .../global-functions/core-functions.php | 1 - .../global-functions/multisite-functions.php | 157 +-- .../cosmopet/modules/forms/assets/js/form.js | 24 + .../modules/forms/module-ajax-controller.php | 11 + .../layout/assets/css/gp-style-core.css | 57 +- .../layout/assets/css/gp-style-normalize.css | 2 +- .../modules/layout/module-controller.php | 1 + .../cosmopet/modules/popup/assets/js/modal.js | 8 +- .../assets/css/gp-style-core.css | 16 +- .../assets/css/gp-style-desktop.css | 12 +- .../assets/css/gp-style-tablet.css | 4 + .../single-product/component-controller.php | 55 +- wp-content/themes/cosmopet/single-product.php | 50 +- .../_blocks/shop/archive-product-tease.twig | 39 +- .../_pages/shop/product-single.twig} | 1071 ++++++++--------- .../themes/cosmopet/templates/modal.twig | 47 +- .../cosmopet/templates/modal/to_know.twig | 48 + .../themes/cosmopet/templates/shop/index.php | 1 - .../templates/shop/single-product.php | 63 - .../woocommerce/assets/css/gp-style-core.css | 40 +- .../assets/css/gp-style-desktop.css | 1 - .../cosmopet/woocommerce/single-product.php | 19 - 22 files changed, 808 insertions(+), 919 deletions(-) rename wp-content/themes/cosmopet/{modules/shop/components/single-product/component-template.twig => templates/_pages/shop/product-single.twig} (70%) create mode 100644 wp-content/themes/cosmopet/templates/modal/to_know.twig delete mode 100644 wp-content/themes/cosmopet/templates/shop/index.php delete mode 100644 wp-content/themes/cosmopet/templates/shop/single-product.php delete mode 100644 wp-content/themes/cosmopet/woocommerce/single-product.php diff --git a/wp-content/themes/cosmopet/global-functions/core-functions.php b/wp-content/themes/cosmopet/global-functions/core-functions.php index d917072..def1230 100644 --- a/wp-content/themes/cosmopet/global-functions/core-functions.php +++ b/wp-content/themes/cosmopet/global-functions/core-functions.php @@ -260,4 +260,3 @@ $zero = '0'; // ]); // } - diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php index 6b6d4a1..153ffc2 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -167,96 +167,97 @@ if($site_env->site_mode == 'production' and $site_env->site_region == 'ae') { currency: currency }); - // Событие для Google Analytics - window.dataLayer = window.dataLayer || []; - window.dataLayer.push({ - 'event': 'add_to_cart', - 'ecommerce': { - 'currency': currency, - 'value': parseFloat(priceElement) * quantity, - 'items': [{ - 'item_id': productId, - 'item_name': productName, - 'price': parseFloat(priceElement), - 'quantity': quantity - }] - } - }); + // Событие для Google Analytics + window.dataLayer = window.dataLayer || []; + window.dataLayer.push({ + 'event': 'add_to_cart', + 'ecommerce': { + 'currency': currency, + 'value': parseFloat(priceElement) * quantity, + 'items': [{ + 'item_id': productId, + 'item_name': productName, + 'price': parseFloat(priceElement), + 'quantity': quantity + }] + } }); }); }); - - + get_status() !== 'processing' && $order->get_status() !== 'completed')) return; - - $items = []; - foreach ($order->get_items() as $item) { - $product = $item->get_product(); - $items[] = [ - 'item_id' => $product->get_id(), - 'item_name' => $product->get_name(), - 'price' => $product->get_price(), - 'quantity' => $item->get_quantity() - ]; - } - ?> - - + cart ? WC()->cart->get_total('edit') : 0; - ?> - - + { modalOpen('.basket-open', '.modal__basket'); modalOpen('.open-to-know', '.modal__to-know'); modalOpen('.login-open', '.modal__login'); - modalClose('.modal__close'); -}); \ No newline at end of file + modalClose('.modal__close, .m__close'); +}); + +jQuery('[data-pname]').on('click', function(){ + jQuery('#sub_product_name').val(jQuery(this).data('pname')) +}) \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css index c3fd1d3..b67ddfe 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css +++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css @@ -951,6 +951,7 @@ button{ display: flex; align-items: start; + flex-wrap: wrap; } .compound__item{ margin: 5px; @@ -1083,18 +1084,17 @@ button{ } .to-know{ /* width: 100%; */ - - padding: 12px 24px 7px 24px; - - display: flex; - justify-content: center; - border: none; - transition: opacity .2s ease-out; text-decoration: none; + text-transform: uppercase; +} +.product__item .to-know{ + margin-right: auto; + margin-left: auto; + width: auto; + display: flex; } - .to-know--start{ justify-content: start; padding-left: 0; diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css index 8900568..296f30f 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css +++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css @@ -553,7 +553,6 @@ main{ font-size: 20px; line-height: 200%; text-transform: uppercase; - color: var(--text-black); } .product-item__price p::after{ @@ -593,8 +592,8 @@ main{ .product__item.hiding .product-item__images{ filter: grayscale(1) } - .product__item.hiding .product-item__price{ - color: var(--text-grey); + .product__item.hiding .product-item__price p{ + color: #999; } .product-item__overlay{ position: absolute; @@ -843,6 +842,7 @@ main{ } .detail__image--width-perc-100{ width: calc(100% - 24px); + height: 600px; } @@ -1061,6 +1061,12 @@ main{ .detail__catalot .product__item{ width: calc(100% - 24px); } + +@media (max-width: 640px) { + .detail__catalot .product__item{ + width: calc(100%); +} +} .detail__images-phone{ display: none; } diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css index e59949c..ceab514 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css +++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-tablet.css @@ -1,5 +1,9 @@ /* Стили для планшетов */ @media only screen and (max-width: 1200px) { + + .product__main{ + margin: 36px 0 0; + } /* header */ main{ padding-top: 64px; diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php index e635834..ecca9fc 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php +++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php @@ -1,11 +1,6 @@ is_type('variable') $product; $product_type; $context_for_twig; @@ -103,3 +98,53 @@ add_filter('timber/context', function ($context) use ($context_for_twig) { return array_merge($context, $context_for_twig); }); + + + $context = Timber::get_context(); + $post = Timber::get_post(); + $context['post'] = $post; + + $context['wc_breadcrumbs'] = array(); + + if (function_exists('woocommerce_breadcrumb')) { + $args = array( + 'delimiter' => '', + 'wrap_before' => '', + 'wrap_after' => '', + 'before' => '', + 'after' => '', + 'home' => _x('Home', 'breadcrumb', 'woocommerce'), + ); + + $breadcrumbs = new WC_Breadcrumb(); + $breadcrumbs->generate(); + + $formatted_breadcrumbs = array(); + foreach ($breadcrumbs->get_breadcrumb() as $crumb) { + $formatted_breadcrumbs[] = array( + 'text' => $crumb[0], + 'url' => $crumb[1] + ); + } + + $context['wc_breadcrumbs'] = $formatted_breadcrumbs; + } + + $product_id = get_the_ID(); + $product = wc_get_product($product_id); + + $context['product'] = $product; + + $context['related_products'] = array(); + $related_products_ids = wc_get_related_products($product_id, 5); + + if ($related_products_ids) { + foreach ($related_products_ids as $related_id) { + $related_product = wc_get_product($related_id); + if ($related_product) { + $context['related_products'][] = $related_product; + } + } + } + + Timber::render('_pages/shop/product-single.twig', $context); \ No newline at end of file diff --git a/wp-content/themes/cosmopet/single-product.php b/wp-content/themes/cosmopet/single-product.php index ad3e75f..8cbab0e 100644 --- a/wp-content/themes/cosmopet/single-product.php +++ b/wp-content/themes/cosmopet/single-product.php @@ -8,53 +8,5 @@ if (is_product()) { include_module('shop'); include_component('shop', 'single-product'); - - $context = Timber::get_context(); - $post = Timber::get_post(); - $context['post'] = $post; - - $context['wc_breadcrumbs'] = array(); - - if (function_exists('woocommerce_breadcrumb')) { - $args = array( - 'delimiter' => '', - 'wrap_before' => '', - 'wrap_after' => '', - 'before' => '', - 'after' => '', - 'home' => _x('Home', 'breadcrumb', 'woocommerce'), - ); - - $breadcrumbs = new WC_Breadcrumb(); - $breadcrumbs->generate(); - - $formatted_breadcrumbs = array(); - foreach ($breadcrumbs->get_breadcrumb() as $crumb) { - $formatted_breadcrumbs[] = array( - 'text' => $crumb[0], - 'url' => $crumb[1] - ); - } - - $context['wc_breadcrumbs'] = $formatted_breadcrumbs; - } - - $product_id = get_the_ID(); - $product = wc_get_product($product_id); - - $context['product'] = $product; - - $context['related_products'] = array(); - $related_products_ids = wc_get_related_products($product_id, 5); - - if ($related_products_ids) { - foreach ($related_products_ids as $related_id) { - $related_product = wc_get_product($related_id); - if ($related_product) { - $context['related_products'][] = $related_product; - } - } - } - - Timber::render('modules/shop/components/single-product/component-template.twig', $context); + } \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig index 6ec9d5e..52f7945 100644 --- a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig +++ b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig @@ -2,8 +2,9 @@ {% set cur_product = fn('wc_get_product', post.id) %} {% set attrs = post.product.get_attributes() %} {% set cur_weight = function('get_product_info', post.id, 'weight') %} - -
+ {% set stock_status = post.meta('_stock_status') == 'instock' %} + +
{% if post.date('Y-m-d') >= criteria_for_new_product %} @@ -22,18 +23,46 @@
+ {% set for_whom = fn('wc_get_product_terms', post.id, 'pa_for-whom') %} + {% for option in for_whom %} + {% set term = get_term(option) %} + {{ term.name }} + {% endfor %} {% set compound = fn('wc_get_product_terms', post.id, 'pa_compound') %} {% for option in compound %} - {% set term = get_term(option) %} {{ term.name }} {% endfor %} + + {% set package_weight = fn('wc_get_product_terms', post.id, 'pa_package-weight') %} + {% for option in package_weight %} + {% set term = get_term(option) %} + {{ term.name }} + {% endfor %} + {% set features = fn('wc_get_product_terms', post.id, 'pa_features') %} + {% for option in features %} + + {% set term = get_term(option) %} + {{ term.name }} + {% endfor %} + +
{{ post.title }}
-

{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}

+

{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}

+ + {% if post._regular_price() and post._regular_price() > post._price() %} +
+

+ {{ post._regular_price() }} {{ fn('get_woocommerce_currency_symbol') }} +

+

+ - {{ ((1 - post._price() / post._regular_price()) * 100)|round(0, 'floor') }} % +

+
+ {% endif %}
- {% set stock_status = post.meta('_stock_status') == 'instock' %} {% if stock_status == 'instock' %}
- - -
-
-
- {% for related_product in related_products %} -
- {% set post_id = related_product.ID is defined ? related_product.ID : related_product %} - {% set wc_product = fn('wc_get_product', post_id) %} - {% if wc_product %} -
-
- {% if wc_product.get_date_created|date('Y-m-d') >= criteria_for_new_product %} - - {{ function('pll_e', 'Новинка') }} - - {% endif %} - - {% if is_subscription %} - - {{ function('pll_e', 'Распродажа %') }} - - {% endif %} -
- - {{ wc_product.get_name() }} - -
-
- {% set compound = fn('wc_get_product_terms', post_id, 'pa_compound') %} - {% for option in compound %} - {% set term = get_term(option) %} - {{ term.name }} - {% endfor %} -
- {{ wc_product.get_name() }} -
-

{{ wc_product.get_price() }} {{ fn('get_woocommerce_currency_symbol') }}

-
-
- -
-
-
-
- {{ wc_product.get_name() }} -
    - {% set features = fn('wc_get_product_terms', post_id, 'pa_features') %} - {% for option in features %} - {% set term = get_term(option) %} -
  • {{ term.name }}
  • - {% endfor %} -
-
- -
-
-
-

Объем

- -
- {% set cur_weight = function('get_product_info', post_id, 'weight') %} - -
-
    - {% set collection = fn('wc_get_product_terms', post_id, 'pa_collection') %} - {% for option in collection %} - {% set term = get_term(option) %} - {% if term %} - {% set siblings = function('get_collection_siblings', term.term_id) %} - - {% for sibling in siblings %} - {% set weight = function('get_product_info', sibling.ID, 'weight') %} - - {% set class = '' %} - {% if weight == cur_weight %} - {% set class = 'active' %} - {% endif %} -
  • - -
  • - {% endfor %} - {% endif %} - {% endfor %} -
-
-
-
-
-

Количество

- -
- - - -
-
-
-

- {{ wc_product.get_price() }} -

-
-
- {{ function('get_add_to_cart_button', post_id) }} -
- -
-
-
-
- {% endif %} -
- {% endfor %} -
-
-
- {% endif %} -
- - - - - - +{% set current_path = template_path ~ '/modules/shop/components/single-product' %} +{% set bodyClass = 'bg-white' %} +{% set mainClass = 'wrapper' %} +{% extends 'layout.twig' %} + +{% block content %} +
+ + + + {{ function('pll_e', 'к каталогу') }} + + +
+
+ {% for image in gallery_images %} +
+ {{ image.alt }} +
+ {% endfor %} +
+
+ +
+ + {# Start | Теги = категории #} +
+
+ {% for tag in product_tags %} +
+ {{ tag }} +
+ {% endfor %} + + {% if product_attributes.Flavor is defined and product_attributes.Flavor|length > 0 %} +
+ {{ product_attributes.Flavor[0].name }} +
+ {% endif %} + {% if product_attributes.Вкус is defined and product_attributes.Вкус|length > 0 %} + + {% endif %} + + {% if product_attributes.Тег is defined and product_attributes.Тег|length > 0 %} + + {% endif %} + +
+ {% if product.is_on_sale %} +
+ {{ function('pll_e', 'Распродажа %') }} +
+ {% endif %} +
+ {# End | Теги = категории #} + +

+ {{ product.get_title }} +

+ +
+
+ {% for image in gallery_images %} +
+
+ {{ image.alt }} +
+
+ {% endfor %} +
+
+
+ + {# Start | Цена для неподписочного товара #} + {% if product.get_price %} +
+ {% if is_subscription %} + {% if product.get_regular_price %} +
+

+ {{ product.get_regular_price }} {{ fn('get_woocommerce_currency_symbol') }} +

+

+ {{ ((product.get_regular_price - product.get_price) / product.get_regular_price * 100)|round }} +

+
+ {% else %} + не задана цена по подписке + {% endif %} + {% else %} +

+ {{ product.get_price }} {{ fn('get_woocommerce_currency_symbol') }} + {% if product.is_on_sale %} + +

+

+ {{ product.get_regular_price }} {{ fn('get_woocommerce_currency_symbol') }} +

+

+ {% set discount = ((product.get_regular_price - product.get_sale_price) / product.get_regular_price * 100)|round(0, 'floor') %} + {{ discount }} +

+
+ {% endif %} +

+ {% endif %} +
+ {% endif %} + {# End | Цена для неподписочного товара #} + + {# Start | Кнопка добавить в корзину + варинанты подписки на товар #} +
+ {% set collection = fn('wc_get_product_terms', product.id, 'pa_collection') %} + {% if collection %} + {% set siblings = function('get_collection_siblings', collection[0].term_id) %} + {% if siblings %} +
+ {% for sibling in siblings %} + {% set weight = function('get_product_info', sibling.ID, 'weight') %} + {% set current_weight = function('get_product_info', product.id, 'weight') %} + {% set class = weight == current_weight ? 'active' : '' %} + + + {{ weight|upper }} + + {% endfor %} + +
+ {% endif %} + {% endif %} +
+ + {% if product.in_stock %} + + {{ function('do_action', 'woocommerce_' ~ product.get_type() ~ '_add_to_cart') }} + {# Start | Вывод кнопки узнать о поступлении если товара нет в наличии #} + {% else %} +
+ +
+ {% endif %} + {# End | Вывод кнопки узнать о поступлении если товара нет в наличии #} + {# End | Кнопка добавить в корзину + варинанты подписки на товар #} + + {# Start | Табы с информацией #} +
+ + {# Start | Описание товара #} +
+

+ {{ function('pll_e', 'ОПИСАНИЕ') }} +

+
+
+

+ {{ product.get_description() }} +

+
+
+
+ {# End | Описание товара #} + + {# Start | Состав товара #} + {% if product_meta.composition %} +
+

+ {{ function('pll_e', 'СОСТАВ') }} +

+
+
+

+ {{ product_meta.composition }} +

+
+
+
+ {% endif %} + {# End | Состав товара #} + + {# Start | Рекомендации по кормлению #} + {% if product_meta.feeding_recommendations_table %} +
+

+ {{ function('pll_e', 'РЕКОМЕНДАЦИИ ПО КОРМЛЕНИЮ') }} +

+
+
+ + + + + + + {% if product_meta.feeding_recommendations_table.header is defined %} + + + {% for col in product_meta.feeding_recommendations_table.header %} + + {% endfor %} + + + {% endif %} + + {% for row in product_meta.feeding_recommendations_table.body %} + + {% for cell in row %} + + {% endfor %} + + {% endfor %} + +
{{ col.c }}
+

{{ cell.c }}

+
+
+ + + + + {# Старая таблица #} + {#
+ {% if product_meta.feeding_recommendations_table.header %} +
+

{{ product_meta.feeding_recommendations_table.header.0 is iterable ? product_meta.feeding_recommendations_table.header.0|join(', ') : product_meta.feeding_recommendations_table.header.0 }}

+ {% for row in product_meta.feeding_recommendations_table.body %} +
+

{{ row.0 is iterable ? row.0|join(', ') : row.0 }}

+
+
+ {% endfor %} +
+
+

{{ product_meta.feeding_recommendations_table.header.1 is iterable ? product_meta.feeding_recommendations_table.header.1|join(', ') : product_meta.feeding_recommendations_table.header.1 }}

+ {% for row in product_meta.feeding_recommendations_table.body %} +
+

{{ row.1 is iterable ? row.1|join(', ') : row.1 }}

+
+
+ {% endfor %} +
+
+

{{ product_meta.feeding_recommendations_table.header.2 is iterable ? product_meta.feeding_recommendations_table.header.2|join(', ') : product_meta.feeding_recommendations_table.header.2 }}

+ {% for row in product_meta.feeding_recommendations_table.body %} +
+

{{ row.2 is iterable ? row.2|join(', ') : row.2 }}

+
+ {% endfor %} +
+ {% endif %} +
#} + + +
+
+
+ {% elseif product_meta.feeding_recommendations %} +
+

+ {{ function('pll_e', 'РЕКОМЕНДАЦИИ ПО КОРМЛЕНИЮ') }} +

+
+
+ {{ product_meta.feeding_recommendations }} +
+
+
+ {% endif %} + {# End | Рекомендации по кормлению #} + + {% if product_meta.nutritional_value or product_meta.vitamins or product_meta.additives or product_meta.energy_value %} +
+

+ {{ function('pll_e', 'ПИЩЕВАЯ ЦЕННОСТЬ') }} +

+
+
+ {% if product_meta.nutritional_value and product_meta.vitamins %} +
+
+

{{ function('pll_e', 'ПИЩЕВАЯ ЦЕННОСТЬ') }}

+ {{ product_meta.nutritional_value }} +
+
+

{{ function('pll_e', 'ВИТАМИНЫ НА КГ') }}

+ {{ product_meta.vitamins }} +
+
+ {% endif %} + + {% if product_meta.additives or product_meta.energy_value %} +
+ {% if product_meta.additives %} +
+

{{ function('pll_e', 'ПИТАТЕЛЬНЫЕ ДОБАВКИ НА КГ') }}

+ {{ product_meta.additives }} +
+ {% endif %} + + {% if product_meta.energy_value %} +
+

{{ function('pll_e', 'ЭНЕРГЕТИЧЕСКАЯ ЦЕННОСТЬ НА 100 ГРАММ') }}

+
+
+
+

{{ product_meta.energy_value }}

+
+
+
+
+ {% endif %} +
+ {% endif %} +
+
+
+ {% endif %} +
+ {# End | Табы с информацией #} + + {% if product_meta.important %} +
+
+

{{ function('pll_e', 'Важно') }}

+

+ {{ product_meta.important }} +

+
+
+ {% endif %} +
+ +
+ {% set recommended_products = function('get_field', 'recommended_products', product.id) %} + {% set related_products = recommended_products ? recommended_products : function('wc_get_related_products', product.id, 4) %} + {% if related_products %} +
+
+
+

+ {{ function('pll_e', 'вашему питомцу может понравиться') }} +

+ +
+ + + +
+
+
+ {% for related_product in related_products %} +
+ {% set post_id = related_product.ID is defined ? related_product.ID : related_product %} + {% set wc_product = fn('wc_get_product', post_id) %} + {% if wc_product %} + {% include '_blocks/shop/archive-product-tease.twig' with {post: wc_product} %} + {% endif %} +
+ {% endfor %} +
+
+
+ {% endif %} +
+
+ + + + +
{% endblock %} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/modal.twig b/wp-content/themes/cosmopet/templates/modal.twig index b1dd851..c924119 100644 --- a/wp-content/themes/cosmopet/templates/modal.twig +++ b/wp-content/themes/cosmopet/templates/modal.twig @@ -16,52 +16,7 @@ {% include 'modal/basket.twig' %} - - - + {% include 'modal/to_know.twig' %} {% include 'modal/login.twig' %} diff --git a/wp-content/themes/cosmopet/templates/modal/to_know.twig b/wp-content/themes/cosmopet/templates/modal/to_know.twig new file mode 100644 index 0000000..85b356c --- /dev/null +++ b/wp-content/themes/cosmopet/templates/modal/to_know.twig @@ -0,0 +1,48 @@ + + + \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/shop/index.php b/wp-content/themes/cosmopet/templates/shop/index.php deleted file mode 100644 index d800886..0000000 --- a/wp-content/themes/cosmopet/templates/shop/index.php +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/shop/single-product.php b/wp-content/themes/cosmopet/templates/shop/single-product.php deleted file mode 100644 index 59884cb..0000000 --- a/wp-content/themes/cosmopet/templates/shop/single-product.php +++ /dev/null @@ -1,63 +0,0 @@ - '', - 'wrap_before' => '', - 'wrap_after' => '', - 'before' => '', - 'after' => '', - 'home' => _x('Home', 'breadcrumb', 'woocommerce'), - ); - - $breadcrumbs = new WC_Breadcrumb(); - $breadcrumbs->generate(); - - $formatted_breadcrumbs = array(); - foreach ($breadcrumbs->get_breadcrumb() as $crumb) { - $formatted_breadcrumbs[] = array( - 'text' => $crumb[0], - 'url' => $crumb[1] - ); - } - - $context['wc_breadcrumbs'] = $formatted_breadcrumbs; - } - - - $product_id = get_the_ID(); - $product = wc_get_product($product_id); - - $context['product'] = $product; - - $context['related_products'] = array(); - $related_products_ids = wc_get_related_products($product_id, 5); - - if ($related_products_ids) { - foreach ($related_products_ids as $related_id) { - $related_product = wc_get_product($related_id); - if ($related_product) { - $context['related_products'][] = $related_product; - } - } - } - - Timber::render('modules/shop/components/single-product/component-template.twig', $context); -} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-core.css index 795d1f4..69d38bd 100644 --- a/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-core.css +++ b/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-core.css @@ -876,8 +876,7 @@ button{ width: 16px; aspect-ratio: 1; - - background-image: url(../img/svg/main/arrow-selected-white.svg); + background-image: url(../../static/img/svg/main/arrow-selected-white.svg); background-repeat: no-repeat; background-position: center; } @@ -1258,7 +1257,7 @@ button{ .wpfFilterContent ul li input[type="checkbox"]:checked { background-color: var(--background-black); - background-image: url(../img/svg/main/arrow-selected-white.svg); + background-image: url(../../static/img/svg/main/arrow-selected-white.svg); background-repeat: no-repeat; background-position: center; } @@ -1305,4 +1304,39 @@ button{ background: none; } +.compound{ + flex-wrap: wrap; +} + +.product__item.hiding .product-item__price p { + color: #999; +} + + +.product-item__price-disc, .product-item__price { + display: flex; + align-items: center; + gap: 20px; +} + +.product-item__price-disc, .product-item__price{ + display: flex; + align-items: center; + gap: 20px; +} + +.product-item__price-sale__perc{ +font-size: 20px; +text-transform: uppercase; +color: #FA0505; + +} +.product-item__price-sale__text { + text-decoration: line-through; + color: #999999; + font-size: 18px; +} +.product-item__price-sale__perc::after{ +display: none; +} diff --git a/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-desktop.css b/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-desktop.css index 5a3192c..1e5bc2a 100644 --- a/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-desktop.css +++ b/wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-desktop.css @@ -545,7 +545,6 @@ main{ font-size: 20px; line-height: 200%; text-transform: uppercase; - color: var(--text-black); } /* .product-item__price p::after{ content: '₽'; diff --git a/wp-content/themes/cosmopet/woocommerce/single-product.php b/wp-content/themes/cosmopet/woocommerce/single-product.php deleted file mode 100644 index 16272d7..0000000 --- a/wp-content/themes/cosmopet/woocommerce/single-product.php +++ /dev/null @@ -1,19 +0,0 @@ -