diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index cd213f7..0fbcf1e 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -1196,7 +1196,6 @@ function remove_woocommerce_styles_on_checkout() { } - // Добавляем hreflang теги для cosmopet.shop add_action('wp_head', 'custom_hreflang_shop', 6); function custom_hreflang_shop() { @@ -1340,5 +1339,4 @@ function custom_handle_activation_request() { } } -} - +} \ 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 b8b3cd8..fc61e14 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -121,6 +121,250 @@ function send_purchase_to_metrika($order_id) { }); + + 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; + ?> + + admin_url('admin-ajax.php') + )); + + // Inline CSS + wp_enqueue_style('woocommerce-custom-styles', get_template_directory_uri() . '/style.css', array(), '1.0'); + $custom_css = " + .single_add_to_cart_button.loading { + opacity: 0.5; + cursor: not-allowed; + position: relative; + } + .single_add_to_cart_button.loading:after { + content: ''; + display: inline-block; + width: 16px; + height: 16px; + border: 2px solid #fff; + border-radius: 50%; + border-top-color: transparent; + animation: spin 1s linear infinite; + position: absolute; + right: 10px; + } + @keyframes spin { + 100% { + transform: rotate(360deg); + } + } + "; + wp_add_inline_style('woocommerce-custom-styles', $custom_css); + } } // Отключаем кэширование для страниц товаров diff --git a/wp-content/themes/cosmopet/modules/footer/assets/js/footer.js b/wp-content/themes/cosmopet/modules/footer/assets/js/footer.js index bdd6ea3..bb24a06 100644 --- a/wp-content/themes/cosmopet/modules/footer/assets/js/footer.js +++ b/wp-content/themes/cosmopet/modules/footer/assets/js/footer.js @@ -955,3 +955,4 @@ if (document.querySelector('.header').classList.contains('white')) { + 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 2ef50e5..3c26e10 100644 --- a/wp-content/themes/cosmopet/templates/front-page/front-page.twig +++ b/wp-content/themes/cosmopet/templates/front-page/front-page.twig @@ -6,7 +6,11 @@ {% block content %}
+<<<<<<< HEAD

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

+======= +

FOOD OF THE FUTURE FOR YOUR PET

+>>>>>>> web_87
diff --git a/wp-content/themes/cosmopet/templates/header.twig b/wp-content/themes/cosmopet/templates/header.twig index bc21bce..66f9448 100644 --- a/wp-content/themes/cosmopet/templates/header.twig +++ b/wp-content/themes/cosmopet/templates/header.twig @@ -187,6 +187,13 @@ + {% if CONSTANTS.DOMAIN != 'AE' %}
+{% endblock %} diff --git a/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php b/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php index f341475..2fe3ee0 100644 --- a/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php +++ b/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php @@ -1,502 +1,136 @@ - -
- -
- - -
-
-

Where to Buy

-

Looking for Cosmopet products in stores? You can find our premium pet treats in select pet shops and retail stores across the UAE.

-
-
- -
- - -
-
-
- - - - - -
-

- -
- -
- - - - - - -
- - -
-

Our partners

-
-
- -
- - <?php echo esc_attr($image['alt']); ?> - -
- -
-
-
- - - -
- -
-
- -

Want to sell Cosmopet in your store?

-

Join our growing network of retailers! Fill out the contact form below, and we’ll get in touch to discuss the details.

-
- - - - - - - - - -
-
-

Thanks for request!

-

We will answer your message as soon as possible

