diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 6013f71..68049fb 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -24,13 +24,17 @@ require_once __DIR__ . '/temp-functions/login-logic.php'; // include_module('author'); // include_module('layout'); +<<<<<<< HEAD +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) include_once('modules/shop/CosmopetProduct.php'); add_filter('timber/post/classmap', function ($classmap) { $classmap['product'] = CosmopetProduct::class; return $classmap; }, 100); +<<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD @@ -59,3 +63,5 @@ add_filter('upload_mimes', 'allow_svg_upload'); ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php index 82e2078..84f3106 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -35,4 +35,8 @@ add_filter('timber/twig', function (\Twig\Environment $twig) { add_filter('woocommerce_currency_symbol', function($currency_symbol, $currency) { return $currency === 'AED' ? 'AED' : $currency_symbol; +<<<<<<< HEAD }) +======= +}, 10, 2); +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) diff --git a/wp-content/themes/cosmopet/modules/shop/CosmopetProduct.php b/wp-content/themes/cosmopet/modules/shop/CosmopetProduct.php index af845f5..24f056e 100644 --- a/wp-content/themes/cosmopet/modules/shop/CosmopetProduct.php +++ b/wp-content/themes/cosmopet/modules/shop/CosmopetProduct.php @@ -10,13 +10,17 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) 'pa_compound', 'pa_dog-size', 'pa_reproductive-status', 'pa_age-of-the-cat', 'pa_age-of-the-dog', +<<<<<<< HEAD ======= 'pa_age-of-the-cat', 'pa_age-of-the-dog', @@ -35,6 +39,8 @@ class CosmopetProduct extends TimberProduct { >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) 'pa_series', +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) ]; public function __construct ($pid = null) { @@ -70,6 +76,7 @@ class CosmopetProduct extends TimberProduct { if ($this->product && method_exists($this->product, 'get_gallery_image_ids')) { <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD $gallery_image_ids = $this->product->get_gallery_image_ids(); ======= @@ -84,6 +91,10 @@ class CosmopetProduct extends TimberProduct { $gallery_image_ids = $this->product->get_gallery_image_ids(); >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + + $gallery_image_ids = $this->product->get_gallery_image_ids(); +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) } else { $gallery_image_ids = []; } @@ -116,6 +127,7 @@ class CosmopetProduct extends TimberProduct { if ($this->product && method_exists($this->product, 'get_weight')) { <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD return $this->product->get_weight() ? $this->product->get_weight() . ' ' . $custom_measurement : ''; ======= @@ -131,6 +143,10 @@ class CosmopetProduct extends TimberProduct { >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) } +======= + return $this->product->get_weight() ? $this->product->get_weight() . ' ' . $custom_measurement : ''; + } +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) return ''; } return ''; @@ -157,7 +173,6 @@ class CosmopetProduct extends TimberProduct { */ public function getTasteClass() { // Получаем категории товара -<<<<<<< HEAD $product_categories = wp_get_post_terms( $this->product->get_id(), 'product_cat' ); $is_food = false; @@ -168,6 +183,7 @@ class CosmopetProduct extends TimberProduct { if ( $cat->slug === 'korm' ) { $is_food = true; } elseif ( $cat->slug === 'lakomstva' ) { +<<<<<<< HEAD ======= $product_categories = $this->product->get_category_ids(); @@ -183,6 +199,8 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) $is_treats = true; } } @@ -293,6 +311,7 @@ class CosmopetProduct extends TimberProduct { return $item['post']; <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD }, $siblings_with_weights); ======= @@ -307,6 +326,9 @@ class CosmopetProduct extends TimberProduct { }, $siblings_with_weights); >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + }, $siblings_with_weights); +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) return $sorted_siblings; } @@ -357,10 +379,12 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) - // Получаем упорядоченные таксономии $ordered_taxonomies = $this->getOrderedTaxonomies(); @@ -396,6 +420,7 @@ class CosmopetProduct extends TimberProduct { // Пропускаем, если у текущего товара нет значения для этой категории if (!isset($current_product_attributes[$taxonomy])) { continue; +<<<<<<< HEAD ======= // Отладочная информация error_log("=== Конструктор товара ==="); @@ -482,6 +507,8 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) } // Проверяем, совпадают ли все остальные атрибуты и вес @@ -489,6 +516,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) @@ -506,6 +534,10 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + + $differences = []; +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) foreach ($this->sibling_categories as $compare_taxonomy) { if ($compare_taxonomy === $taxonomy) { continue; // Пропускаем проверяемую категорию @@ -519,6 +551,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= $differences[] = "Нет атрибута $compare_taxonomy у сравниваемого товара"; >>>>>>> 909cd3ca (Task 7719 | натяжка верстки single страницы товара) @@ -529,6 +562,9 @@ class CosmopetProduct extends TimberProduct { $differences[] = "Нет атрибута $compare_taxonomy у сравниваемого товара"; >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + $differences[] = "Нет атрибута $compare_taxonomy у сравниваемого товара"; +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) break; } @@ -542,6 +578,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= $differences[] = "Не совпадают значения для $compare_taxonomy"; >>>>>>> 909cd3ca (Task 7719 | натяжка верстки single страницы товара) @@ -552,6 +589,9 @@ class CosmopetProduct extends TimberProduct { $differences[] = "Не совпадают значения для $compare_taxonomy"; >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + $differences[] = "Не совпадают значения для $compare_taxonomy"; +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) break; } } @@ -563,6 +603,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= $differences[] = "У сравниваемого товара есть атрибут $compare_taxonomy, а у текущего нет"; >>>>>>> 909cd3ca (Task 7719 | натяжка верстки single страницы товара) @@ -573,6 +614,11 @@ class CosmopetProduct extends TimberProduct { $differences[] = "У сравниваемого товара есть атрибут $compare_taxonomy, а у текущего нет"; >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + + $differences[] = "У сравниваемого товара есть атрибут $compare_taxonomy, а у текущего нет"; + +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) break; } } @@ -582,16 +628,21 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) if (abs($current_weight - $compare_weight) > 0.01) { $attributes_match = false; ======= +======= + +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) $compare_weight = $product->getNumericWeight(); if (abs($current_weight - $compare_weight) > 0.01) { // Используем небольшой допуск для float $attributes_match = false; $differences[] = "Не совпадает вес: текущий '$current_weight' vs сравниваемый '$compare_weight'"; <<<<<<< HEAD +<<<<<<< HEAD >>>>>>> 909cd3ca (Task 7719 | натяжка верстки single страницы товара) ======= if (abs($current_weight - $compare_weight) > 0.01) { @@ -600,6 +651,8 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) } // Если все атрибуты и вес совпадают, добавляем товар в группу @@ -607,6 +660,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= error_log("Товар {$product->id} подходит для атрибута $taxonomy"); >>>>>>> 909cd3ca (Task 7719 | натяжка верстки single страницы товара) @@ -617,6 +671,10 @@ class CosmopetProduct extends TimberProduct { error_log("Товар {$product->id} подходит для атрибута $taxonomy"); >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + + error_log("Товар {$product->id} подходит для атрибута $taxonomy"); +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) $product_terms = get_the_terms($product->id, $taxonomy); if ($product_terms && !is_wp_error($product_terms)) { foreach ($product_terms as $term) { @@ -627,6 +685,7 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) 'name' => $this->getTermName($term->term_id, $taxonomy), @@ -645,6 +704,12 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + 'name' => $this->getTermName($term->term_id, $taxonomy), + 'slug' => $term->slug, + 'icon' => $this->getTermIcon($term->term_id, $taxonomy), + +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) 'products' => [] ]; } @@ -654,8 +719,11 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) } } } @@ -694,6 +762,7 @@ class CosmopetProduct extends TimberProduct { 'pa_compound' => pll__('ВКУС КОРМА'), 'pa_reproductive-status' => pll__('ВИД КОШКИ'), 'pa_series' => pll__('СЕРИЯ'), +<<<<<<< HEAD ======= } else { error_log("Товар {$product->id} НЕ подходит для атрибута $taxonomy. Причины: " . implode(', ', $differences)); @@ -772,6 +841,9 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= + +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) ]; return $labels[$taxonomy] ?? wc_attribute_label($taxonomy); @@ -788,10 +860,13 @@ class CosmopetProduct extends TimberProduct { <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 51869ae1 (Task 7719 | натяжка верстки single товара.) ======= >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) /** * Получает таксономии в правильном порядке с учетом сортировки * @return array Массив таксономий с их порядком @@ -957,6 +1032,7 @@ class CosmopetProduct extends TimberProduct { +<<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD ======= @@ -967,6 +1043,8 @@ class CosmopetProduct extends TimberProduct { ======= >>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) public function getAllAttributes() { $attributes = []; foreach ($this->sibling_categories as $taxonomy) { @@ -991,7 +1069,7 @@ class CosmopetProduct extends TimberProduct { public function getRegularPriceWithCurrency(){ $regular_price = $this->product->get_regular_price() . ' ' . get_woocommerce_currency_symbol(); - if ($regular_price != $this->getPrice()){ + if ($regular_price != $this->getPriceWithCurrency()){ return $regular_price; } else{ diff --git a/wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css b/wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css index aeeb1e2..eb95c9b 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css +++ b/wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css @@ -678,6 +678,14 @@ line-height: 143%; display: flex; flex-grow: 1; flex-direction: column; + max-width: calc(100% - 1000px); + margin-right: 2rem; +} +@media (max-width: 1200px) { + .product-show{ + margin-right: 0; + max-width: 100%; + } } @media (max-width: 576px) { .product_main { @@ -687,7 +695,8 @@ line-height: 143%; .product-show{ flex-direction: column; min-height: calc(100vh - 80px); - + margin-right: 0; + max-width: 100%; } .product-gallery{ flex-grow: 1; @@ -757,10 +766,13 @@ line-height: 143%; .stock, .quantity{ display: none; <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD:wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css >>>>>>> 4db62697 (Task 7719 | натяжка верстки single страницы товара) +======= +>>>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) } @@ -904,6 +916,51 @@ line-height: 143%; .product-incart__wrap.loading .product-incart__count { opacity: 0.5; } -======= + +.product-pp-btn{ + display: flex; + justify-content: center; + margin-top: 1rem; + gap: 1rem; + /* Смотреть все */ + + font-weight: 700; + font-size: 16px; + line-height: 20px; + text-decoration-line: underline; + color: var(--accent-color); + align-items: center; + margin-right: auto; + margin-left: auto; +} + +.product-pp-btn svg, .product-pp-btn path{ + fill: var(--accent-color); + stroke: var(--accent-color); } ->>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара):wp-content/themes/cosmopet/modules/shop/components/single-product_new/assets/css/product-style.css + +.mform__info__c{ + display: flex; + justify-content: space-between; + margin-top: 2rem; + flex-wrap: wrap; +} + +.mform__info__col{ + width: 48.5%; +} + +.mform__info__col .product-values{ + margin-top: 0; +} + +@media (max-width: 640px) { + .mform__info__col{ + width: 100%; +} +} + +.mform__review-wrap{ + max-height: 100vh; + overflow: auto; +} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product_new/component-controller.php b/wp-content/themes/cosmopet/modules/shop/components/single-product_new/component-controller.php deleted file mode 100644 index 9e903c1..0000000 --- a/wp-content/themes/cosmopet/modules/shop/components/single-product_new/component-controller.php +++ /dev/null @@ -1,13 +0,0 @@ - ->>>>>> 598bddea (Andrei | добавил попап для отображения всех характеристик товара) // Изменение цены доставки на разбиение НДС + основная стоимость add_filter( 'woocommerce_package_rates', function( $rates, $package ) { @@ -447,5 +450,3 @@ add_filter( 'woocommerce_package_rates', function( $rates, $package ) { return $rates; }, 100, 2 ); -======= ->>>>>>> 7499a8aa (Task 7719 | натяжка верстки single страницы товара) diff --git a/wp-content/themes/cosmopet/temp-functions/timber-logic.php b/wp-content/themes/cosmopet/temp-functions/timber-logic.php index 4e448bd..708d9df 100644 --- a/wp-content/themes/cosmopet/temp-functions/timber-logic.php +++ b/wp-content/themes/cosmopet/temp-functions/timber-logic.php @@ -1,4 +1,4 @@ -<<<<<<< HEAD + use Timber; @@ -55,48 +55,3 @@ add_action('init', function() { return $context; }); }, 1); -======= - - -use Timber; -use Timber\PostCollection; -use Timber\Integrations\WooCommerce\Product as TimberProduct; - - -Timber::$dirname = [ - [ - 'modules', - 'views' - ], -]; - - -add_filter( 'timber/integrations', function ( array $integrations ): array { - $integrations[] = new \Timber\Integrations\WooCommerce\WooCommerceIntegration(); - return $integrations; -} ); - -add_action('timber/init', function() { - // Инициализируем WooCommerce интеграцию - if (class_exists('Timber\Integrations\WooCommerce\WooCommerce')) { - Timber\Integrations\WooCommerce\WooCommerce::init(); - } -}); - - -// Add the function to the Timber context -add_filter('timber/context', function($context) { - $context['template_path'] = get_template_directory_uri(); - $current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - $context['current_url'] = htmlspecialchars($current_url); - return $context; -}); - - -add_action('init', function() { - add_filter('timber/context', function($context) { - $context['current_lang'] = pll_current_language(); - return $context; - }); -}, 1); ->>>>>>> 7da02c80 (Task 7719 | натяжка верстки single страницы товара) diff --git a/wp-content/themes/cosmopet/views/_pages/new-front-page.twig b/wp-content/themes/cosmopet/views/_pages/new-front-page.twig index 307241f..9354d28 100644 --- a/wp-content/themes/cosmopet/views/_pages/new-front-page.twig +++ b/wp-content/themes/cosmopet/views/_pages/new-front-page.twig @@ -3,7 +3,6 @@ {% extends 'layout.twig' %} {% block content %} - {% include '_pages/new-front-page/main-slider.twig' %} {% include '_pages/new-front-page/main-about.twig' %} {% include '_pages/new-front-page/main-why.twig' %} diff --git a/wp-content/themes/cosmopet/views/woocommerce/single-product.twig b/wp-content/themes/cosmopet/views/woocommerce/single-product.twig index 3198c45..36b1994 100644 --- a/wp-content/themes/cosmopet/views/woocommerce/single-product.twig +++ b/wp-content/themes/cosmopet/views/woocommerce/single-product.twig @@ -61,43 +61,14 @@