From 79ea13566ac449d1923bd25064549372335c9277 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 7 Jun 2025 02:46:56 +0300 Subject: [PATCH 1/4] =?UTF-8?q?Fix=20|=20=D0=B1=D1=8B=D0=BB=D0=B0=20=D1=84?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=BB=D0=B8=D0=BA=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BB=D0=B8=D1=8F=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global-functions/multilang-functions.php | 79 +++++++++++-------- .../global-functions/multisite-functions.php | 2 +- .../templates/front-page/front-page.twig | 7 +- .../themes/cosmopet/templates/layout.twig | 74 ++++++++--------- 4 files changed, 84 insertions(+), 78 deletions(-) diff --git a/wp-content/themes/cosmopet/global-functions/multilang-functions.php b/wp-content/themes/cosmopet/global-functions/multilang-functions.php index f7ff4b3..474529e 100644 --- a/wp-content/themes/cosmopet/global-functions/multilang-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multilang-functions.php @@ -48,6 +48,15 @@ add_action('init', function () { ], 'group' => 'General', ], + [ + 'name' => 'Заголовок (скрытый) H1 на главной', + 'string' => 'КОРМ БУДУЩЕГО ДЛЯ ВАШЕГО ПИТОМЦА', + 'translations' => [ + 'ru' => 'КОРМ БУДУЩЕГО ДЛЯ ВАШЕГО ПИТОМЦА', + 'en' => 'FOOD OF THE FUTURE FOR YOUR PET', + ], + 'group' => 'General', + ], [ 'name' => 'НАПИШИТЕ НАМ', 'string' => 'НАПИШИТЕ НАМ', @@ -1489,39 +1498,39 @@ add_action('init', function () { } pll_register_string('Подписка от', 'Подписка от', 'Theme'); - pll_register_string('Сумма:', 'Сумма:', 'Theme'); - pll_register_string('Следующий платеж:', 'Следующий платеж:', 'Theme'); - pll_register_string('Нет', 'Нет', 'Theme'); - pll_register_string('Детали подписки', 'Детали подписки', 'Theme'); - pll_register_string('Детали недоступны', 'Детали недоступны', 'Theme'); - pll_register_string('У вас нет активных подписок.', 'У вас нет активных подписок.', 'Theme'); - pll_register_string('Перейти в профиль', 'Перейти в профиль', 'Theme'); - pll_register_string('Заказы', 'Заказы', 'Theme'); - pll_register_string('Подписки', 'Подписки', 'Theme'); - pll_register_string('Подписка №', 'Подписка №', 'Theme'); - pll_register_string('Статус', 'Статус', 'Theme'); - pll_register_string('Дата подписки', 'Дата подписки', 'Theme'); - pll_register_string('Дата последнего заказа', 'Дата последнего заказа', 'Theme'); - pll_register_string('Следующий платеж', 'Следующий платеж', 'Theme'); - pll_register_string('Способ оплаты', 'Способ оплаты', 'Theme'); - pll_register_string('Товары:', 'Товары:', 'Theme'); - pll_register_string('Сумма', 'Сумма', 'Theme'); - pll_register_string('месяц', 'месяц', 'Theme'); - pll_register_string('Доставка', 'Доставка', 'Theme'); - pll_register_string('Бесплатно', 'Бесплатно', 'Theme'); - pll_register_string('Итого', 'Итого', 'Theme'); - pll_register_string('Доставка:', 'Доставка:', 'Theme'); - pll_register_string('Адрес доставки', 'дрес доставки', 'Theme'); - pll_register_string('Начните вводить адрес', 'ачните вводить адрес', 'Theme'); - pll_register_string('Адрес введен неверно', 'Адрес введен неверно', 'Theme'); - pll_register_string('Комментарий для доставки', 'Комментарий для доставки', 'Theme'); - pll_register_string('Для службы доставки', 'Для службы доставки', 'Theme'); - pll_register_string('Комментарий введен неверно', 'Комментарий введен неверно', 'Theme'); - pll_register_string('Отменить подписку', 'Отменить подписку', 'Theme'); - pll_register_string('Подписка не найдена.', 'Подписка не найдена.', 'Theme'); - pll_register_string('Перейти в профиль', 'Перейти в профиль', 'Theme'); - pll_register_string('Заказы', 'Заказы', 'Theme'); - pll_register_string('Подписки', 'Подписки', 'Theme'); - pll_register_string('Не указан', 'Не указан', 'Theme'); - pll_register_string('месяц', 'месяц', 'Theme'); + pll_register_string('Сумма:', 'Сумма:', 'Theme'); + pll_register_string('Следующий платеж:', 'Следующий платеж:', 'Theme'); + pll_register_string('Нет', 'Нет', 'Theme'); + pll_register_string('Детали подписки', 'Детали подписки', 'Theme'); + pll_register_string('Детали недоступны', 'Детали недоступны', 'Theme'); + pll_register_string('У вас нет активных подписок.', 'У вас нет активных подписок.', 'Theme'); + pll_register_string('Перейти в профиль', 'Перейти в профиль', 'Theme'); + pll_register_string('Заказы', 'Заказы', 'Theme'); + pll_register_string('Подписки', 'Подписки', 'Theme'); + pll_register_string('Подписка №', 'Подписка №', 'Theme'); + pll_register_string('Статус', 'Статус', 'Theme'); + pll_register_string('Дата подписки', 'Дата подписки', 'Theme'); + pll_register_string('Дата последнего заказа', 'Дата последнего заказа', 'Theme'); + pll_register_string('Следующий платеж', 'Следующий платеж', 'Theme'); + pll_register_string('Способ оплаты', 'Способ оплаты', 'Theme'); + pll_register_string('Товары:', 'Товары:', 'Theme'); + pll_register_string('Сумма', 'Сумма', 'Theme'); + pll_register_string('месяц', 'месяц', 'Theme'); + pll_register_string('Доставка', 'Доставка', 'Theme'); + pll_register_string('Бесплатно', 'Бесплатно', 'Theme'); + pll_register_string('Итого', 'Итого', 'Theme'); + pll_register_string('Доставка:', 'Доставка:', 'Theme'); + pll_register_string('Адрес доставки', 'дрес доставки', 'Theme'); + pll_register_string('Начните вводить адрес', 'ачните вводить адрес', 'Theme'); + pll_register_string('Адрес введен неверно', 'Адрес введен неверно', 'Theme'); + pll_register_string('Комментарий для доставки', 'Комментарий для доставки', 'Theme'); + pll_register_string('Для службы доставки', 'Для службы доставки', 'Theme'); + pll_register_string('Комментарий введен неверно', 'Комментарий введен неверно', 'Theme'); + pll_register_string('Отменить подписку', 'Отменить подписку', 'Theme'); + pll_register_string('Подписка не найдена.', 'Подписка не найдена.', 'Theme'); + pll_register_string('Перейти в профиль', 'Перейти в профиль', 'Theme'); + pll_register_string('Заказы', 'Заказы', 'Theme'); + pll_register_string('Подписки', 'Подписки', 'Theme'); + pll_register_string('Не указан', 'Не указан', 'Theme'); + pll_register_string('месяц', 'месяц', 'Theme'); }); \ No newline at end of file diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php index fc61e14..a42c7d5 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -426,4 +426,4 @@ function woocommerce_ajax_add_to_cart() { } wp_die(); -} \ No newline at end of file +}} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/front-page/front-page.twig b/wp-content/themes/cosmopet/templates/front-page/front-page.twig index 3c26e10..6eba74f 100644 --- a/wp-content/themes/cosmopet/templates/front-page/front-page.twig +++ b/wp-content/themes/cosmopet/templates/front-page/front-page.twig @@ -6,11 +6,8 @@ {% block content %}
-<<<<<<< HEAD -

