merge conflict

pull/36/head
Антон 3 weeks ago
commit 56c91ed705
  1. 2
      .gitignore
  2. BIN
      .tmb/l1_d3AtY29udGVudC90aGVtZXMvY29zbW9wZXQtdGltYmVyL3NjcmVlbnNob3QucG5n1744272629.png
  3. 1
      .well-known/apple-developer-merchantid-domain-association
  4. 7378
      afc_fields.json
  5. 2
      wp-content/themes/cosmopet/404.php
  6. 1
      wp-content/themes/cosmopet/functions.php
  7. 11
      wp-content/themes/cosmopet/global-functions/global-constaints.php
  8. 94
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  9. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png
  10. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png.webp
  11. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png
  12. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png.webp
  13. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png
  14. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png.webp
  15. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png
  16. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png.webp
  17. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png
  18. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png.webp
  19. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png
  20. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png.webp
  21. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card-mb.png
  22. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card-mb.png.webp
  23. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card.png
  24. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card.png.webp
  25. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-1.png
  26. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-1.png.webp
  27. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-2.png
  28. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-2.png.webp
  29. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg-sm.png
  30. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg-sm.png.webp
  31. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg.png
  32. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg.png.webp
  33. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-card.png
  34. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-card.png.webp
  35. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-icon.png
  36. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-icon.png.webp
  37. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-star.png
  38. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-star.png.webp
  39. 23
      wp-content/themes/cosmopet/modules/blog/components/main-page-block/assets/js/main-page-blog.js
  40. 25
      wp-content/themes/cosmopet/modules/blog/components/main-page-block/component-controller.php
  41. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/assets/img/preview.png
  42. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/assets/img/preview.png.webp
  43. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/preview.png
  44. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/preview.png.webp
  45. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/preview.png
  46. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/preview.png.webp
  47. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/assets/img/preview.png
  48. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/assets/img/preview.png.webp
  49. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/assets/img/preview.png
  50. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/assets/img/preview.png.webp
  51. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/assets/img/preview.png
  52. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/assets/img/preview.png.webp
  53. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/assets/img/preview.png
  54. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/assets/img/preview.png.webp
  55. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/img/preview.png
  56. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/img/preview.png.webp
  57. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/assets/img/preview.png
  58. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/assets/img/preview.png.webp
  59. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/assets/img/preview.png
  60. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/assets/img/preview.png.webp
  61. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/assets/img/preview.png
  62. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/assets/img/preview.png.webp
  63. 49
      wp-content/themes/cosmopet/modules/blog/module-ajax-controller.php
  64. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg-sm.png
  65. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg-sm.png.webp
  66. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg.png
  67. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg.png.webp
  68. 27
      wp-content/themes/cosmopet/modules/forms/assets/css/forms.css
  69. 45
      wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php
  70. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/cat.png
  71. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/cat.png.webp
  72. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/dog.png
  73. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/dog.png.webp
  74. 129
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
  75. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Heavy.ttf
  76. 6
      wp-content/themes/cosmopet/modules/popup/assets/css/gp-style-desktop.css
  77. 24
      wp-content/themes/cosmopet/modules/popup/assets/js/modal.js
  78. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/modal/about_slider.png
  79. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/modal/about_slider.png.webp
  80. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/cat.png
  81. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/cat.png.webp
  82. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/dog.png
  83. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/dog.png.webp
  84. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/mini-cat.png
  85. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/mini-cat.png.webp
  86. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/mini-dog.png
  87. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/pet/mini-dog.png.webp
  88. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/product/image.png
  89. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/product/image.png.webp
  90. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/product/mini-card.png
  91. BIN
      wp-content/themes/cosmopet/modules/profile/assets/img/product/mini-card.png.webp
  92. 44
      wp-content/themes/cosmopet/modules/shop/components/product-card/assets/css/product-card.css
  93. 57
      wp-content/themes/cosmopet/modules/shop/components/product-card/assets/js/product-card.js
  94. 0
      wp-content/themes/cosmopet/modules/shop/components/product-card/component-controller.php
  95. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/cat.png
  96. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/cat.png.webp
  97. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/dog.png
  98. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/dog.png.webp
  99. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/mini-dog.png
  100. BIN
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/img/pet/mini-dog.png.webp
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -71,6 +71,7 @@ wp-content/plugins/*
*.tbk
*.csv
*.json
!afc_fields.json
*.BAK
# GP | Dirs & files
@ -84,6 +85,7 @@ timthumb_cache/
webstat/
.idea/
.tmb/
.well-known/
.csscomb.json
sftp-config.json
bower.json

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -6,4 +6,4 @@
$context = Timber::get_context();
Timber::render('templates/404.twig', $context);
?>
?>

@ -16,6 +16,7 @@ require_once __DIR__ . '/temp-functions/blog-logic.php';
require_once __DIR__ . '/temp-functions/filters-logic.php';
require_once __DIR__ . '/temp-functions/custom-admin-panel-logic.php';
require_once __DIR__ . '/temp-functions/login-logic.php';
// include_module('forms');
// include_module('shop');
// include_module('profile');

@ -0,0 +1,11 @@
<?php
add_action('wp_head', function() {
?>
<script>
window.ajax_url = '<?php echo admin_url('admin-ajax.php') ?>';
</script>
<?php
}, 1);

@ -1,15 +1,13 @@
<?php
/* Start | Работа с проверкой мультисайтовости и стендов */
global $site_env;
$site_env = new SiteEnvironment(); // глобальный объект выполняющий проверку по домену
class SiteEnvironment
{
public string $mode;
public string $region;
public function __construct(string $host = null)
{
$site_env = new SiteEnvironment();
class SiteEnvironment {
public string $site_mode;
public string $site_region;
public bool $is_gp_test_mode;
public function __construct(string $host = null) {
$map = [
'cosmopet.ru' => ['mode' => 'production', 'region' => 'ru'],
'cosmopet.ae' => ['mode' => 'production', 'region' => 'ae'],
@ -17,63 +15,41 @@ class SiteEnvironment
'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'];
$this->is_gp_test_mode = (isset($_GET['gp-test']) && $_GET['gp-test'] == '1') || (is_user_logged_in() && current_user_can('administrator'));
}
}
add_filter('timber/twig', function (\Twig\Environment $twig) {
global $site_env;
$twig->addGlobal('site_region', $site_env->site_region);
$twig->addGlobal('site_mode', $site_env->site_mode);
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option')); // со страницы "Общих настроек контента ACF"
$twig->addGlobal('site_env', $site_env);
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option'));
return $twig;
});
/* End | Работа с проверкой мультисайтовости и стендов */
add_filter('woocommerce_currency_symbol', function($currency_symbol, $currency) {
return $currency === 'AED' ? 'AED' : $currency_symbol;
}, 10, 2);
add_filter('woocommerce_currency_symbol', 'change_aed_currency_symbol', 10, 2);
function change_aed_currency_symbol($currency_symbol, $currency) {
if ($currency == 'AED') {
$currency_symbol = 'AED';
}
return $currency_symbol;
}
// Отключаем канонические ссылки и hreflang от Yoast SEO
add_filter('wpseo_canonical', '__return_false');
add_filter('wpseo_opengraph_url', '__return_false'); // Отключаем OG URL
add_filter('wpseo_add_x_default_hreflang', '__return_false'); // Отключаем hreflang от Yoast
add_filter('wpseo_disable_adjacent_rel_links', '__return_true'); // Отключаем соседние rel-ссылки
add_filter('wpseo_opengraph_url', '__return_false');
add_filter('wpseo_add_x_default_hreflang', '__return_false');
add_filter('wpseo_disable_adjacent_rel_links', '__return_true');
// Добавляем каноническую ссылку
add_action('wp_head', 'custom_canonical_url', 5);
function custom_canonical_url() {
add_action('wp_head', function() {
if (!is_admin()) {
// Защищаем от дублирования
static $canonical_added = false;
if ($canonical_added) {
return;
}
if ($canonical_added) return;
$canonical_added = true;
// Формируем текущий URL без лишних параметров
$current_url = trailingslashit(home_url($_SERVER['REQUEST_URI']));
// Удаляем возможные параметры запроса, если они не нужны
$current_url = strtok($current_url, '?');
$current_url = strtok(trailingslashit(home_url($_SERVER['REQUEST_URI'])), '?');
echo '<link rel="canonical" href="' . esc_url($current_url) . '" />' . "\n";
}
}
})
/**
@ -292,12 +268,26 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
}
// TO_DO: удалить, если не нужно
// Отключаем кэширование для страниц товаров
add_action('template_redirect', function() {
if (is_product()) {
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');
add_action('wp_head', function() {
global $site_env;
$show_pixel = false;
// Для продакшена
if ($site_env->site_mode === 'production' && $site_env->site_region === 'ae') {
$show_pixel = true;
}
});
// Для тестовых стендов AE
if ($site_env->site_mode === 'develope' && $site_env->site_region === 'ae') {
$show_pixel = true;
}
if ($show_pixel && !$site_env->is_gp_test_mode) {
$context = [
'pixel_event_type' => 'AddToCart', // или определите логику
'currency' => get_woocommerce_currency(),
// добавьте другие переменные при необходимости
];
\Timber\Timber::render('templates/head-pixel-functions.twig', $context);
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 KiB

After

Width:  |  Height:  |  Size: 416 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 902 B

@ -0,0 +1,23 @@
jQuery('.main-blog_tags-tag').on('click', function(){
var category = jQuery(this).data('category'); // Получаем значение data-category
jQuery('.main-blog_tags-tag').removeClass('active')
jQuery(this).addClass('active')
jQuery.ajax({
url: window.ajax_url,
type: 'POST',
data: {
action: 'front_page_get_blog_posts',
category: category
},
beforeSend: function() {
},
success: function(response) {
jQuery('.main-blog_wrapper').html(response)
},
error: function(error) {
// Обработка ошибок
console.error('Ошибка AJAX:', error);
}
});
});

@ -0,0 +1,25 @@
<?php
include_component('blog', 'themes');
add_filter('timber/context', function($context) {
$args = array(
'post_type' => 'post',
'posts_per_page' => 5,
'post_status' => 'publish', // Только опубликованные записи
);
$featured_query = new WP_Query($args);
$f_query = array();
$i = 0;
foreach($featured_query->posts as $item){
if ($i > 0){
$f_query[] = Timber::get_post($item, 'BlogPost');
}
else{
$featured_post = Timber::get_post($item, 'BlogPost');
}
$i++;
}
$context['blog_posts'] = $f_query;
$context['featured_post'] = $featured_post;
return $context;
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB

After

Width:  |  Height:  |  Size: 480 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 KiB

After

Width:  |  Height:  |  Size: 631 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 KiB

After

Width:  |  Height:  |  Size: 445 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 150 KiB

@ -44,3 +44,52 @@ add_action('wp_ajax_load_blog_posts', 'ajax_load_blog_posts');
add_action('wp_ajax_nopriv_load_blog_posts', 'ajax_load_blog_posts');
function ajax_front_page_get_blog_posts() {
$context = Timber::context();
$category = $_POST['category'];
$args = [
'post_type' => 'post',
'posts_per_page' => 5, // Adjust the number of posts per page
'paged' => intval($paged) + 1,
'post_status' => 'publish', // Только опубликованные записи
];
if (!empty($category)) {
$args['tax_query'] = [
[
'taxonomy' => 'category',
'field' => 'slug', // or 'term_id', 'name' depending on how you identify categories
'terms' => $category,
],
];
}
$featured_query = new WP_Query($args);
$f_query = array();
$i = 0;
foreach($featured_query->posts as $item){
if ($i > 0){
$f_query[] = Timber::get_post($item, 'BlogPost');
}
else{
$featured_post = Timber::get_post($item, 'BlogPost');
}
$i++;
}
$context['blog_posts'] = $f_query;
$context['featured_post'] = $featured_post;
$html = Timber::compile('/blog/blog-front-page-post-list_block.twig', $context);
echo $html;
wp_die();
}
add_action('wp_ajax_front_page_get_blog_posts', 'ajax_front_page_get_blog_posts');
add_action('wp_ajax_nopriv_front_page_get_blog_posts', 'ajax_front_page_get_blog_posts');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 91 KiB

@ -0,0 +1,27 @@
.mform-offer input, .mform-offer textarea {
width: 100%!important;
padding: 12px 15px!important;
border: none!important;
border-radius: 20px!important;
font-size: 16px!important;
background-color: white!important;
font-family: inherit;
}
.mform-offer select{
font-size: 16px;
width: 100%;
padding: 12px 0;
}
.form-select-label {
width: 100%;
padding: 0px 15px;
border: none;
border-radius: 20px;
font-size: 16px;
background-color: white;
}
.mform-parthnership.mform .mform-content{
color: #fff;
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, #ee6868 0%, #569ef0 57.69%);
}

@ -63,6 +63,51 @@ add_action('wp_ajax_nopriv_blogauth_form', function() {
});
add_action('wp_ajax_parthnership_form', function() {
$enabledHandlers = ['b24', 'email', 'tg'];
$user_data = get_current_user_data();
$formData = json_decode($_POST['formData']);
$crmData = array(
'phone' => $formData['phone'],
'name' => $formData['name'],
'email' => $formData['email'],
'msg' => 'Вид партнерства: ' . $formData['parthner_type'] . ' ' . $formData['msg'],
'url' => $formData['url'],
'stage' => 'C4:NEW',
'fName' => 4,
'order_total' => 0,
'user_id' => $user_data['user_id'],
'method' => 'crm.deal.add',
'form_title' => 'Стать партнером',
'is_subscribe' => false,
'order_id' => '',
);
process_form($enabledHandlers, $crmData);
});
add_action('wp_ajax_nopriv_parthnership_form', function() {
$enabledHandlers = ['b24', 'email', 'tg'];
$user_data = get_current_user_data();
$formData = json_decode($_POST['formData']);
$crmData = array(
'phone' => $formData['phone'],
'name' => $formData['name'],
'email' => $formData['email'],
'msg' => 'Вид партнерства: ' . $formData['parthner_type'] . ' ' . $formData['msg'],
'url' => $formData['url'],
'stage' => 'C4:NEW',
'fName' => 4,
'order_total' => 0,
'user_id' => $user_data['user_id'],
'method' => 'crm.deal.add',
'form_title' => 'Стать партнером',
'is_subscribe' => false,
'order_id' => '',
);
process_form($enabledHandlers, $crmData);
});
add_action('wp_ajax_contact_form', function() {
$enabledHandlers = ['b24', 'email', 'tg'];
$user_data = get_current_user_data();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -1,3 +1,10 @@
@font-face {
font-family: "Craftwork Grotesk";
src: local("CraftworkGrotesk-Heavy"),
url("../fonts/craftwork/CraftworkGrotesk-Heavy.ttf") format("ttf");
font-weight: 900;
}
@font-face {
font-family: "Craftwork Grotesk";
src: local("Craftwork Grotesk Bold"),
@ -160,6 +167,7 @@ body {
font-size: 20px;
font-weight: 400;
line-height: 24px;
font-family: inherit;
}
.form-inp::placeholder {
@ -167,7 +175,7 @@ body {
}
.form-inp:hover,
.form-inp:focus {
.form-inp:focus, .form-textarea:hover, .form-textarea:focus {
border-color: var(--main_black);
}
@ -175,11 +183,11 @@ body {
height: 96px;
width: 100%;
resize: none;
background: var(--main_white) !important;
border: 1px solid var(--placeholder) !important;;
background: var(--main_white);
border: 1px solid var(--placeholder);
padding: 12px 16px;
border-radius: 20px;
color: var(--main_black) !important;
color: var(--main_black);
font-size: 20px;
font-weight: 400;
line-height: 24px;
@ -379,14 +387,6 @@ textarea{
max-width: 380px;
}
.modal-offer input, textarea {
width: 100%!important;
padding: 12px 15px!important;
border: none!important;
border-radius: 20px!important;
font-size: 16px!important;
background-color: white!important;
}
/* Контейнер для текстового поля и изображения автора */
.message-container {
@ -635,7 +635,6 @@ textarea{
height: 100%;
overflow: hidden;
transition: width .4s ease-out;
}
.modal__item{
height: 100%;
@ -2024,92 +2023,12 @@ textarea{
margin-left: auto;
}
.about_slider .prev, .about_slider .next {
position: absolute;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
z-index: 99;
background-color: unset;
}
.about_slider .next {
right: 29vw;
}
.about_slider .prev {
left: 29vw;
}
.about_slider .carousel-item {
height: 546px;
padding: 35px 50px 25px 50px;
padding: 50px 53px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
/* background: var(--creme-white, #F4F1F0); */
background: #ffffff30;
backdrop-filter: blur(6px);
z-index: 1;
box-shadow: -2px 5px 22.9px 0px rgba(0, 0, 0, 0.25);
}
.about_slider .swiper-slide-active {
backdrop-filter: blur(6px);
width: 429px!important;
z-index: 3;
}
.about_slider .carousel-item img {
width: auto;
}
.about_slider .slide_info {
display: flex;
flex-direction: column;
gap: 15px;
}
.about_slider .carousel-item::after {
content: '';
background-image: url(/wp-content/themes/cosmopet/static/front-page/img/border.png);
background-size: cover;
/* background: linear-gradient(21.69deg, #F44242 23.69%, #569EF0 66.57%); */
display: block;
position: absolute;
width: calc(100% + 4px);
height: calc(100% + 4px);
border-radius: 60px;
top: -2px;
left: -2px;
z-index: -2;
transform: translateZ(-1px);
}
.about_slider .slide_title {
text-transform: uppercase;
font-size: 24px;
font-weight: 700;
line-height: 28.8px;
color: #121212;
}
.about_slider .slide_text {
font-size: 20px;
font-weight: 500;
line-height: 24px;
color:#121212;
}
.discount_block .discount_cosmodog {
margin-top: 60px;
}
.about_slider .carousel .carousel-item {
border-radius: 60px!important;
}
.about_slider {
position: relative;
@ -2122,27 +2041,10 @@ textarea{
width: max-content;
}
.marketplace {
overflow: hidden!important;
}
.marketplace__swiper {
overflow: visible!important;
}
.about_us-title {
font-weight: 700;
}
.modal__aside {
width: 20vw;
right: -20vw;
transition: right 0.3s ease;
}
.modal__aside.active {
right: 0;
}
.button.loading::before {
content: '';
@ -2311,3 +2213,8 @@ textarea{
display: flex !important;
}
}
a, button{
cursor: pointer;
}

@ -7,8 +7,10 @@
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
background: white; /* Или твой стиль фона */
z-index: 1000;
min-width: max-content;
}
.modal__aside.active {
transform: translateX(0); /* Показываем, сдвигая влево */
}
@ -37,13 +39,15 @@
@media (max-width: 720px) {
.modal__aside {
width: 100% !important; /* Полная ширина на мобильных */
min-width: 100%;
}
}
@media (min-width: 721px) {
.modal__aside {
min-width: 400px; /* Минимальная ширина или твоя фиксированная ширина */
min-width: max-content; /* Минимальная ширина или твоя фиксированная ширина */
width: auto;
width: 400px;
}
}

@ -95,6 +95,22 @@ window.addEventListener('resize', () => {
modalClose('.modal__close, .m__close');
});
let width = window.innerWidth; // Используем innerWidth для актуальной ширины окна
let modalItem = document.querySelectorAll('.modal__item');
let aside = document.querySelector('.modal__aside');
modalItem.forEach(modal => {
if (modal.classList.contains('active')) {
if (width <= 720) {
aside.style.width = '100%'; // Полная ширина на мобильных
} else {
let openAside = document.querySelector('.modal__item.active'),
newWidth = openAside.clientWidth;
aside.style.width = newWidth < 400 ? '400px' : `${newWidth}px`;
}
}
});
jQuery('[data-pname]').on('click', function(){
jQuery('#sub_product_name').val(jQuery(this).data('pname'))
})
@ -153,4 +169,10 @@ function showModal(modalClass) {
modal.style.display = 'none';
}
});
});
});
jQuery('.main-about_banner-overlay__list-item').on('click', function(){
showModal('modal-parthnership');
jQuery('#parthnership-select').val(jQuery(this).data('dir'));
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -0,0 +1,44 @@
.main-food_products-cardbottom-btn .spinner{
height: 17px;
width: 17px;
}
.main-food_products-cardbottom-btn.loading::after{
opacity: 0;
}
.main-food_products-card-title{
width: 100%;
}
.main-food_products-card__weight{
padding: 8px;
border-radius: 36px;
background-color: #fff;
display: flex;
justify-content: space-around;
margin-bottom: 10px;
}
.main-food_products-card__weight:empty{
display: none;
}
.main-food_products-card__weight-item{
font-weight: 600;
font-size: 16px;
text-transform: uppercase;
color: rgba(18, 18, 18, 0.75);
border-radius: 100px;
padding: 2px 8px;
}
.main-food_products-card__weight-item.active{
border: 2px solid var(--accent-color);
color: var(--accent-color);
}
@media (max-width: 640px) {
.main-food_products-card__weight{
display: none;
}
}

@ -0,0 +1,57 @@
jQuery(document).ready(function() {
//productswiper
var productSwiper = new Swiper('.main-food_products-card-slider', {
effect: 'fade',
fadeEffect: { crossFade: true },
loop: true,
pagination: {
el: '.swiper-dots',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
},
});
jQuery('[data-image-set]').on('click', function() {
// Получаем родительский элемент карточки продукта
var productCard = jQuery(this).closest('.main-food_products-card');
jQuery(productCard).find('.main-food_products-card__weight-item').removeClass('active')
jQuery(this).addClass('active')
// Получаем массив изображений из data-атрибута
var images = jQuery(this).data('image-set');
console.log(images)
// Находим слайдер внутри этой карточки
var slider = productCard.find('.main-food_products-card-slider .swiper-wrapper');
// Очищаем текущие слайды
slider.empty();
// Добавляем новые слайды с изображениями
jQuery.each(images, function(index, image) {
slider.append(
'<div class="swiper-slide">' +
'<div class="main-food_products-card-img">' +
'<img src="' + image + '" alt="' + productCard.find('.product-title').text() + '">' +
'</div>' +
'</div>'
);
});
slider.append(
'<div class="swiper-dots"></div>'
);
productSwiper = new Swiper('.main-food_products-card-slider', {
effect: 'fade',
fadeEffect: { crossFade: true },
loop: true,
pagination: {
el: '.swiper-dots',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
},
});
jQuery(productCard).find('.main-food_products-card-title').html(jQuery(this).data('title'))
jQuery(productCard).find('.main-food_products-card-bottom-price').html(jQuery(this).data('product_price'))
jQuery(productCard).find('.main-food_products-cardbottom-btn').attr('data-product_id', jQuery(this).data('product_id'))
jQuery(productCard).find('.main-food_products-cardbottom-btn').attr('href', '?add-to-cart=' + jQuery(this).data('product_id'))
});
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save