From 3aa9b634b2b4437af81288cc2a9ee483d349be7d Mon Sep 17 00:00:00 2001 From: Andrei-10 Date: Thu, 22 May 2025 18:04:44 +0000 Subject: [PATCH] Fix | script and login popup bugs fix Fix | script and login popup bugs fix --- wp-content/themes/cosmopet/functions.php | 7 + .../header/assets/css/gp-style-desktop.css | 8 +- .../cosmopet/static/front-page/js/main.js | 7 +- .../themes/cosmopet/templates/footer.twig | 68 +-- .../themes/cosmopet/templates/modal.twig | 2 + .../cosmopet/templates/modal/login.twig | 51 ++ .../cosmopet/templates/profile/profile.twig | 153 +++--- .../templates/where_to_buy/template_wtb.php | 502 ++++++++++++++++++ .../cosmopet/templates/where_to_buy/wtb.twig | 0 9 files changed, 646 insertions(+), 152 deletions(-) create mode 100644 wp-content/themes/cosmopet/templates/modal/login.twig create mode 100644 wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php create mode 100644 wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 036e840..b7ce43a 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -1149,5 +1149,12 @@ function change_wbw_filter_button_text($text) { add_filter('wbw_filter_reset_button_text', 'change_wbw_reset_button_text'); function change_wbw_reset_button_text($text) { return 'Сбросить'; +} +add_action('template_redirect', 'custom_redirect_cart_page'); +function custom_redirect_cart_page() { + if (is_cart()) { + wp_redirect(home_url('/')); + exit; + } } \ No newline at end of file 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 054aca4..55bf2c5 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 @@ -744,8 +744,8 @@ width: 0px; width: 16px; height: 16px; border-radius: 50%; - right: 30px; - bottom: 20px; + right: 3px; + bottom: 2px; font-style: normal; font-weight: 700; font-size: 9px; @@ -755,4 +755,8 @@ width: 0px; .mini-profile__button--counter.disabled{ display: none; +} + +.mini-profile__button{ + position: relative; } \ No newline at end of file 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 7f98d84..72c9056 100644 --- a/wp-content/themes/cosmopet/static/front-page/js/main.js +++ b/wp-content/themes/cosmopet/static/front-page/js/main.js @@ -467,7 +467,6 @@ document.addEventListener('DOMContentLoaded', function () { }); }); -<<<<<<< HEAD // Находим все элементы с классом login-open document.addEventListener('DOMContentLoaded', function() { const loginButtons = document.querySelectorAll('.login-open'); @@ -520,8 +519,7 @@ document.addEventListener('DOMContentLoaded', function() { // Сбрасываем ширину modalAside.style.width = ''; } - }); -======= +}); document.addEventListener('DOMContentLoaded', function() { // Initialize Swiper @@ -590,5 +588,4 @@ document.addEventListener('DOMContentLoaded', function() { reviewPopup.style.display = 'none'; } }); -}); ->>>>>>> ec84500a88f048324cf2940bad3ba7528694953e +}); diff --git a/wp-content/themes/cosmopet/templates/footer.twig b/wp-content/themes/cosmopet/templates/footer.twig index ab0c417..9478b5e 100644 --- a/wp-content/themes/cosmopet/templates/footer.twig +++ b/wp-content/themes/cosmopet/templates/footer.twig @@ -55,73 +55,9 @@ - + {% verbatim %} - @@ -125,12 +122,12 @@
-

{{ __('Feed subscription', 'woodmart')|esc_html }}

+

{{ function('pll_e', 'Feed subscription') }}

-

{{ __('Weekly food delivery for your pet', 'woodmart')|esc_html }}

+

{{ function('pll_e', 'Weekly food delivery for your pet') }}

- +
@@ -144,11 +141,11 @@
-

{{ __('Order from', 'woodmart')|esc_html }} {{ order.date_created|date('Y.m.d') }}

+

{{ function('pll_e', 'Order from') }} {{ order.date_created|date('Y.m.d') }}

{{ order.id }}

-

{{ __('Summary', 'woodmart')|esc_html }}:

+

{{ function('pll_e', 'Summary') }}:

{{ order.total }}

@@ -158,11 +155,10 @@
-

{{ __('Delivery address', 'woodmart')|esc_html }}

+

{{ function('pll_e', 'Delivery address') }}

{% if meta_data.office_code %} - {{ __('CDEK shipping point', 'woodmart')|esc_html }}
- {# Предполагается, что API-запрос обрабатывается в PHP, добавляем в контекст #} + {{ function('pll_e', 'CDEK shipping point') }}
{{ office_name }} {% else %} {{ shipping_address.city }} {{ shipping_address.address_1 }} @@ -189,14 +185,14 @@

- +
{% for item in order.get_items %} @@ -215,11 +211,11 @@ {% else %}
-

{{ __('No orders yet', 'woodmart')|esc_html }}

+

{{ function('pll_e', 'No orders yet') }}

@@ -232,15 +228,15 @@
-

{{ __('Weight', 'woodmart')|esc_html }}:

+

{{ function('pll_e', 'Weight') }}:

{{ pet.weight_text }}

-

{{ __('Age', 'woodmart')|esc_html }}:

+

{{ function('pll_e', 'Age') }}:

{{ pet.old_text }}

-

{{ __('Activity', 'woodmart')|esc_html }}:

+

{{ function('pll_e', 'Activity') }}:

{{ pet.activity_text }}

@@ -251,33 +247,33 @@