- -
- - - -
-
- - -
-
- - +// Инициализация Timber +$context = Timber::context(); + +// Подключение стилей +wp_enqueue_style('gp-wtb-style', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-core.css?v=1.14'); +wp_enqueue_style('gp-wtb-style-dt', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-desktop.css?v=1.22'); +wp_enqueue_style('gp-wtb-style-tb', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-tablet.css?v=1.22'); +wp_enqueue_style('gp-wtb-style-mb', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-mobile.css?v=1.122'); + +// Получение данных маркеров из ACF +$locations = get_field('location_markers') ?: []; +$acf_locations = array_map(function($location) { + return [ + 'title' => $location['title'], + 'address' => $location['address'], + 'url' => $location['website'], + 'latitude' => isset($location['latitude']) ? (float)$location['latitude'] : null, + 'longitude' => isset($location['longitude']) ? (float)$location['longitude'] : null + ]; +}, $locations); + +// Предопределенные данные локаций +$predefined_locations = [ + [ + 'title' => 'Roots Supermarket', + 'address' => 'Waves Grande, Retail unit 1-2 Shobha Hartland, Dubai DU United Arab Emirates', + 'position' => ['lat' => 25.1896, 'lng' => 55.3662], + 'url' => '' + ], + [ + 'title' => 'Pawdy Neighbors', + 'address' => 'Souk Al Manzil - Old Town Downtown, Dubai, United Arab Emirates', + 'position' => ['lat' => 25.1915, 'lng' => 55.2758], + 'url' => '' + ], + [ + 'title' => 'The Pet Co', + 'address' => 'Tower A, Shop 01, Prime Business Centre, JVC, Dubai, UAE', + 'position' => ['lat' => 25.0580, 'lng' => 55.2282], + 'url' => '' + ], + [ + 'title' => 'Ivy Secret Garden', + 'address' => 'Al Wasl Warehouse Complex, Unit 14 - 26th St - Al Quoz Industrial Area 4 - Dubai', + 'position' => ['lat' => 25.1416, 'lng' => 55.2358], + 'url' => '' + ], + [ + 'title' => 'Petzone', + 'address' => 'Petzone Sheikh Zayed Road - Petzone Umm Suqeim', + 'position' => ['lat' => 25.1530, 'lng' => 55.2145], + 'url' => 'https://petzone.com/uae/en/' + ], + [ + 'title' => 'Pet Corner', + 'address' => 'Pet Corner Sheikh Zayed Road, Al Fardan Building 1, Sheikh Zayed Road, Next to Deals on Wheels & Business Bay Metro Station', + 'position' => ['lat' => 25.1868, 'lng' => 55.2527], + 'url' => 'https://petcornerdubai.com/' + ], + [ + 'title' => 'Pet Corner Motor City - Dubai', + 'address' => 'Unit R7, Fox Hill 8, Motor City, Opposite Arabian Ranches', + 'position' => ['lat' => 25.0499, 'lng' => 55.2350], + 'url' => '' + ], + [ + 'title' => 'Pet Corner Jumeirah Golf Estates - Dubai', + 'address' => 'Shop No. 7, The Fairway Mall Jumeirah Golf Estates Dubai', + 'position' => ['lat' => 25.0394, 'lng' => 55.2269], + 'url' => '' + ], + [ + 'title' => 'Pet Corner Khalifa City - Abu Dhabi', + 'address' => 'Shop No 5, Al Raha Gardens, Khalifa City Abu Dhabi', + 'position' => ['lat' => 24.4243, 'lng' => 54.5754], + 'url' => '' + ], + [ + 'title' => 'Pet Corner- Sharjah Al Mamsha', + 'address' => 'Al Sharjah, University Road', + 'position' => ['lat' => 25.3126, 'lng' => 55.4783], + 'url' => '' + ], + [ + 'title' => 'Pet Corner Fujairah- Lulu Mall', + 'address' => 'Al - Korthabah Road - Fujairah City Center - Fujairah', + 'position' => ['lat' => 25.1221, 'lng' => 56.3244], + 'url' => '' + ], + [ + 'title' => 'Tail Waggin Al Quoz', + 'address' => 'Warehouse 7, Street 8, Al Khail Road, Al Quoz 1, Dubai, United Arab Emirates', + 'position' => ['lat' => 25.1368, 'lng' => 55.2364], + 'url' => '' + ], + [ + 'title' => "Tail Waggin' Pet Spa Dubai Hills", + 'address' => 'SWAY Residences, Retail 2 - near Kings College Hospital Dubai Hills Estate - Dubai - United Arab Emirates', + 'position' => ['lat' => 25.1276, 'lng' => 55.2714], + 'url' => '' + ], + [ + 'title' => 'Goofy Groom', + 'address' => 'Dubai, UAE Midtown Central Majan, Shop G-17', + 'position' => ['lat' => 25.0834, 'lng' => 55.1743], + 'url' => '' + ] +]; + +// Получение изображений из галереи ACF +$partners_logos = get_field('partners_logos') ?: []; +$partners_logos_formatted = array_map(function($image) { + return [ + 'url' => esc_url($image['title']), + 'src' => esc_url($image['sizes']['medium']), + 'alt' => esc_attr($image['alt']) + ]; +}, $partners_logos); + +// Добавление данных в контекст +$context['acf_locations'] = $acf_locations; +$context['predefined_locations'] = $predefined_locations; +$context['partners_logos'] = $partners_logos_formatted; + +// Отключение автопараграфов для Contact Form 7 +add_filter('wpcf7_autop_or_not', '__return_false'); + +// Рендеринг шаблона +Timber::render('templates/where_to_buy/wtb.twig', $context); +?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig b/wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig index e69de29..06119f0 100644 --- a/wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig +++ b/wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig @@ -0,0 +1,365 @@ +{% set bodyClass = 'main-np' %} + +{% extends 'layout.twig' %} + +{% block content %} +
+
+ +
+
+

Where to Buy

+

Looking for Cosmopet products in stores? You can find our premium pet treats in select pet shops and retail stores across the UAE.

+
+
+ + +
+
+
+
+ + + + + +
+

+ + +
+
+

📍 Find us at:

+
    + {% for item in acf_locations %} +
  • +

    + {% if item.url %} + {{ item.title }} + {% else %} + {{ item.title }} + {% endif %} +

    +

    {{ item.address }}

    +
  • + {% endfor %} +
+
+
+ + + + +
+ {% if partners_logos %} + +
+

Our partners

+
+
+ {% for i in 1..5 %} + {% for image in partners_logos %} +
+ + {{ image.alt }} + +
+ {% endfor %} + {% endfor %} +
+
+
+ + + + + {% endif %} +
+ + +
+
+

Want to sell Cosmopet in your store?

+

Join our growing network of retailers! Fill out the contact form below, and we’ll get in touch to discuss the details.

+
+ + + + + + +
+
+

Thanks for request!

+

We will answer your message as soon as possible

+
+
+
+ +
+
+{% endblock %} \ No newline at end of file