КОРМ БУДУЩЕГО ДЛЯ ВАШЕГО ПИТОМЦА

-======= -

FOOD OF THE FUTURE FOR YOUR PET

->>>>>>> web_87 +

{{ function('pll_e', 'Заголовок (скрытый) H1 на главной') }}

+
diff --git a/wp-content/themes/cosmopet/templates/layout.twig b/wp-content/themes/cosmopet/templates/layout.twig index 1c7e40b..6f7329d 100644 --- a/wp-content/themes/cosmopet/templates/layout.twig +++ b/wp-content/themes/cosmopet/templates/layout.twig @@ -2,7 +2,9 @@ - {{ function('wp_head') }} + + {{ function('wp_head') }} + {{ function('wp_title') }} @@ -23,55 +25,54 @@ - - + + {# RU - счетчик #} + ym(96481053, "init", { + clickmap:true, + trackLinks:true, + accurateTrackBounce:true, + webvisor:true, + ecommerce:"dataLayer" + }); + window.dataLayer = window.dataLayer || []; + - - - + {# AE - счетчик #} - ym(100896819, "init", { - clickmap:true, - trackLinks:true, - accurateTrackBounce:true, - webvisor:true - }); + + ym(100896819, "init", { + clickmap:true, + trackLinks:true, + accurateTrackBounce:true, + webvisor:true + }); @@ -96,20 +97,19 @@ src="https://www.facebook.com/tr?id=1791804684725971&ev=PageView&noscript=1" /> - + + + + - - {% include 'header.twig' %} -
{% block content %} {% endblock %} {% include 'modal.twig' %}
- {% include 'footer.twig' %}
{{ function('wp_footer') }} From 1bebb51162f283bd8d76c7c4bbdaa15dc8fd86cb Mon Sep 17 00:00:00 2001 From: Andrei-10 Date: Sat, 7 Jun 2025 04:37:08 +0000 Subject: [PATCH 2/4] =?UTF-8?q?Fix=20|=20task=206607=20(=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=BB=20=D1=84=D0=BE=D1=80=D0=BC=D1=83=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9)=20(#?= =?UTF-8?q?28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: maksim Reviewed-on: https://git.good-production.xyz/Good-Production/cosmopet-architecture/pulls/28 --- .../cosmopet/static/front-page/css/style.css | 267 ++++++++++++++++++ .../static/front-page/img/discount-line-w.svg | 2 +- .../cosmopet/templates/forms/discount.twig | 13 +- .../templates/front-page/front-page.twig | 1 + 4 files changed, 280 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/cosmopet/static/front-page/css/style.css b/wp-content/themes/cosmopet/static/front-page/css/style.css index 61cc78b..a874969 100644 --- a/wp-content/themes/cosmopet/static/front-page/css/style.css +++ b/wp-content/themes/cosmopet/static/front-page/css/style.css @@ -1076,6 +1076,7 @@ border-bottom: 2px solid var(--interface-main_black, rgba(18, 18, 18, 1)) max-width: 778px; margin-bottom: 27px; } + .discount_block .discount_text{ font-size: 20px; line-height: 24px; @@ -4280,4 +4281,270 @@ color: #f4f1f0; .invisible { visibility: hidden; +} + + +/* Discount start */ +.discount{ + padding-top: 50px; + padding-bottom: 50px; +} +.discount .discount_block{ + display: flex; + flex-direction: column; +} +.discount .discount_top{ + position: relative; + margin-bottom: 50px; +} +.discount_top .discount_title{ + font-size: 82px; + font-weight: 700; + line-height: 98.4px; + color: var(--creme-white, #F4F1F0); + text-transform: uppercase; +} +.discount_top .discount_top-imgs{ + position: absolute; + top: 55px; + right: -80px; +} +.discount_block .discount_form{ + position: relative; + z-index: 1; + display: flex; + align-items: center; + gap: 16px; + margin-bottom: 6px; +} +.discount_form .discount_form-btn { + background: inherit; + min-height: unset; +} +.discount_form .discount_form-btn:hover{ + background: var(--btn-color); + border-color: var(--btn-color); + color: #3ab18f; +} +.discount_form .discount_form-inp{ + width: 280px; + height: 50px; + border: 2px solid var(--creme-white, #F4F1F0); + padding: 10px 18px; + font-size: 24px; + font-weight: 500; + line-height: 28.8px; + color: var(--creme-white, #F4F1F0); + border-radius: 28px; + opacity: .6; +} +.discount_form .discount_form-inp::placeholder{ + font-size: 24px; + font-weight: 500; + line-height: 28.8px; + color: var(--creme-white, #F4F1F0); +} +.discount_form .discount_form-btn { + text-transform: lowercase; +} +.discount_block .discount_form-text{ + font-size: 14px; + line-height: 16.8px; + color: var(--creme-white, #F4F1F0); + opacity: .6; + max-width: 778px; + margin-bottom: 27px; +} +.discount_block .discount_text{ + font-size: 20px; + line-height: 24px; + color: var(--creme-white, #F4F1F0); +} + +.discount_block .discount_cosmodog{ + position: relative; + width: 100%; + height: 626px; + border-radius: 60px; + border: 2px solid var(--creme-white, #F4F1F0); + display: flex; + align-items: end; + justify-content: center; + overflow: hidden; + cursor: pointer; +} +.discount_cosmodog .discount_cosmodog-img{ + + width: 100%; + height: 100%; + object-fit: cover; + +} + +.discount_cosmodog__slider{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.discount_cosmodog .discount_cosmodog-img.active{ + opacity: 1; +} +.discount_cosmodog:hover .discount_cosmodog-img:nth-child(2) { + opacity: 1; +} +.discount_cosmodog .discount_cosmodog_info{ + position: relative; + z-index: 1; + padding: 33px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: end; + background: linear-gradient(0deg, #F4F1F0 56%, rgba(244, 241, 240, 0) 100%); + width: 100%; + height: 219px; +} +.discount_cosmodog .discount_cosmodog-title{ + font-size: 40px; + font-weight: 700; + line-height: 48px; + text-align: center; + color: var(--grey-black, #121212); + text-transform: uppercase; +} +.discount_cosmodog .discount_cosmodog-text{ + font-size: 24px; + font-weight: 500; + line-height: 28.8px; + text-align: center; +} + +/* Discount end */ + +@media only screen and (max-width: 1170px) { + .discount_top .discount_title { + font-size: 60px; + max-width: 550px; + line-height: 65px; + } + .discount_top .discount_top-imgs { + position: absolute; + top: 20px; + right: -50px; + } + .discount_top .discount_top-imgs .dicount_dog-img { + width: 400px; + } + + +} + +@media (max-width: 576px){ + /* Узнайте о нас больше и получите скидку! */ + .discount { + padding: 0px 0 43px; + } + .discount_top .discount_title, + .blog_block .blog_title, + .truth_block .truth_block-title, + .about_us .about_us-title, + .sellers_top .sellers_title { + font-size: 30px; + line-height: 36px; + } + + .discount_block .discount_text { + max-width: 260px; + } + + .discount_top .discount_top-imgs { + right: -136px; + top: 87px; + } + + .discount_top .discount_top-imgs .dicount_dog-img { + width: 314px; + width: 110vw; + } + + .discount_form .discount_form-inp { + height: 29px; + padding: 6px 13px; + font-size: 12px; + line-height: 14.4px; + } + + .discount_form .discount_form-inp::placeholder { + font-size: 12px; + line-height: 14.4px; + } +.discount_block .discount_text { + font-size: 12px; + line-height: 14.2px; + } + .discount_block .discount_form .discount_form-inp{ + width: 100%; + } + .discount_form .discount_form-btn { + justify-content: start; + padding: 5px 15px; + background: var(--creme-white, #F4F1F0); + color: #62c57e; + opacity: 0.6; + } + .discount_form img{ + display: none; + } + .discount_form span{ + width: 100%; + } + + .discount_block .discount_cosmodog { + border-radius: 25px; + height: 415px; + } + + .discount_cosmodog .discount_cosmodog_info { + height: 245px; + gap: 14px; + padding: 10px 19px; + } + + .discount_cosmodog .discount_cosmodog-title { + text-align: start; + font-size: 26px; + line-height: 31.2px; + max-width: 202px; + margin-right: auto; + } + + .discount_cosmodog .discount_cosmodog-text { + font-size: 12px; + line-height: 14.4px; + max-width: 231px; + text-align: start; + margin-right: auto; + } + + .discount_top .discount_top-imgs { + right: -20%; + top: 0; + transform: scale(1.8); + z-index: 0; + margin-bottom: -91%; + margin-top: 20%; + position: relative; + } + + .discount_block .wpcf7 { + order: 3; + } + + /* Узнайте о нас больше и получите скидку! - конец */ +} + +.discount_block{ + padding-bottom: 80px; } \ No newline at end of file diff --git a/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg b/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg index bd7fb64..0d4a0a2 100644 --- a/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg +++ b/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg @@ -1,3 +1,3 @@ - + diff --git a/wp-content/themes/cosmopet/templates/forms/discount.twig b/wp-content/themes/cosmopet/templates/forms/discount.twig index d3acd3b..fbc15f7 100644 --- a/wp-content/themes/cosmopet/templates/forms/discount.twig +++ b/wp-content/themes/cosmopet/templates/forms/discount.twig @@ -1,15 +1,24 @@ -
+

{{sub_title}}

+ {% if class %} + + + {% else %} + {% endif %}
@@ -20,7 +29,7 @@
- + diff --git a/wp-content/themes/cosmopet/templates/front-page/front-page.twig b/wp-content/themes/cosmopet/templates/front-page/front-page.twig index 6eba74f..ca78482 100644 --- a/wp-content/themes/cosmopet/templates/front-page/front-page.twig +++ b/wp-content/themes/cosmopet/templates/front-page/front-page.twig @@ -690,6 +690,7 @@ {% endif %} {% if show_promo %} + {% set class = 'discount_block' %} {% include 'forms/discount.twig' %} {% endif %} From e7e74da0bdd7c9b1db3979f0d5db0d07fafdd903 Mon Sep 17 00:00:00 2001 From: maksim Date: Sat, 7 Jun 2025 07:49:50 +0300 Subject: [PATCH 3/4] =?UTF-8?q?Fix=20|=20task=206607=20(=D0=90=D0=BD=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D0=BB=D0=B0=D0=B9=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-content/themes/cosmopet/static/front-page/js/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-content/themes/cosmopet/static/front-page/js/main.js b/wp-content/themes/cosmopet/static/front-page/js/main.js index 72c9056..a87edee 100644 --- a/wp-content/themes/cosmopet/static/front-page/js/main.js +++ b/wp-content/themes/cosmopet/static/front-page/js/main.js @@ -447,6 +447,10 @@ document.addEventListener('DOMContentLoaded', function () { slidesPerView: 1, spaceBetween: 0, loop: true, + effect: 'fade', + fadeEffect: { + crossFade: true // enables slides to cross fade into each other + }, autoplay: { delay: 3000, // Интервал переключения слайдов (3 секунды) disableOnInteraction: false, From d87f805b917ee284cc199025d3fdaefa27bb9b5b Mon Sep 17 00:00:00 2001 From: maksim Date: Sat, 7 Jun 2025 18:16:54 +0300 Subject: [PATCH 4/4] =?UTF-8?q?Maks=20|=20feat:=20=D1=80=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BB=D0=BE=D0=B3=D0=B8?= =?UTF-8?q?=D0=BA=D1=83=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=20=D0=B8=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B6=D0=B8=D0=BC=D0=B0=20dev/prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-content/themes/cosmopet/functions.php | 125 +++++++++--------- .../global-functions/multisite-functions.php | 36 +++++ .../discount/assets/css/discount-form.css | 3 + .../themes/cosmopet/templates/header.twig | 8 +- 4 files changed, 107 insertions(+), 65 deletions(-) diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 0fbcf1e..9fcb336 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -144,76 +144,76 @@ function include_module($module_name) { -// Регистрируем стили и скрипты -add_action('wp_enqueue_scripts', function() use ($module_name, $module_dir) { - // Подключаем стили - $css_dir = $module_dir . '/assets/css'; - if (is_dir($css_dir)) { - $css_files = scandir($css_dir); - - // Приоритетные файлы - $priority_files = [ - 'normalize.css', - 'gp-style-core.css', - 'gp-style-desktop.css', - 'gp-style-tablet.css', - 'gp-style-mobile.css' - ]; + // Регистрируем стили и скрипты + add_action('wp_enqueue_scripts', function() use ($module_name, $module_dir) { + // Подключаем стили + $css_dir = $module_dir . '/assets/css'; + if (is_dir($css_dir)) { + $css_files = scandir($css_dir); - // Подключаем приоритетные файлы в заданном порядке - foreach ($priority_files as $priority_file) { - $file_path = $css_dir . '/' . $priority_file; - if (file_exists($file_path)) { - wp_enqueue_style( - $module_name . '-' . pathinfo($priority_file, PATHINFO_FILENAME), - get_template_directory_uri() . '/modules/' . $module_name . '/assets/css/' . $priority_file, - [], - filemtime($file_path) - ); + // Приоритетные файлы + $priority_files = [ + 'normalize.css', + 'gp-style-core.css', + 'gp-style-desktop.css', + 'gp-style-tablet.css', + 'gp-style-mobile.css' + ]; + + // Подключаем приоритетные файлы в заданном порядке + foreach ($priority_files as $priority_file) { + $file_path = $css_dir . '/' . $priority_file; + if (file_exists($file_path)) { + wp_enqueue_style( + $module_name . '-' . pathinfo($priority_file, PATHINFO_FILENAME), + get_template_directory_uri() . '/modules/' . $module_name . '/assets/css/' . $priority_file, + [], + filemtime($file_path) + ); + } } - } - // Подключаем остальные CSS-файлы - foreach ($css_files as $css_file) { - if ( - pathinfo($css_file, PATHINFO_EXTENSION) === 'css' && - $css_file !== '.' && - $css_file !== '..' && - !in_array($css_file, $priority_files) - ) { - $file_path = $css_dir . '/' . $css_file; - wp_enqueue_style( - $module_name . '-' . pathinfo($css_file, PATHINFO_FILENAME), - get_template_directory_uri() . '/modules/' . $module_name . '/assets/css/' . $css_file, - [], - filemtime($file_path) - ); + // Подключаем остальные CSS-файлы + foreach ($css_files as $css_file) { + if ( + pathinfo($css_file, PATHINFO_EXTENSION) === 'css' && + $css_file !== '.' && + $css_file !== '..' && + !in_array($css_file, $priority_files) + ) { + $file_path = $css_dir . '/' . $css_file; + wp_enqueue_style( + $module_name . '-' . pathinfo($css_file, PATHINFO_FILENAME), + get_template_directory_uri() . '/modules/' . $module_name . '/assets/css/' . $css_file, + [], + filemtime($file_path) + ); + } } } - } - // Подключаем скрипты - $js_dir = $module_dir . '/assets/js'; - if (is_dir($js_dir)) { - $js_files = scandir($js_dir); - foreach ($js_files as $js_file) { - if ( - pathinfo($js_file, PATHINFO_EXTENSION) === 'js' && - $js_file !== '.' && - $js_file !== '..' - ) { - $file_path = $js_dir . '/' . $js_file; - wp_enqueue_script( - $module_name . '-' . pathinfo($js_file, PATHINFO_FILENAME), - get_template_directory_uri() . '/modules/' . $module_name . '/assets/js/' . $js_file, - ['jquery'], - filemtime($file_path), - true - ); + // Подключаем скрипты + $js_dir = $module_dir . '/assets/js'; + if (is_dir($js_dir)) { + $js_files = scandir($js_dir); + foreach ($js_files as $js_file) { + if ( + pathinfo($js_file, PATHINFO_EXTENSION) === 'js' && + $js_file !== '.' && + $js_file !== '..' + ) { + $file_path = $js_dir . '/' . $js_file; + wp_enqueue_script( + $module_name . '-' . pathinfo($js_file, PATHINFO_FILENAME), + get_template_directory_uri() . '/modules/' . $module_name . '/assets/js/' . $js_file, + ['jquery'], + filemtime($file_path), + true + ); + } } } - } -}); + }); // Подключаем контроллер модуля @@ -325,6 +325,7 @@ add_filter('theme_page_templates', function ($templates) { return $templates; }); +/* Подключаем все файлы с глобальными функциями */ includeFilesFromFolder(get_template_directory() . '/global-functions'); diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php index a42c7d5..56a61ca 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -1,5 +1,41 @@ ['mode' => 'production', 'region' => 'ru'], + 'cosmopet.ae' => ['mode' => 'production', 'region' => 'ae'], + 'cosmopet-test-ru.cp.good-production.xyz' => ['mode' => 'develope', 'region' => 'ru'], + 'cosmopet-test-ae.cp.good-production.xyz' => ['mode' => 'develope', 'region' => 'ae'], + ]; + + $host = strtolower($host ?: $_SERVER['SERVER_NAME']); + $config = $map[$host] ?? ['mode' => 'develope', 'region' => 'unknown']; + + $this->site_mode = $config['mode']; + $this->site_region = $config['region']; + } +} + + +add_filter('timber/twig', function (\Twig\Environment $twig) { + $site_env = new SiteEnvironment(); + $twig->addGlobal('site_region', $site_env->site_region); + $twig->addGlobal('site_mode', $site_env->site_mode); + return $twig; +}); +/* End | Работа с проверкой мультисайтовости и стендов */ + + + + + add_filter('woocommerce_currency_symbol', 'change_aed_currency_symbol', 10, 2); function change_aed_currency_symbol($currency_symbol, $currency) { diff --git a/wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css b/wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css index 568a6d4..f98192b 100644 --- a/wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css +++ b/wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css @@ -2279,6 +2279,8 @@ justify-content: center; -webkit-text-fill-color: transparent; } + + @media screen and (max-width: 991px) { .reviews__left { width: 100%; @@ -2450,6 +2452,7 @@ justify-content: center; .truth_content-wrap { padding: 0 30px; } + } @media screen and (max-width: 540px) { diff --git a/wp-content/themes/cosmopet/templates/header.twig b/wp-content/themes/cosmopet/templates/header.twig index 66f9448..f489153 100644 --- a/wp-content/themes/cosmopet/templates/header.twig +++ b/wp-content/themes/cosmopet/templates/header.twig @@ -22,9 +22,11 @@
  • {% if current_lang == 'ru' %}Лакомства{% elseif current_lang == 'en' %}Treats{% endif %}
  • -
  • - {% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %} -
  • + {% if site_region == 'ru' %} +
  • + {% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %} +
  • + {% endif %}