Обновления 06062025

dev_87
mrkapa 2 months ago
parent 9bc4a01833
commit b2ef19f829
  1. 6
      wp-content/themes/cosmopet/archive-blog_author.php
  2. 211
      wp-content/themes/cosmopet/comments.php
  3. 1748
      wp-content/themes/cosmopet/composer-setup.php
  4. 8
      wp-content/themes/cosmopet/composer.json
  5. 59
      wp-content/themes/cosmopet/composer.lock
  6. 948
      wp-content/themes/cosmopet/functions.php
  7. 261
      wp-content/themes/cosmopet/global-functions/core-functions.php
  8. 1566
      wp-content/themes/cosmopet/global-functions/multilang-functions.php
  9. 185
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  10. 1
      wp-content/themes/cosmopet/home.php
  11. 728
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-desktop.css
  12. 120
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-mobile.css
  13. 44
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-tablet.css
  14. 3
      wp-content/themes/cosmopet/modules/author/assets/img/arrow-down.svg
  15. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png
  16. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png
  17. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png
  18. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png
  19. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png
  20. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png
  21. 11
      wp-content/themes/cosmopet/modules/author/assets/img/bars.svg
  22. 3
      wp-content/themes/cosmopet/modules/author/assets/img/basket-icon.svg
  23. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/favicon.ico
  24. 3
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-1.svg
  25. 3
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-2.svg
  26. 6
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-3.svg
  27. 3
      wp-content/themes/cosmopet/modules/author/assets/img/header-red.svg
  28. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart-grey.svg
  29. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart-white.svg
  30. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart.svg
  31. 18
      wp-content/themes/cosmopet/modules/author/assets/img/indent-icon-1.svg
  32. 11
      wp-content/themes/cosmopet/modules/author/assets/img/logo-green.svg
  33. 3
      wp-content/themes/cosmopet/modules/author/assets/img/logo.svg
  34. 3
      wp-content/themes/cosmopet/modules/author/assets/img/long-arrow.svg
  35. 4
      wp-content/themes/cosmopet/modules/author/assets/img/minus-icon.svg
  36. 11
      wp-content/themes/cosmopet/modules/author/assets/img/msg-green.svg
  37. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg-grey.svg
  38. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg-white.svg
  39. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg.svg
  40. 18
      wp-content/themes/cosmopet/modules/author/assets/img/plus-icon.svg
  41. 5
      wp-content/themes/cosmopet/modules/author/assets/img/swp-next.svg
  42. 5
      wp-content/themes/cosmopet/modules/author/assets/img/swp-prev.svg
  43. 4
      wp-content/themes/cosmopet/modules/author/assets/img/user-icon.svg
  44. 46
      wp-content/themes/cosmopet/modules/author/assets/js/author-posts-ajax.js
  45. 48
      wp-content/themes/cosmopet/modules/author/assets/js/main.js
  46. 54
      wp-content/themes/cosmopet/modules/author/components/author-archive/component-controller.php
  47. 41
      wp-content/themes/cosmopet/modules/author/components/author-single/component-controller.php
  48. 35
      wp-content/themes/cosmopet/modules/author/module-ajax-controller.php
  49. 65
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
  50. 10
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-mobile.css
  51. 198
      wp-content/themes/cosmopet/modules/blog/assets/js/comments.js
  52. 200
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/css/style.css
  53. 3
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/header-red.svg
  54. 11
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/msg-green.svg
  55. 4
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-desktop.css
  56. 3
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/img/heart-grey.svg
  57. 3
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/img/msg-grey.svg
  58. 3
      wp-content/themes/cosmopet/modules/blog/components/most-read/assets/img/heart-white.svg
  59. 3
      wp-content/themes/cosmopet/modules/blog/components/most-read/assets/img/msg-white.svg
  60. 23
      wp-content/themes/cosmopet/modules/blog/components/most-read/component-controller.php
  61. 3
      wp-content/themes/cosmopet/modules/blog/components/news-list/assets/img/heart-grey.svg
  62. 3
      wp-content/themes/cosmopet/modules/blog/components/news-list/assets/img/msg-grey.svg
  63. 334
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-desktop.css
  64. 83
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-tablet.css
  65. 0
      wp-content/themes/cosmopet/modules/blog/components/single/assets/js/comments.js
  66. 147
      wp-content/themes/cosmopet/modules/blog/components/single/assets/js/post-likes.js
  67. 2
      wp-content/themes/cosmopet/modules/blog/components/single/component-controller.php
  68. 67
      wp-content/themes/cosmopet/modules/blog/module-controller.php
  69. 52
      wp-content/themes/cosmopet/modules/footer/assets/css/gp-style-desktop.css
  70. 957
      wp-content/themes/cosmopet/modules/footer/assets/js/footer.js
  71. 174
      wp-content/themes/cosmopet/modules/footer/module-controller.php
  72. 173
      wp-content/themes/cosmopet/modules/forms/assets/js/form.js
  73. 4004
      wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css
  74. 0
      wp-content/themes/cosmopet/modules/forms/components/discount/component-controller.php
  75. 4
      wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php
  76. 62
      wp-content/themes/cosmopet/modules/forms/module-controller.php
  77. 30
      wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css
  78. 151
      wp-content/themes/cosmopet/modules/header/assets/js/core.js
  79. 16
      wp-content/themes/cosmopet/modules/header/module-controller.php
  80. 1923
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
  81. 1418
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-full.css
  82. 18
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-normalize.css
  83. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Bold.woff
  84. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Bold.woff2
  85. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Medium.woff
  86. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Medium.woff2
  87. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Regular.woff
  88. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-Regular.woff2
  89. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-SemiBold.woff
  90. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/CraftworkGrotesk-SemiBold.woff2
  91. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/craftwork-grotesk-bold.ttf
  92. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/craftwork-grotesk-medium.ttf
  93. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/craftwork-grotesk-regular.ttf
  94. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/craftwork/craftwork-grotesk-semi-bold.ttf
  95. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-demi.ttf
  96. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-demi.woff
  97. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-demi.woff2
  98. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-regular.ttf
  99. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-regular.woff
  100. BIN
      wp-content/themes/cosmopet/modules/layout/assets/fonts/din-2014/din-2014-rounded-regular.woff2
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,6 @@
<?php
include_module('author');
include_component('author', 'author-archive');
?>

@ -0,0 +1,211 @@
<?php
if (!defined('ABSPATH')) {
exit;
}
function count_nested_replies($comment_id) {
$count = 0;
$replies = get_comments(array(
'post_id' => get_the_ID(),
'status' => 'approve',
'parent' => $comment_id,
'order' => 'ASC'
));
if ($replies) {
$count += count($replies);
foreach ($replies as $reply) {
$count += count_nested_replies($reply->comment_ID);
}
}
return $count;
}
if (post_password_required()) {
return;
}
if (!is_user_logged_in()) {
?>
<div class="comment-block">
<p class="comment-block_text">
<a href="#modal"><?php pll_e('Войдите'); ?></a>, <?php pll_e('чтобы оставлять комментарии'); ?>
</p>
</div>
<?php
}
$top_level_comments = get_comments(array(
'post_id' => get_the_ID(),
'status' => 'approve',
'parent' => 0,
'order' => 'ASC'
));
if ($top_level_comments) {
echo '<div class="comment-block_wrapper">';
foreach ($top_level_comments as $comment) {
?>
<div class="comment-block" id="comment-<?php echo $comment->comment_ID; ?>">
<div class="comment-user">
<?php echo get_avatar($comment, 50); ?>
<div class="comment-user_text">
<h6><?php echo get_comment_author($comment); ?></h6>
<span><?php echo get_comment_date('d F Y', $comment); ?></span>
</div>
</div>
<p><?php echo get_comment_text($comment); ?></p>
<div class="comment-btns">
<button class="reply-to-comment" data-comment-id="<?php echo $comment->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($comment)); ?>">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path>
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path>
</svg>
<?php pll_e('Ответить'); ?>
</button>
<button class="comment-like-btn<?php echo is_user_liked_comment($comment->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $comment->comment_ID; ?>">
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($comment->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
</svg>
<?php echo get_comment_likes_count($comment->comment_ID); ?>
</button>
<?php
comment_reply_link(array(
'reply_text' => pll__('Ответить'),
'depth' => 1,
'max_depth' => get_option('thread_comments_depth'),
'before' => '<span style="display:none;">',
'after' => '</span>',
), $comment->comment_ID, get_the_ID());
?>
</div>
<div class="reply-form-container" id="reply-form-<?php echo $comment->comment_ID; ?>" style="display: none;"></div>
</div>
<?php
$all_nested_replies = get_all_nested_replies($comment->comment_ID);
if (!empty($all_nested_replies)) {
$total_reply_count = count($all_nested_replies);
?>
<button class="answer-btn">
<svg width="15" height="10" viewBox="0 0 15 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 1.41406L7.5 7.91406L1 1.41406" stroke="#76CE75" stroke-width="2"></path>
</svg>
<?php echo $total_reply_count; ?>
<span>
<?php echo ($total_reply_count == 1) ? pll__('ответ') : pll__('ответа'); ?>
</span>
</button>
<?php
foreach ($all_nested_replies as $reply) {
?>
<div class="comment-block answer-block" id="comment-<?php echo $reply->comment_ID; ?>">
<div class="comment-user">
<?php echo get_avatar($reply, 50); ?>
<div class="comment-user_text">
<h6><?php echo get_comment_author($reply); ?></h6>
<span><?php echo get_comment_date('d F Y', $reply); ?></span>
</div>
</div>
<p><?php echo get_comment_text($reply); ?></p>
<div class="comment-btns">
<button class="reply-to-comment" data-comment-id="<?php echo $reply->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($reply)); ?>">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path>
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path>
</svg>
<?php pll_e('Ответить'); ?>
</button>
<button class="comment-like-btn<?php echo is_user_liked_comment($reply->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $reply->comment_ID; ?>">
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($reply->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
</svg>
<?php echo get_comment_likes_count($reply->comment_ID); ?>
</button>
<?php
comment_reply_link(array(
'reply_text' => pll__('Ответить'),
'depth' => 2,
'max_depth' => get_option('thread_comments_depth'),
'before' => '<span style="display:none;">',
'after' => '</span>',
), $reply->comment_ID, get_the_ID());
?>
</div>
<div class="reply-form-container" id="reply-form-<?php echo $reply->comment_ID; ?>" style="display: none;"></div>
</div>
<?php
}
}
}
echo '</div>';
}
function get_all_nested_replies($comment_id) {
$all_replies = array();
$direct_replies = get_comments(array(
'post_id' => get_the_ID(),
'status' => 'approve',
'parent' => $comment_id,
'order' => 'ASC'
));
$all_replies = array_merge($all_replies, $direct_replies);
foreach ($direct_replies as $reply) {
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID);
$all_replies = array_merge($all_replies, $deeper_replies);
}
return $all_replies;
}
function get_all_nested_replies_recursive($comment_id) {
$replies = get_comments(array(
'post_id' => get_the_ID(),
'status' => 'approve',
'parent' => $comment_id,
'order' => 'ASC'
));
$all_replies = $replies;
foreach ($replies as $reply) {
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID);
$all_replies = array_merge($all_replies, $deeper_replies);
}
return $all_replies;
}
if (is_user_logged_in()) {
$commenter = wp_get_current_commenter();
$args = array(
'fields' => array(
'author' => '',
'email' => '',
'url' => '',
'cookies' => '',
),
'comment_field' => '<div class="comment-form-comment"><textarea id="comment" name="comment" placeholder="' . pll__('Ваш комментарий') . '" required></textarea></div>',
'title_reply' => pll__('Оставить комментарий'),
'title_reply_to' => pll__('Ответить %s'),
'class_submit' => 'comment-submit-btn',
'submit_button' => '<button name="%1$s" type="submit" id="%2$s" class="%3$s">%4$s</button>',
'submit_field' => '<div class="form-submit">%1$s %2$s</div>',
'cancel_reply_link' => pll__('Отменить'),
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h3>',
);
comment_form($args);
}
?>

File diff suppressed because it is too large Load Diff

@ -1,5 +1,11 @@
{
"require": {
"timber/timber": "^2.1"
"timber/timber": "^2.1",
"mindkomm/timber-integration-woocommerce": "^1.0"
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6da1f9205429be4e1609181ef22acad2",
"content-hash": "361ab752c076e0fc5ea94a3756fab8a1",
"packages": [
{
"name": "composer/installers",
@ -152,6 +152,55 @@
],
"time": "2024-06-24T20:46:46+00:00"
},
{
"name": "mindkomm/timber-integration-woocommerce",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/mindkomm/timber-integration-woocommerce.git",
"reference": "bddcccba2fe7d58d53e81fc8f5d293fdc6e25b57"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mindkomm/timber-integration-woocommerce/zipball/bddcccba2fe7d58d53e81fc8f5d293fdc6e25b57",
"reference": "bddcccba2fe7d58d53e81fc8f5d293fdc6e25b57",
"shasum": ""
},
"require": {
"php": "^7.4 || ^8.0",
"timber/timber": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Timber\\Integrations\\WooCommerce\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Lukas Gächter",
"email": "lukas.gaechter@mind.ch",
"homepage": "https://www.mind.ch"
}
],
"description": "WooCommerce integration for Timber.",
"keywords": [
"integration",
"timber",
"twig",
"woocommerce"
],
"support": {
"docs": "https://github.com/mindkomm/timber-integration-woocommerce#documentation",
"issues": "https://github.com/mindkomm/timber-integration-woocommerce/issues",
"source": "https://github.com/mindkomm/timber-integration-woocommerce"
},
"time": "2024-05-08T09:54:00+00:00"
},
{
"name": "symfony/deprecation-contracts",
"version": "v3.0.2",
@ -716,10 +765,10 @@
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.1.0"
"platform": {},
"platform-dev": {},
"plugin-api-version": "2.6.0"
}

@ -1,6 +1,6 @@
<?php
// requere once вместо include использовать!
// require once вместо include использовать!
// доделать example module и component
require_once __DIR__ . '/vendor/autoload.php';
@ -14,6 +14,26 @@ Timber::$dirname = [
],
];
use Timber\PostCollection;
use Timber\Integrations\WooCommerce\Product as TimberProduct;
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();
}
});
function theme_add_woocommerce_support()
{
add_theme_support('woocommerce');
@ -22,6 +42,14 @@ function theme_add_woocommerce_support()
add_action('after_setup_theme', 'theme_add_woocommerce_support');
add_theme_support('post-thumbnails');
add_action('after_setup_theme', function() {
add_theme_support('comments');
update_option('default_comment_status', 'open');
});
//Подруключение всех ajax controller если запрос сделан по ajax
@ -124,7 +152,7 @@ add_action('wp_enqueue_scripts', function() use ($module_name, $module_dir) {
$css_files = scandir($css_dir);
// Приоритетные файлы
$priority_files = [
$priority_files = [
'normalize.css',
'gp-style-core.css',
'gp-style-desktop.css',
@ -395,6 +423,922 @@ requireShortcodes(get_template_directory() . '/modules');
require_once('modules/blog/module-ajax-controller.php');
require_once('modules/forms/module-ajax-controller.php');
require_once('modules/shop/module-ajax-controller.php');
require_once('modules/profile/module-ajax-controller.php');
add_action('wp', 'my_custom_checkout_code');
function my_custom_checkout_code() {
if (function_exists('is_checkout') && is_checkout() && !is_order_received_page()) {
include_component('shop', 'checkout');
}
}
require_once('modules/author/module-ajax-controller.php');
include_module('forms');
include_module('layout');
class WooProduct extends Timber\Post {
protected $wc_product;
public function __construct ($pid = null) {
parent::__construct($pid);
$this->wc_product = wc_get_product($this->ID);
}
public function price() {
return $this->wc_product->get_price();
}
public function get_price_html() {
return $this->wc_product->get_price_html();
}
public function get_attr() {
return $this->wc_product->get_attribute('pa_compound');
}
public function get_test() {
return 'test';
}
};
add_filter('timber/post/classmap', function ($classmap) {
$custom_classmap = [
'product' => WooProduct::class,
];
return array_merge($classmap, $custom_classmap);
});
//Ajax подгрузка товаров в архиве
add_action( 'wp_ajax_nopriv_get_products', 'get_products' );
add_action( 'wp_ajax_get_products', 'get_products' );
function get_products() {
global $post;
if (function_exists('WC')) {
WC();
}
// Потом Timber
$context = Timber::context();
$context['get_page'] = empty($_POST['get_page']) ? 1 : $_POST['get_page'];
$context['criteria_for_new_product'] = date('Y-m-d', strtotime('-30 days'));
$context['get_category'] = isset($_POST['get_category']) ? $_POST['get_category'] : NULL;
$context['get_category_type'] = isset($_POST['get_category_type']) ? $_POST['get_category_type'] : NULL;
// Задаем количество постов для подзагрузки Ajax
$posts_per_page = 12;
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => $posts_per_page,
'paged' => $context['get_page'],
'has_password' => FALSE
);
$count_args = array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => -1,
'has_password' => FALSE
);
if ($context['get_category'] != NULL) {
$categories = [
'tax_query' => array(
array(
'taxonomy' => $context['get_category_type'],
'field' => 'term_id',
'terms' => array($context['get_category']),
'operator' => 'IN'
),
array(
'taxonomy' => 'product_visibility',
'field' => 'slug',
'terms' => 'exclude-from-catalog',
'operator' => 'NOT IN'
)
)
];
$args = array_merge($args, $categories);
$count_args = array_merge($count_args, $categories);
}
$products = new WP_Query($args);
$products = new Timber\PostQuery($products, 'Timber\Integrations\WooCommerce\Product');
$context['posts'] = $products;
$context['count'] = count(Timber::get_posts($count_args));
if ($context['count'] <= $context['get_page'] * $posts_per_page) {
$context['ended'] = true;
}
Timber::render( 'woocommerce/archive-product/archive-product-ajaxload.twig', $context );
die();
}
function get_product_info ($id, $type) {
if (!$id) {
return '';
}
$product = wc_get_product($id);
if (!$product) {
return '';
}
if ($type == 'price') {
return $product->get_price();
} elseif ($type == 'weight') {
return $product->get_weight() ? $product->get_weight() . ' кг' : '';
}
return '';
}
function get_add_to_cart_button ($id) {
$product = wc_get_product( $id );
return '<a href="'. $product->add_to_cart_url(). '" value="'. esc_attr( $product->get_id() ) .'"
class="ajax_add_to_cart add_to_cart_button button button--gradient button--base button--100-perc" data-product_id="'. $id .'">'. pll__('Добавить в корзину') .'</a>';
}
function get_collection_siblings ($term) {
if (!$term) {
return [];
}
$args = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order' => 'ASC',
'order_by' => 'name',
'tax_query' => [
[
'taxonomy' => 'pa_collection',
'terms' => $term,
'field' => 'id',
]
],
);
$siblings = get_posts($args);
$sibl_arr = [];
foreach( $siblings as $sibling ) {
$sibl_arr [] = $sibling;
}
return $sibl_arr;
}
register_sidebar( array(
'name' => 'Сайдбар для фильтров товаров',
'id' => 'sidebar_filters',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
// Define encryption secret key
define('SECRET', 'fT54ehYtt87@q1A');
/**
* Email Validation
* Validates the format of the provided email via AJAX.
*/
add_action('wp_ajax_email_validate', 'email_validate');
add_action('wp_ajax_nopriv_email_validate', 'email_validate');
function email_validate() {
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
header("Content-Type: application/json");
echo json_encode(array(
'status' => 'error',
'text' => esc_html__('Invalid email format', 'woodmart')
));
}
wp_die();
}
/**
* Send Verification Code
* Generates a random code, encrypts it, stores it in a cookie, and sends it via email.
*/
add_action('wp_ajax_send_code', 'send_code');
add_action('wp_ajax_nopriv_send_code', 'send_code');
function send_code() {
$email = $_POST['email'];
// Generate a random 4-digit code
$string = rand(1234, 9999);
$ciphering = "AES-128-CTR";
$options = 0;
$iv = '1234567891011121';
$encryption = openssl_encrypt($string, $ciphering, SECRET, $options, $iv);
// Store encrypted code in a cookie for 5 minutes
setcookie('login_code', $encryption, time() + 60 * 5, '/');
// Prepare email content based on language
if (function_exists('pll_current_language') && pll_current_language() === 'ru') {
$subject = "Проверочный код Cosmopet -" . $string;
$message = "Привет, это Cosmopet.\n
Держите проверочный код!\n
" . $string;
} else {
$subject = "Cosmopet Verification Code -" . $string;
$message = "Hello, this is CosmoPet.\n
Here's your verification code!\n
" . $string;
}
// Remove email filters for consistent sending
remove_all_filters('wp_mail_from');
remove_all_filters('wp_mail_from_name');
$headers = array(
'From: Cosmopet <pro@cosmopet.shop>',
'content-type: text/html; charset=utf-8',
);
// Send email
wp_mail($email, $subject, $message, $headers);
wp_die();
}
/**
* Check Verification Code
* Validates the user-entered code, logs in or registers the user.
*/
add_action('wp_ajax_check_code', 'check_code');
add_action('wp_ajax_nopriv_check_code', 'check_code');
function check_code() {
header("Content-Type: application/json");
$code = $_POST['code'];
$email = $_POST['email'];
// Generate a random 12-character password
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#!()';
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < 12; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
$pass = implode($pass);
// Check if verification code cookie exists
if (isset($_COOKIE['login_code'])) {
$string = $_COOKIE['login_code'];
$ciphering = "AES-128-CTR";
$options = 0;
$iv = '1234567891011121';
$decryption = openssl_decrypt($string, $ciphering, SECRET, $options, $iv);
if ($decryption === $code) {
if (email_exists($email)) {
// Log in existing user
$user_id = get_user_by('login', $email)->ID;
if (empty($user_id)) {
$user_id = get_user_by('email', $email)->ID;
}
wp_set_password($pass, $user_id);
wp_signon(
array(
'user_login' => $email,
'user_password' => $pass,
'remember' => 'on',
)
);
echo json_encode(array(
'status' => 'success_auth'
));
if (function_exists('update_field')) {
update_field('activated', true, 'user_' . $user_id); // Requires ACF
}
exit();
} else {
// Register new user
$user_id = wp_create_user($email, $pass, $email);
wp_update_user([
'ID' => $user_id,
'user_email' => $email
]);
wp_set_auth_cookie($user_id, true);
echo json_encode(array(
'status' => 'success_reg'
));
if (function_exists('update_field')) {
update_field('activated', true, 'user_' . $user_id); // Requires ACF
}
exit();
}
} else {
echo json_encode(array(
'status' => 'error',
'text' => esc_html__('Invalid code', 'woodmart')
));
exit();
}
} else {
echo json_encode(array(
'status' => 'error',
'text' => esc_html__('The code hasexpired', 'woodmart')
));
exit();
}
wp_die();
}
/**
* Logout Redirect
* Redirects to the homepage after user logout.
*/
add_action('wp_logout', 'logout_redirect');
function logout_redirect() {
wp_redirect('/');
exit();
}
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );
function add_comment_like() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$wpdb->show_errors();
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$comment_id = isset($_POST['comment_id']) ? intval($_POST['comment_id']) : 0;
$user_id = get_current_user_id();
if ($comment_id) {
$comment_exists = get_comment($comment_id);
if (!$comment_exists) {
echo '0';
die();
}
$existing_like = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
$comment_id, $user_id
));
if (!$existing_like) {
$result = $wpdb->insert(
$table_name,
array(
'user_id' => $user_id,
'comment_id' => $comment_id,
'date_added' => current_time('mysql')
),
array('%d', '%d', '%s')
);
} else {
$result = $wpdb->delete(
$table_name,
array(
'user_id' => $user_id,
'comment_id' => $comment_id
),
array('%d', '%d')
);
}
$likes = get_comment_likes_count($comment_id);
wp_send_json(array(
'count' => $likes,
'is_liked' => !$existing_like
));
} else {
wp_send_json(array('count' => 0, 'is_liked' => false));
}
die();
}
add_action('wp_ajax_add_comment_like', 'add_comment_like');
function add_post_like() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
$user_id = get_current_user_id();
if ($post_id) {
$existing_like = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
$post_id, $user_id
));
if (!$existing_like) {
$wpdb->insert(
$table_name,
array(
'user_id' => $user_id,
'post_id' => $post_id,
'date_added' => current_time('mysql')
),
array('%d', '%d', '%s')
);
} else {
$wpdb->delete(
$table_name,
array(
'user_id' => $user_id,
'post_id' => $post_id
),
array('%d', '%d')
);
}
$likes = get_post_likes_count($post_id);
wp_send_json(array(
'count' => $likes,
'is_liked' => !$existing_like
));
}
die();
}
add_action('wp_ajax_add_post_like', 'add_post_like');
function check_user_likes() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$user_id = get_current_user_id();
$liked_posts = $wpdb->get_col($wpdb->prepare(
"SELECT post_id FROM $table_name WHERE user_id = %d AND post_id > 0",
$user_id
));
$liked_comments = $wpdb->get_col($wpdb->prepare(
"SELECT comment_id FROM $table_name WHERE user_id = %d AND comment_id > 0",
$user_id
));
$response = array(
'posts' => $liked_posts,
'comments' => $liked_comments
);
echo json_encode($response);
die();
}
add_action('wp_ajax_check_user_likes', 'check_user_likes');
function get_post_likes_count($post_id) {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$count = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d",
$post_id
));
return $count ? $count : 0;
}
function get_comment_likes_count($comment_id) {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$count = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d",
$comment_id
));
return $count ? $count : 0;
}
function is_user_liked_post($post_id) {
if (!is_user_logged_in()) {
return false;
}
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$user_id = get_current_user_id();
$result = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
$post_id, $user_id
));
return $result > 0;
}
function is_user_liked_comment($comment_id) {
if (!is_user_logged_in()) {
return false;
}
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$user_id = get_current_user_id();
$result = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
$comment_id, $user_id
));
return $result > 0;
}
add_filter('comment_form_logged_in', '__return_empty_string');
// Создание таблицы
function create_likes_table() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
id bigint(20) NOT NULL AUTO_INCREMENT,
user_id bigint(20) NOT NULL,
post_id bigint(20) DEFAULT '0',
comment_id bigint(20) DEFAULT '0',
date_added datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY post_id (post_id),
KEY comment_id (comment_id),
KEY user_id (user_id),
UNIQUE KEY user_post (user_id, post_id, comment_id)
) $charset_collate;";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
add_action('after_switch_theme', 'create_likes_table');
add_filter('woocommerce_product_data_tabs', function($tabs) {
$tabs['composition_tab'] = array(
'label' => 'Состав',
'target' => 'composition_product_data',
'class' => array('composition_tab'),
'priority' => 60,
);
$tabs['feeding_tab'] = array(
'label' => 'Рекомендации по кормлению',
'target' => 'feeding_product_data',
'class' => array('feeding_tab'),
'priority' => 61,
);
$tabs['important_tab'] = array(
'label' => 'Важно',
'target' => 'important_product_data',
'class' => array('important_tab'),
'priority' => 62,
);
return $tabs;
});
add_action('woocommerce_product_data_panels', function() {
global $post;
$composition = get_post_meta($post->ID, '_composition', true);
echo '<div id="composition_product_data" class="panel woocommerce_options_panel">';
woocommerce_wp_textarea_input([
'id' => '_composition',
'label' => 'Состав',
'desc_tip' => true,
'description' => 'Введите состав товара',
'value' => $composition
]);
echo '</div>';
});
add_action('woocommerce_product_data_panels', function() {
global $post;
$feeding = get_post_meta($post->ID, '_feeding_recommendations', true);
echo '<div id="feeding_product_data" class="panel woocommerce_options_panel">';
woocommerce_wp_textarea_input([
'id' => '_feeding_recommendations',
'label' => 'Рекомендации по кормлению',
'desc_tip' => true,
'description' => 'Введите рекомендации по кормлению',
'value' => $feeding
]);
echo '</div>';
});
add_action('woocommerce_product_data_panels', function() {
global $post;
$important = get_post_meta($post->ID, '_important', true);
echo '<div id="important_product_data" class="panel woocommerce_options_panel">';
woocommerce_wp_textarea_input([
'id' => '_important',
'label' => 'Важно',
'desc_tip' => true,
'description' => 'Введите важную информацию',
'value' => $important
]);
echo '</div>';
});
add_action('woocommerce_process_product_meta', function($post_id) {
if (isset($_POST['_composition'])) {
update_post_meta($post_id, '_composition', sanitize_textarea_field($_POST['_composition']));
}
if (isset($_POST['_feeding_recommendations'])) {
update_post_meta($post_id, '_feeding_recommendations', sanitize_textarea_field($_POST['_feeding_recommendations']));
}
if (isset($_POST['_important'])) {
update_post_meta($post_id, '_important', sanitize_textarea_field($_POST['_important']));
}
});
// Добавление поля для выбора рекомендуемых товаров
function register_recommended_products_acf_field() {
if (function_exists('acf_add_local_field_group')) {
acf_add_local_field_group(array(
'key' => 'group_recommended_products',
'title' => 'Рекомендуемые товары',
'fields' => array(
array(
'key' => 'field_recommended_products',
'label' => 'Выберите рекомендуемые товары',
'name' => 'recommended_products',
'type' => 'relationship',
'instructions' => 'Выберите товары, которые будут отображаться в секции "вашему питомцу может понравиться"',
'required' => 0,
'conditional_logic' => 0,
'post_type' => array(
0 => 'product',
),
'filters' => array(
0 => 'search',
1 => 'taxonomy',
),
'return_format' => 'object',
'min' => '',
'max' => 8,
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'product',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
));
}
}
add_action('acf/init', 'register_recommended_products_acf_field');
add_action('wp_footer', 'remove_view_cart_button_js');
function remove_view_cart_button_js() {
?>
<script>
jQuery(document).ready(function($) {
$(document).on('added_to_cart', function() {
$('.added_to_cart.wc-forward').remove();
});
});
</script>
<?php
}
add_filter( 'script_loader_tag', function ( $tag, $handle, $src ) {
$module_handles = [
'shop-single-product-tabs', // для tabs.js
'shop-single-product-toggle', // для toggle.js
];
if ( in_array( $handle, $module_handles ) ) {
return '<script type="module" src="' . esc_url( $src ) . '"></script>';
}
return $tag;
}, 10, 3 );
// Для кнопки "Применить фильтр"
add_filter('wbw_filter_submit_button_text', 'change_wbw_filter_button_text');
function change_wbw_filter_button_text($text) {
return 'Ваш текст'; // Например, "Фильтровать" или "Поиск"
}
// Для кнопки сброса (если есть)
add_filter('wbw_filter_reset_button_text', 'change_wbw_reset_button_text');
function change_wbw_reset_button_text($text) {
return 'Сбросить';
}
add_action('wp_ajax_get_cart_fragment', 'get_cart_fragment_callback');
add_action('wp_ajax_nopriv_get_cart_fragment', 'get_cart_fragment_callback');
function get_cart_fragment_callback() {
// Проверяем nonce для безопасности
check_ajax_referer('woocommerce-cart', 'security', false);
// Получаем содержимое корзины
ob_start();
wc_get_template('shop/cart-contents.twig', [], '', get_template_directory() . '/templates/');
$contents = ob_get_clean();
// Получаем футер корзины
ob_start();
wc_get_template('modal-basket-footer.twig', [], '', get_template_directory() . '/templates/');
$footer = ob_get_clean();
// Получаем данные корзины
$cart = WC()->cart;
$count = $cart->get_cart_contents_count();
$total = $cart->get_total('raw'); // Числовая сумма
$total_html = wc_cart_totals_order_total_html(); // Форматированная сумма
wp_send_json_success([
'contents' => $contents,
'footer' => $footer,
'count' => $count,
'total' => $total_html,
'total_raw' => $total
]);
}
add_action('template_redirect', 'custom_redirect_cart_page');
function custom_redirect_cart_page() {
if (is_cart()) {
wp_redirect(home_url('/'));
exit;
}
}
add_action('wp_enqueue_scripts', 'remove_woocommerce_styles_on_checkout', 9999);
function remove_woocommerce_styles_on_checkout() {
// Проверяем, что мы на странице чекаута
if (function_exists('is_checkout') && is_checkout() && !is_order_received_page()) {
wp_deregister_style('woocommerce-layout');
wp_deregister_style('woocommerce-smallscreen');
wp_deregister_style('woocommerce-general');
// Дополнительно: отключить другие стили WooCommerce
wp_dequeue_style('select2');
wp_deregister_style('select2');
}
}
// Добавляем hreflang теги для cosmopet.shop
add_action('wp_head', 'custom_hreflang_shop', 6);
function custom_hreflang_shop() {
if (!is_admin() && function_exists('pll_get_post') && function_exists('pll_languages_list')) {
// Защищаем от дублирования
static $hreflang_added = false;
if ($hreflang_added) {
return;
}
$hreflang_added = true;
// Домены для языков
$ru_domain = 'https://cosmopet-test-ru.cp.good-production.xyz';
$en_domain = 'https://cosmopet-test-ae.cp.good-production.xyz';
// Текущий пост/страница
$current_post_id = get_the_ID();
if (!$current_post_id) {
// Для случаев, когда get_the_ID() не работает (например, архивы)
$current_path = trailingslashit($_SERVER['REQUEST_URI']);
$query_string = $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '';
$ru_url = $ru_domain . $current_path . $query_string;
$en_url = $en_domain . $current_path . $query_string;
} else {
// Получаем переводы поста/страницы
$ru_post_id = pll_get_post($current_post_id, 'ru');
$en_post_id = pll_get_post($current_post_id, 'en');
// Формируем URL с учетом перевода и параметров запроса
$query_string = $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '';
$ru_url = $ru_post_id ? get_permalink($ru_post_id) . $query_string : $ru_domain . trailingslashit($_SERVER['REQUEST_URI']) . $query_string;
$en_url = $en_post_id ? get_permalink($en_post_id) . $query_string : $en_domain . trailingslashit($_SERVER['REQUEST_URI']) . $query_string;
}
// Выводим hreflang-теги
echo '<link rel="alternate" hreflang="ru-RU" href="' . esc_url($ru_url) . '" />' . "\n";
echo '<link rel="alternate" hreflang="en-AE" href="' . esc_url($en_url) . '" />' . "\n";
}
}
add_action('wp_head', 'custom_checkout_padding');
function custom_checkout_padding() {
// Проверяем, что это страница Checkout
if (is_checkout() && !is_admin()) {
?>
<style type="text/css">
main.wrapper {
padding-top: 100px;
padding-bottom: 50px;
}
</style>
<?php
}
}
// Отправка кода и проверка Email
add_action( 'wp_ajax_email_activate', 'send_activation_email' );
add_action( 'wp_ajax_nopriv_email_activate', 'send_activation_email' );
function send_activation_email() {
error_log(123);
$user = wp_get_current_user();
$activation_key = sha1($user->user_email . time()); // Generate a unique activation key
update_field('uuid', $activation_key, 'user_' . get_current_user_id()); // Save the key in user meta
$activation_link = home_url("/activate/$activation_key");
if(pll_current_language() === 'ru'){
$subject = "Активация аккаунта COSMOPET -".$string;
$message = " Остался последний шаг!\n
Пройдите по ссылке для активации аккаунта:\n
".$activation_link;
} else {
$subject = "Account activation COSMOPET -".$string;
$message = "Last step!\n
Follow the link to activate your account\n
".$activation_link;
}
wp_mail($user->user_email, $subject, $message);
}
add_action('init', 'custom_register_activation_endpoint');
function custom_register_activation_endpoint() {
add_rewrite_rule('^activate/([^/]*)/?', 'index.php?activation_key=$matches[1]', 'top');
add_rewrite_tag('%activation_key%', '([^&]+)');
}
add_action('template_redirect', 'custom_handle_activation_request');
add_action('template_redirect', 'custom_handle_activation_request');
function get_user_by_acf_field_value($field_value) {
// Prepare the arguments for WP_User_Query
$args = array(
'meta_query' => array(
array(
'key' => 'uuid', // Change to your ACF field key
'value' => $field_value,
'compare' => '=', // You can use other comparison operators if needed
),
),
);
// Execute the query
$user_query = new WP_User_Query($args);
// Check for results
if (!empty($user_query->get_results())) {
return $user_query->get_results(); // Returns an array of WP_User objects
} else {
return null; // No users found
}
}
function custom_handle_activation_request() {
if (get_query_var('activation_key')) {
$activation_key = sanitize_text_field(get_query_var('activation_key'));
$users = get_user_by_acf_field_value($activation_key);
if ($users) {
foreach ($users as $user) {
$user->set_bio();
// delete_user_meta($user->ID, 'uuid'); // Clean up the activation key
update_field('uuid', '', 'user_' . $user->ID);
update_field('activated', true, 'user_' . $user->ID);
wp_set_auth_cookie($user->ID);
wp_redirect('/my-account/'); // Redirect to the homepage or a custom page
var_dump($user);
exit;
}
}
}
}

@ -1,2 +1,263 @@
<?php
add_action('template_redirect', 'redirect_non_logged_in_users');
function redirect_non_logged_in_users() {
// URL личного кабинета (замените 'your-account-page-slug' на ваш slug)
$account_page_slug = 'my-account-3';
$account_page_slug__2 = 'my-account';
// Проверяем, находится ли пользователь на странице личного кабинета
if (is_page($account_page_slug) && !is_user_logged_in() || is_page($account_page_slug__2) && !is_user_logged_in() ) {
wp_redirect(home_url()); // Перенаправляем на главную страницу
exit;
}
}
add_action('init', 'register_pets');
function register_pets(){
register_post_type('pets', array(
'labels' => array(
'name' => 'Питомцы', // Основное название типа записи
'singular_name' => 'Питомец', // отдельное название записи типа Book
'add_new' => 'Добавить нового',
'add_new_item' => 'Добавить нового питомца',
'edit_item' => 'Редактировать питомца',
'new_item' => 'Новый питомец',
'view_item' => 'Посмотреть питомца',
'search_items' => 'Найти питомца',
'not_found' => 'Питомцев не найдено',
'not_found_in_trash' => 'В корзине книг не найдено',
'parent_item_colon' => '',
'menu_name' => 'Питомцы'
),
'public' => false,
'show_ui' => true,
'supports' => array('title','editor')
) );
}
function get_pet_card($item){
?>
<?php
switch (get_field('weight')){
case ('below_1_5'):
$w = esc_html__('from 0,5 kg to 1,5 kg', 'woodmart' );
break;
case ('1_5-3'):
$w = esc_html__('from 1.5 to 3 kg', 'woodmart' );
break;
case ('3-5'):
$w = esc_html__('from 3 to 5 kg', 'woodmart' );
break;
case ('5-8'):
$w = esc_html__('from 5 to 8 kg', 'woodmart' );
break;
case ('8-11'):
$w = esc_html__('from 8 to 11 kg', 'woodmart' );
break;
case ('11-15'):
$w = esc_html__('from 11 to 15 kg', 'woodmart' );
break;
case ('15-20'):
$w = esc_html__('from 15 to 20 kg', 'woodmart' );
break;
case ('20-25'):
$w = esc_html__('from 20 to 25 kg', 'woodmart' );
break;
case ('25-35'):
$w = esc_html__('from 25 to 35 kg', 'woodmart' );
break;
case ('more_35'):
$w = esc_html__('More than 35 kg', 'woodmart' );
break;
}
switch (get_field('old')){
case ('normal'):
$old = esc_html__('Adult (from 1 year to 7 years)', 'woodmart' );
break;
case ('old'):
$old = esc_html__('Elderly (from 7 to 12 years)', 'woodmart' );
break;
case ('very_old'):
$old = esc_html__('Aging (12 years and older)', 'woodmart' );
break;
case ('baby'):
$old = esc_html__('Baby (from 0 to 1 year)' );
break;
}
switch (get_field('activity')){
case ('low'):
$act = esc_html__('Low', 'woodmart' );
break;
case ('moderate'):
$act = esc_html__('Moderate', 'woodmart' );
break;
case ('high'):
$act = esc_html__('High', 'woodmart' );
break;
}
?>
<div class="cabinet-card cabinet-card--green">
<div class="cabinet-card__content">
<div class="cabinet-card__pet">
<div class="cabinet-card-pet__icon">
<div class="cabinet-card-pet-icon__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/pet/mini-<?php echo get_field('type', $item) ?>.png" alt="">
</div>
</div>
<p class="cabinet-card-pet__name"><?php echo get_the_title($item) ?></p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Breed', 'woodmart' ) ?>:</p>
<p class="cabinet-card__text"><?php echo get_field('breed', $item) ?></p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Weight', 'woodmart' ) ?>:</p>
<p class="cabinet-card__text"><?php echo $w; ?></p>
</div>
<?php if ($old): ?>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Age', 'woodmart' ) ?>:</p>
<p class="cabinet-card__text"><?php echo $old; ?></p>
</div>
<?php
else:
?>
<?php
$zero = '';
if (intval(get_field('month', $item)) < 10){
$zero = '0';
}
?>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Birhtday', 'woodmart' ) ?>:</p>
<p class="cabinet-card__text"><?php echo get_field('day', $item) . '.' . $zero . get_field('month', $item) . '.' . get_field('year', $item); ?></p>
</div>
<?php
endif;
?>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Activity', 'woodmart' ) ?>:</p>
<p class="cabinet-card__text"><?php echo $act; ?></p>
</div>
<?php
if (get_field('type', $item) == 'cat' && get_field('sterilized', $item)):
?>
<div class="cabinet-card__element">
<p class="cabinet-card__label"><?php echo esc_html__('Sterilized', 'woodmart' ) ?></p>
</div>
<?php
endif;
?>
<div class="cabinet-card__element">
<button class="cabinet-card__button" data-edit="<?php echo get_the_ID($item); ?>">
<?php echo esc_html__('Edit', 'woodmart' ) ?>
</button>
</div>
</div>
</div>
<?php
}
// Подключение скриптов и стилей
// add_action('wp_enqueue_scripts', 'enqueue_checkout_scripts');
// function enqueue_checkout_scripts() {
// if (is_checkout()) {
// wp_enqueue_style('custom-checkout', get_template_directory_uri() . '/modules/shop/components/checkout/assets/css/checkout.css', [], '1.0.1');
// wp_enqueue_script('custom-checkout', get_template_directory_uri() . '/modules/shop/components/checkout/assets/js/script.js', ['jquery'], '1.0.1', true);
// wp_localize_script('custom-checkout', 'wc_checkout_params', [
// 'ajax_url' => admin_url('admin-ajax.php'),
// 'nonce' => wp_create_nonce('wc_checkout_nonce')
// ]);
// }
// }
// // AJAX-обработчик для обновления количества
// add_action('wp_ajax_update_cart_quantity', 'update_cart_quantity_callback');
// add_action('wp_ajax_nopriv_update_cart_quantity', 'update_cart_quantity_callback');
// function update_cart_quantity_callback() {
// check_ajax_referer('wc_checkout_nonce', 'nonce');
// $cart_item_key = sanitize_text_field($_POST['cart_item_key']);
// $quantity = intval($_POST['quantity']);
// if ($quantity > 0) {
// WC()->cart->set_quantity($cart_item_key, $quantity);
// } else {
// WC()->cart->remove_cart_item($cart_item_key);
// }
// WC()->cart->calculate_totals();
// // Подготовка фрагментов
// $fragments = [];
// // Обновление списка товаров
// ob_start();
// wc_get_template('checkout/form-checkout.php', [], '', get_template_directory() . '/woocommerce/');
// $fragments['.order-your__products'] = ob_get_clean();
// // Обновление секции итогов
// ob_start();
// woocommerce_checkout_coupon_form();
// woocommerce_order_review();
// $fragments['.order-your__calculation'] = ob_get_clean();
// // Подготовка цен для каждого товара
// $item_prices = [];
// foreach (WC()->cart->get_cart() as $item_key => $item) {
// $item_prices[$item_key] = WC()->cart->get_product_subtotal($item['data'], $item['quantity']);
// }
// wp_send_json_success([
// 'fragments' => $fragments,
// 'item_prices' => $item_prices,
// 'cart_total' => WC()->cart->get_cart_total()
// ]);
// }
// // AJAX-обработчик для удаления товара
// add_action('wp_ajax_remove_cart_item', 'remove_cart_item_callback');
// add_action('wp_ajax_nopriv_remove_cart_item', 'remove_cart_item_callback');
// function remove_cart_item_callback() {
// check_ajax_referer('wc_checkout_nonce', 'nonce');
// $cart_item_key = sanitize_text_field($_POST['cart_item_key']);
// WC()->cart->remove_cart_item($cart_item_key);
// WC()->cart->calculate_totals();
// // Подготовка фрагментов
// $fragments = [];
// // Обновление списка товаров
// ob_start();
// wc_get_template('checkout/form-checkout.php', [], '', get_template_directory() . '/woocommerce/');
// $fragments['.order-your__products'] = ob_get_clean();
// // Обновление секции итогов
// ob_start();
// woocommerce_checkout_coupon_form();
// woocommerce_order_review();
// $fragments['.order-your__calculation'] = ob_get_clean();
// wp_send_json_success([
// 'fragments' => $fragments,
// 'cart_total' => WC()->cart->get_cart_total()
// ]);
// }

@ -0,0 +1,185 @@
<?php
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;
}
add_filter('timber/context', function($context) {
// Передаем все нужные константы в контекст Twig
$context['CONSTANTS'] = [
'DOMAIN' => defined('SITE_DOMAIN') ? SITE_DOMAIN : null,
];
return $context;
});
// Отключаем канонические ссылки и 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_action('wp_head', 'custom_canonical_url', 5);
function custom_canonical_url() {
if (!is_admin()) {
// Защищаем от дублирования
static $canonical_added = false;
if ($canonical_added) {
return;
}
$canonical_added = true;
// Формируем текущий URL без лишних параметров
$current_url = trailingslashit(home_url($_SERVER['REQUEST_URI']));
// Удаляем возможные параметры запроса, если они не нужны
$current_url = strtok($current_url, '?');
echo '<link rel="canonical" href="' . esc_url($current_url) . '" />' . "\n";
}
}
add_action('wp_head', 'add_facebook_pixel');
function add_facebook_pixel() {
?>
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1791804684725971');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1791804684725971&ev=PageView&noscript=1"/>
</noscript>
<!-- End Meta Pixel Code -->
<?php
}
add_action('woocommerce_thankyou', 'send_purchase_to_metrika');
function send_purchase_to_metrika($order_id) {
if (!$order_id) return; // Проверка, что заказ существует
$order = wc_get_order($order_id);
if ($order->get_status() !== 'processing' && $order->get_status() !== 'completed') return; // Отправляем только для оплаченных заказов
$items = [];
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$items[] = [
'id' => $product->get_id(),
'name' => $product->get_name(),
'price' => $product->get_price(),
'quantity' => $item->get_quantity()
];
}
// Получаем валюту заказа
$currency = $order->get_currency();
?>
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'ecommerce': {
'purchase': {
'actionField': {
'id': '<?php echo $order_id; ?>',
'revenue': '<?php echo $order->get_total(); ?>',
'currency': '<?php echo $currency; ?>'
},
'products': <?php echo json_encode($items); ?>
}
}
});
// Яндекс.Метрика
yaCounter96481053.reachGoal('purchase', {
'order_id': '<?php echo $order_id; ?>',
'order_price': '<?php echo $order->get_total(); ?>',
'currency': '<?php echo $currency; ?>',
'items': <?php echo json_encode($items); ?>
});
// Facebook Pixel
fbq('track', 'Purchase', {
value: <?php echo $order->get_total(); ?>,
currency: '<?php echo $currency; ?>',
content_ids: [<?php echo implode(',', array_column($items, 'id')); ?>],
content_type: 'product'
});
</script>
<?php
}
// Отключаем кэширование для страниц товаров
add_action('template_redirect', function() {
if (is_product()) {
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');
}
});
// Обработчик AJAX
add_action('wp_ajax_woocommerce_ajax_add_to_cart', 'woocommerce_ajax_add_to_cart');
add_action('wp_ajax_nopriv_woocommerce_ajax_add_to_cart', 'woocommerce_ajax_add_to_cart');
function woocommerce_ajax_add_to_cart() {
error_log('AJAX handler called'); // Отладка: логируем вызов
$product_id = isset($_POST['product_id']) ? absint($_POST['product_id']) : 0;
$quantity = isset($_POST['quantity']) ? absint($_POST['quantity']) : 1;
error_log('Received product_id: ' . $product_id . ', quantity: ' . $quantity); // Отладка
if (!$product_id) {
error_log('Invalid product_id received'); // Отладка
wp_send_json_error(array('message' => 'Неверный ID товара'));
wp_die();
}
$passed_validation = apply_filters('woocommerce_add_to_cart_validation', true, $product_id, $quantity);
if ($passed_validation) {
$added = WC()->cart->add_to_cart($product_id, $quantity);
if ($added) {
error_log('Product added to cart: ' . $product_id); // Отладка
// Подготавливаем фрагменты корзины
ob_start();
woocommerce_mini_cart();
$mini_cart = ob_get_clean();
// Фрагменты для стандартной корзины и кастомного счетчика
$fragments = array(
'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . $mini_cart . '</div>',
'.mini-profile__button--counter' => '<div class="mini-profile__button--counter">' . WC()->cart->get_cart_contents_count() . '</div>'
);
wp_send_json_success(array(
'message' => 'Товар успешно добавлен в корзину',
'fragments' => apply_filters('woocommerce_add_to_cart_fragments', $fragments),
'cart_hash' => apply_filters('woocommerce_add_to_cart_hash', WC()->cart->get_cart_hash(), array())
));
} else {
error_log('Failed to add product to cart: ' . $product_id); // Отладка
wp_send_json_error(array('message' => 'Не удалось добавить товар в корзину'));
}
} else {
error_log('Validation failed for product: ' . $product_id); // Отладка
wp_send_json_error(array('message' => 'Ошибка валидации товара'));
}
wp_die();
}

@ -1,4 +1,5 @@
<?php
include_module('blog');
include_component('blog', 'archive');

@ -0,0 +1,728 @@
/* Where home */
.where-home {
padding: 162px 0 37px;
color: var(--background);
}
.authors h1{
font-size: 82px;
font-weight: bold;
line-height: 96px;
color:#fff;
margin-bottom: 41px;
text-transform: uppercase;
}
.where-home h1 {
font-size: 82px;
font-weight: bold;
line-height: 96px;
margin-bottom: 41px;
text-transform: uppercase;
}
.where-home p {
max-width: 928px;
color: #FFF;
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
}
/* Where home end */
/* Find us */
.find-us {
color: var(--background);
padding-bottom: 24px;
}
.find-us h2 {
padding: 10px 0;
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
margin-bottom: 24px;
}
.find-us ul {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 36px;
}
.find-us h3 {
font-size: 24px;
font-weight: bold;
line-height: 28px;
margin-bottom: 8px;
text-transform: uppercase;
}
.find-us p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
/* Find us end */
/* Location */
.location {
padding-bottom: 35px;
}
.location h2 {
padding: 10px 0;
margin-bottom: 37px;
text-align: right;
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
color: var(--main_white);
}
.location iframe {
height: 783px;
width: 100%;
border-radius: 64px;
}
/* Location end */
/* Sell form */
.sell-form {
padding-bottom: 31px;
}
.sell-form__container {
background: var(--main_white);
border-radius: 64px;
padding: 64px 105px 38px;
color: var(--grey-black);
display: flex;
flex-direction: column;
gap: 48px;
}
.sell-form h2 {
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
}
.sell-form p {
text-transform: uppercase;
font-size: 24px;
font-weight: bold;
line-height: 28px;
}
.sell-form form {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.sell-form form button {
background: var(--main_black);
padding: 11px 70px;
color: var(--main_white);
text-transform: uppercase;
border-radius: 16px;
font-size: 20px;
font-weight: 600;
line-height: 24px;
border: 1px solid var(--main_black);
}
.sell-form form button:hover {
background: var(--main_white);
color: var(--main_black);
}
/* Sell form end */
/* Breadcrumb */
.breadcrumb {
padding: 20px 0 24px;
}
.breadcrumb .container {
color: var(--main_white);
font-size: 14px;
font-weight: 500;
line-height: 16px;
}
.breadcrumb a {
display: inline;
}
/* Breadcrumb end */
/* Authors */
.authors {
padding-bottom: 120px;
}
.authors h2 {
font-weight: bold;
font-size: 64px;
line-height: 120%;
color: white;
text-transform: uppercase;
margin-bottom: 36px;
}
.authors ul {
display: flex;
flex-wrap: wrap;
align-items: stretch;
justify-content: center;
gap: 24px;
}
.authors li {
background: #F5F5F5;
border-radius: 48px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
width: calc(100% / 3 - 16px);
}
.authors a {
padding: 52px 17px 57px;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.authors .main-img {
width: 200px;
height: 200px;
border-radius: 50%;
overflow: hidden;
flex-shrink: 0;
margin-bottom: 31px;
}
.authors .main-img img {
width: 100%;
height: 100%;
object-fit: cover;
}
.authors-name {
font-size: 24px;
font-weight: bold;
text-transform: uppercase;
line-height: 28px;
color: #121212;
margin-bottom: 5px;
}
.authors-type {
color: #121212;
font-size: 24px;
font-weight: 500;
line-height: 32px;
margin-bottom: 31px;
}
.authors p {
color: #666666;
font-weight: 500;
font-size: 20px;
line-height: 24px;
}
/* Authors end */
/* author-head */
.author-head {
padding-bottom: 36px;
}
.author-head-content {
display: flex;
align-items: center;
gap: 31px;
margin-bottom: 17.5px;
}
.author-head .main-img {
width: 278px;
height: 278px;
flex-shrink: 0;
border-radius: 48px;
overflow: hidden;
}
.author-head .main-img img {
width: 100%;
height: 100%;
object-fit: cover;
}
.author-name {
font-size: 24px;
font-weight: bold;
line-height: 28px;
color: white;
margin-bottom: 5px;
text-transform: uppercase;
}
.author-type {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: white;
margin-bottom: 5px;
}
.author-description {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: white;
margin-bottom: 45px;
}
.author-head p {
font-size: 20px;
font-weight: 500;
line-height: 24px;
color: white;
}
.author-head h2 {
font-size: 64px;
font-weight: bold;
line-height: 120%;
color: white;
}
/* author-head end */
.home-title {
font-size: 82px;
font-weight: bold;
line-height: 96px;
color: var(--main_white);
margin-bottom: 16px;
}
.home-description {
font-size: 32px;
font-weight: bold;
line-height: 40px;
color: var(--main_white);
text-transform: uppercase;
margin-bottom: 68px;
}
.home-swp {
position: relative;
}
.home-swp__btn {
position: absolute;
bottom: 22px;
left: 50%;
transform: translateX(-50%);
z-index: 2;
display: flex;
align-items: center;
gap: 24px;
}
.home-swp__btn button {
border: 1px solid var(--main_black);
background: var(--main_white);
width: 56px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
}
.home-swp .swiper-slide:not(.swiper-slide-active) {
height: 0;
overflow: hidden;
}
.home-card {
border-radius: 60px;
overflow: hidden;
display: flex;
align-items: flex-start;
gap: 24px;
position: relative;
}
.home-card.bg-yellow {
background: var(--orange_80);
}
.home-card.bg-green {
background: var(--green_90);
}
.home-card.bg-violet {
background: var(--violet_90);
}
.home-card__img {
width: 395px;
border-radius: 60px;
overflow: hidden;
height: 393px;
flex-shrink: 0;
}
.home-card__img img {
width: 100%;
height: 100%;
object-fit: cover;
}
.home-card__content {
padding: 32px 79px 0 0;
}
.home-card__content-title {
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
max-width: 660px;
margin-bottom: 10px;
color: var(--interface_title);
}
.home-card__content-description {
color: var(--interface_title);
margin-bottom: 10px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.home-card__content-body {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
}
.home-card__content-body__alerts {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
}
.home-card__content-body__alerts li {
background: var(--interface_hover);
color: var(--background);
border-radius: 16px;
padding: 6px 8px;
font-size: 16px;
font-weight: 500;
line-height: 20px;
}
.home-card__content-body__day {
color: var(--interface_hover);
font-size: 14px;
font-weight: 500;
line-height: 16px;
}
.home-card__content-body__time {
font-size: 14px;
font-weight: 500;
line-height: 16px;
color: var(--interface_hover);
}
.home-card__content-body__data {
display: flex;
align-items: center;
gap: 12px;
}
.home-card__content-body__data>div {
display: flex;
align-items: center;
gap: 4px;
font-size: 14px;
font-weight: 500;
line-height: 16px;
color: var(--interface_hover);
}
.home-card__content-body__data>div .main-img {
width: 32px;
height: 32px;
border-radius: 50%;
object-fit: cover;
}
.home-card__content-body__link {
border: 1px solid #000000;
border-radius: 28px;
background: var(--main_white);
position: absolute;
right: 37px;
bottom: 26px;
padding: 8.5px 16px 12.5px;
font-style: 20px;
font-weight: 500;
line-height: 24px;
}
/* Home end */
/* Anons */
.anons {
background: var(--main_white);
border-radius: 60px;
padding: 51px 0;
}
.anons-theme__title {
color: var(--main_black);
font-size: 24px;
font-weight: bold;
line-height: 28px;
text-transform: uppercase;
margin-bottom: 20px;
}
.anons-theme {
margin-bottom: 60px;
}
.anons-theme ul {
max-width: 1022px;
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.anons-theme ul a {
font-size: 20px;
font-weight: 600;
line-height: 24px;
color: var(--main_black);
padding: 4px 24px;
border: 1px solid #000;
border-radius: 20px;
}
.anons-theme ul a:hover,
.anons-theme ul a.active {
background: var(--main_black);
color: var(--main_white);
}
.anons-best {
margin-bottom: 60px;
}
.anons-best__title {
font-size: 36px;
line-height: 40px;
font-weight: bold;
color: var(--main_black);
margin-bottom: 20px;
}
.anons-best__card-wrap {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 24px;
}
.anons-best__card {
padding-top: 293px;
border-radius: 48px;
overflow: hidden;
position: relative;
z-index: 1;
}
.anons-best__card.light {
padding-top: 0;
border-radius: 0;
}
.anons-best__card .main-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 360px;
z-index: -1;
}
.anons-best__card .main-img img {
width: 100%;
height: 100%;
object-fit: cover;
}
.anons-best__card.light .main-img {
position: static;
height: 265px;
}
.anons-best__card.light .main-img img {
border-radius: 30px;
}
.anons-best__card-alerts {
position: absolute;
top: 21px;
left: 17px;
width: calc(100% - 34px);
display: flex;
flex-wrap: wrap;
gap: 7px;
z-index: 1;
}
.anons-best__card-alerts li {
padding: 6px 8px;
font-size: 16px;
line-height: 20px;
font-weight: 500;
color: var(--background);
background: var(--main_black);
border-radius: 30px;
}
.anons-best__card-body {
background: var(--accent-1);
padding: 30px 17px 22px;
border-radius: 48px 48px 0 0;
color: var(--main_white);
position: relative;
height: 100%;
}
.anons-best__card.light .anons-best__card-body {
background: transparent;
color: var(--main_black);
padding: 12px 0 34px;
}
.anons-best__card-body__title {
font-size: 28px;
font-weight: bold;
line-height: 32px;
text-transform: uppercase;
margin-bottom: 14px;
}
.anons-best__card.light .anons-best__card-body__title {
font-size: 26px;
}
.anons-best__card-body__datas {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px 10px;
max-width: 264px;
}
.anons-best__card.light .anons-best__card-body__datas {
color: var(--placeholder);
}
.anons-best__card-body__datas p {
font-size: 14px;
line-height: 16px;
font-weight: 500;
}
.anons-best__card-body__datas ul {
display: flex;
align-items: center;
gap: 10px;
}
.anons-best__card-body__datas ul li {
display: flex;
align-items: center;
gap: 4px;
font-size: 14px;
line-height: 16px;
font-weight: 500;
}
.anons-best__card-body__datas ul .logo img {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
}
.anons-article {
margin-bottom: 40px;
}
.anons-article__title {
font-size: 36px;
line-height: 40px;
font-weight: bold;
color: var(--main_black);
margin-bottom: 20px;
}
.anons-article__card-wrap {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 40px 25px;
}
.anons-article__more-link {
display: flex;
align-items: center;
justify-content: center;
}
.anons-article__more-link a {
background: var(--accent-3);
color: var(--main_white);
border-radius: 20px;
border: 1px solid var(--main_white);
padding: 16px 24px;
font-size: 20px;
font-weight: 600;
line-height: 24px;
text-transform: uppercase;
}
/* Anons end */

@ -0,0 +1,120 @@
/* Стили для мобильных устройств */
@media only screen and (max-width: 576px) {
.anons-best__title {
font-size: 26px;
line-height: 32px;
margin-bottom: 12px;
}
.anons-best__card {
padding-top: 205px;
}
.anons-best__card .main-img {
height: 300px;
}
.anons-best__card-body {
padding: 20px 17px;
}
.anons-best__card-body__title {
font-size: 20px;
line-height: 24px;
margin-bottom: 16px;
}
.anons-best__card.light .main-img {
height: 197px;
}
.anons-best__card.light .anons-best__card-body__title {
font-size: 20px;
line-height: 24px;
}
.authors {
padding-bottom: 138px;
}
.authors h2 {
font-size: 32px;
line-height: 38px;
margin-bottom: 15px;
}
.authors li {
border-radius: 24px;
width: 100%;
}
.authors a {
padding: 32px 17px 52px;
}
.authors .main-img {
width: 180px;
height: 180px;
margin-bottom: 20px;
}
.authors-name {
font-size: 20px;
line-height: 24px;
}
.authors-type {
font-size: 18px;
line-height: 24px;
margin-bottom: 20px;
}
.authors p {
font-size: 16px;
line-height: 20px;
}
.author-head {
padding-bottom: 15px;
}
.author-head-content {
margin-bottom: 23px;
}
.author-head .main-img {
width: 100%;
}
.author-head h2 {
font-size: 32px;
line-height: 38px;
}
.author-name {
font-size: 20px;
line-height: 24px;
}
.author-type {
font-size: 18px;
line-height: 24px;
}
.author-description {
font-size: 18px;
line-height: 24px;
margin-bottom: 24px;
}
.author-head p {
font-size: 16px;
line-height: 20px;
}
}

@ -0,0 +1,44 @@
/* Стили для планшетов */
@media only screen and (max-width: 992px) {
.authors h2 {
font-size: 48px;
margin-bottom: 24px;
}
.authors li {
border-radius: 32px;
width: calc(50% - 12px);
}
.authors .main-img {
margin-bottom: 24px;
}
.author {
padding-bottom: 24px;
}
.author h2 {
font-size: 48px;
}
.author-head-content {
flex-direction: column;
align-items: flex-start;
}
}
/* Стили для планшетов */
@media only screen and (max-width: 992px) {
.author {
padding: 188px 0 36px;
}
}

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.5 5.5L7.5 10.5L12.5 5.5" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

@ -0,0 +1,11 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_12806_2018)">
<path d="M4 8H20" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4 16H20" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_12806_2018">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 458 B

@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9995 11.5385C19.3616 11.5385 18.7499 11.7816 18.2988 12.2144C17.8478 12.6471 17.5944 13.2341 17.5944 13.8462V15.1282H22.4045V13.8462C22.4045 13.2341 22.1511 12.6471 21.7001 12.2144C21.2491 11.7816 20.6373 11.5385 19.9995 11.5385ZM24.0079 15.1282V13.8462C24.0079 12.8261 23.5856 11.8478 22.8339 11.1265C22.0821 10.4052 21.0626 10 19.9995 10C18.9364 10 17.9168 10.4052 17.1651 11.1265C16.4133 11.8478 15.991 12.8261 15.991 13.8462V15.1282H13.9399M15.991 16.6667H13.9398C13.7471 16.6666 13.5566 16.7066 13.3816 16.7838C13.2065 16.861 13.051 16.9736 12.9255 17.1138C12.8 17.2541 12.7077 17.4188 12.6548 17.5965C12.6019 17.7742 12.5896 17.9608 12.6189 18.1435C12.6189 18.1434 12.6189 18.1435 12.6189 18.1435L13.9604 26.5045C14.0477 27.0493 14.3354 27.5463 14.7714 27.9052C15.2074 28.2642 15.7629 28.4615 16.3373 28.4615C16.3373 28.4615 16.3374 28.4615 16.3373 28.4615H23.6616C24.2362 28.4617 24.7921 28.2644 25.2283 27.9055C25.6645 27.5465 25.9523 27.0496 26.0396 26.5046L27.3811 18.1436C27.3811 18.1436 27.3811 18.1435 27.3811 18.1436C27.4104 17.9609 27.3981 17.7742 27.3452 17.5965C27.2923 17.4188 27.1999 17.2541 27.0745 17.1138C26.949 16.9736 26.7935 16.861 26.6184 16.7838C26.4433 16.7066 26.253 16.6666 26.0603 16.6667H24.0079V18.9744C24.0079 19.3992 23.649 19.7436 23.2062 19.7436C22.7635 19.7436 22.4045 19.3992 22.4045 18.9744V16.6667H17.5944V18.9744C17.5944 19.3992 17.2355 19.7436 16.7927 19.7436C16.3499 19.7436 15.991 19.3992 15.991 18.9744V16.6667ZM24.0079 15.1282H26.0601C26.0601 15.1282 26.0602 15.1282 26.0601 15.1282C26.4839 15.1282 26.9028 15.2161 27.2879 15.3859C27.673 15.5557 28.0153 15.8034 28.2913 16.112C28.5673 16.4206 28.7705 16.7829 28.8869 17.1739C29.0033 17.5649 29.0303 17.9755 28.9658 18.3774L27.6244 26.7385C27.6243 26.7385 27.6244 26.7384 27.6244 26.7385C27.4788 27.6467 26.9991 28.475 26.2722 29.0732C25.5453 29.6715 24.6192 30.0002 23.6616 30C23.6615 30 23.6616 30 23.6616 30H16.3373C15.3799 30 14.454 29.6711 13.7273 29.0728C13.0007 28.4746 12.5212 27.6466 12.3757 26.7386C12.3756 26.7385 12.3757 26.7386 12.3757 26.7386L11.0342 18.3776C10.9697 17.9756 10.9966 17.5649 11.1131 17.1739C11.2295 16.7829 11.4327 16.4206 11.7087 16.112C11.9847 15.8034 12.327 15.5557 12.7121 15.3859C13.0972 15.2161 13.5161 15.1282 13.9399 15.1282" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

@ -0,0 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25023 2.99272C0 5.24325 0 8.86108 0 16.101V17.3791C0 24.619 0 28.2411 2.25023 30.4917C4.50046 32.7422 8.11782 32.7422 15.361 32.7422H16.639C23.8779 32.7422 27.4995 32.7422 29.7498 30.4917C32 28.2411 32 24.6233 32 17.3791V16.101C32 8.86108 32 5.239 29.7498 2.98847C27.4995 0.742188 23.8779 0.742188 16.639 0.742188H15.361C8.11782 0.742188 4.50046 0.742188 2.25023 2.99272ZM5.40056 10.4789C5.57463 18.7974 9.73544 23.7995 17.0253 23.7995H17.4372V19.0394C20.1162 19.3069 22.1414 21.2645 22.9566 23.7995H26.7438C25.7036 20.0118 22.9694 17.9184 21.2626 17.1201C22.9694 16.135 25.3682 13.7316 25.9414 10.4789H22.5023C21.7551 13.1201 19.5431 15.5193 17.4372 15.7443V10.4789H13.9981V19.7061C11.8668 19.1711 9.17076 16.5851 9.05188 10.4789H5.40056Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 911 B

@ -0,0 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 0.742188C7.16387 0.742188 0 7.90606 0 16.7422C0 25.5783 7.16387 32.7422 16 32.7422C24.8361 32.7422 32 25.5783 32 16.7422C32 7.90606 24.8361 0.742188 16 0.742188ZM23.8555 11.7048L21.2335 24.0815C21.0374 24.959 20.5213 25.1757 19.7884 24.7628L15.7832 21.8106L13.8529 23.6686C13.6361 23.8854 13.4606 24.0609 13.0477 24.0609L13.3265 19.9938L20.7381 13.2944C21.0581 13.0157 20.6658 12.8506 20.2426 13.1293L11.0761 18.8996L7.1329 17.6712C6.27613 17.4028 6.25548 16.8144 7.31871 16.4015L22.751 10.4454C23.4632 10.1873 24.0929 10.6209 23.8555 11.7048Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 676 B

@ -0,0 +1,6 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.568 0.742188C15.3825 3.24847 15.3939 5.78891 14.9687 8.25368C14.1605 12.9294 11.5304 15.3105 6.79636 15.8649C4.54453 16.1288 2.2659 16.1683 0 16.3095C0 15.8187 0.160702 14.5311 0.188825 14.3684C1.18518 8.62865 4.32691 4.50931 9.62271 2.11485C11.0322 1.47874 15.0772 0.742188 15.568 0.742188Z" fill="white"/>
<path d="M0 17.1484C1.98668 17.287 3.98207 17.3527 5.9567 17.5897C7.26575 17.7464 8.59221 18.0209 9.82962 18.4669C12.4651 19.417 14.1652 21.387 14.6935 24.0901C15.2399 26.887 15.4375 29.7528 15.8051 32.7325C13.2814 32.8082 11.2063 32.2571 9.25913 31.3016C4.19768 28.8188 1.14634 24.7905 0.190834 19.2074C0.156685 19.0072 0 17.6399 0 17.1484Z" fill="white"/>
<path d="M19.7047 1.16135C26.3892 2.64115 31.7125 8.86167 32.0111 15.5469C32.0205 15.7538 32.0124 15.9614 32.0124 16.3069C28.4489 16.181 24.8913 16.3457 21.5842 14.8097C18.8215 13.526 17.5138 11.1249 17.0839 8.25502C16.7739 6.18397 16.7257 4.07408 16.5542 1.9816C16.5201 1.56713 16.4585 1.15533 16.4089 0.742189C16.8997 0.741519 19.096 1.0261 19.7047 1.16135Z" fill="white"/>
<path d="M16.3945 32.6792C16.6202 30.1595 16.7032 27.7075 17.0862 25.303C17.7719 20.9968 20.1751 18.5528 24.4544 17.843C26.8897 17.4393 29.3799 17.3643 31.844 17.1406C32.5009 24.1633 25.5157 32.8807 16.3945 32.6792Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,3 @@
<svg width="24" height="21" viewBox="0 0 24 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7934 0.742188C14.0742 0.742188 12.4292 3.534 12.0716 4.92991C11.8093 3.534 10.2263 0.742188 5.99218 0.742188C0.699506 0.742188 -1.66074 7.7458 2.98823 13.7386C6.7074 18.5328 10.5935 20.4052 12.0716 20.7422C13.7166 20.4293 17.8935 18.4895 21.4411 13.2332C25.8755 6.66277 22.4424 0.742188 17.7934 0.742188Z" fill="#FE8D8D"/>
</svg>

After

Width:  |  Height:  |  Size: 439 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 389 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#666666"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,18 @@
<svg width="54" height="49" viewBox="0 0 54 49" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.0815 7.92932C49.4355 6.5889 51.629 6.5889 52.983 7.92932C54.339 9.27186 54.339 11.4501 52.983 12.7927L29.1999 36.3385C27.8459 37.6789 25.6524 37.6789 24.2984 36.3385L10.8231 22.9976C9.46708 21.6551 9.46708 19.4768 10.8231 18.1343C12.1771 16.7939 14.3706 16.7939 15.7246 18.1343L26.7492 29.0489L48.0815 7.92932ZM51.8777 9.03434C51.1351 8.29909 49.9294 8.29909 49.1867 9.03434L26.7492 31.2481L14.6194 19.2393C13.8767 18.504 12.671 18.504 11.9284 19.2393C11.1878 19.9724 11.1878 21.1595 11.9284 21.8926L25.4037 35.2335C26.1463 35.9687 27.352 35.9687 28.0946 35.2335L51.8777 11.6877C52.6182 10.9545 52.6182 9.76747 51.8777 9.03434Z" fill="url(#paint0_radial_11666_41321)"/>
<path d="M1.56688 24.6641C1.56688 12.2738 11.7134 2.22296 24.238 2.22296C32.565 2.22296 39.8409 6.66576 43.7825 13.2851L44.9262 12.1528C40.6662 5.26123 32.9929 0.664062 24.238 0.664062C10.8554 0.664062 0 11.4056 0 24.6641C0 37.9225 10.8554 48.6641 24.238 48.6641C37.6206 48.6641 48.476 37.9225 48.476 24.6641C48.476 22.0965 48.0689 19.6234 47.3152 17.3043L46.0573 18.5496C46.6122 20.4936 46.9091 22.5446 46.9091 24.6641C46.9091 37.0543 36.7625 47.1052 24.238 47.1052C11.7134 47.1052 1.56688 37.0543 1.56688 24.6641Z" fill="url(#paint1_radial_11666_41321)"/>
<defs>
<radialGradient id="paint0_radial_11666_41321" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(54 0.664065) rotate(138.366) scale(72.2496 97.959)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
<radialGradient id="paint1_radial_11666_41321" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(54 0.664065) rotate(138.366) scale(72.2496 97.959)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,11 @@
<svg width="55" height="44" viewBox="0 0 55 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M54.4456 6.968C52.8502 4.26022 48.1445 3.74111 41.1703 5.49485C37.7503 2.7802 33.5793 1.14675 29.203 0.808095C24.8266 0.469444 20.4485 1.44136 16.6411 3.59675C12.8338 5.75214 9.77451 8.99066 7.8633 12.8888C5.9521 16.787 5.27795 21.1633 5.92903 25.4455C0.860701 30.5173 -1.05 34.7988 0.552524 37.5159C1.53158 39.1785 3.63429 40.0203 6.71606 40.0203C8.68733 39.9852 10.649 39.7398 12.5667 39.2884C12.9792 39.1972 13.4011 39.0966 13.8278 38.9891C17.0317 41.5323 20.8992 43.1302 24.9842 43.5984C29.0692 44.0666 33.2052 43.386 36.9149 41.6351C40.6245 39.8842 43.7568 37.1345 45.9501 33.703C48.1434 30.2716 49.3085 26.2985 49.3109 22.242C49.3125 21.1675 49.2333 20.0943 49.0738 19.0314C52.1011 15.9916 54.1255 13.1201 54.7632 10.7374C55.1639 9.27359 55.0548 8.00622 54.4456 6.968ZM27.5014 2.6C32.1048 2.60551 36.5646 4.18168 40.1241 7.0611C43.6836 9.94053 46.1237 13.9459 47.0304 18.3977C43.1971 22.0666 37.8325 25.9926 31.7424 29.444C25.2683 33.1128 19.2233 35.5821 14.2925 36.9266C11.2741 34.2819 9.14206 30.7945 8.17904 26.9271C7.21602 23.0597 7.46753 18.995 8.90022 15.2718C10.3329 11.5486 12.8791 8.34292 16.2011 6.07984C19.5232 3.81675 23.4641 2.60317 27.5014 2.6ZM2.19534 36.5759C1.18784 34.8689 2.78799 31.5251 6.40315 27.6762C7.38336 31.3793 9.34736 34.7574 12.0926 37.4621C6.84408 38.6102 3.19573 38.2782 2.19534 36.5759ZM27.5014 41.8839C23.4308 41.8879 19.4578 40.655 16.1226 38.353C21.2383 36.8144 26.987 34.2914 32.6812 31.0668C38.4299 27.8072 43.4934 24.1781 47.3385 20.6753C47.3812 21.192 47.4097 21.7135 47.4097 22.242C47.4034 27.4486 45.3041 32.4403 41.572 36.1224C37.84 39.8045 32.7799 41.8765 27.5014 41.8839ZM52.9331 10.2533C52.4282 12.124 50.8992 14.3805 48.6068 16.8147C47.6205 13.1031 45.6464 9.71887 42.8889 7.01243C48.0687 5.88535 51.8 6.20336 52.8051 7.90801C53.1512 8.4996 53.1963 9.28762 52.9331 10.2533Z" fill="url(#paint0_radial_12821_4886)"/>
<defs>
<radialGradient id="paint0_radial_12821_4886" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(55 0.74219) rotate(141.981) scale(69.814 92.4982)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,3 @@
<svg width="51" height="40" viewBox="0 0 51 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M50.4859 5.79145C49.0065 3.27258 44.6431 2.78969 38.1761 4.42108C35.0048 1.89583 31.1372 0.376333 27.0791 0.0613091C23.021 -0.253715 18.9613 0.650395 15.4309 2.65541C11.9004 4.66042 9.06364 7.673 7.29143 11.2992C5.51922 14.9254 4.8941 18.9964 5.49783 22.9798C0.798105 27.6978 -0.973633 31.6805 0.51234 34.2081C1.42019 35.7547 3.36998 36.5377 6.22762 36.5377C8.05553 36.5052 9.87449 36.2769 11.6527 35.8569C12.0352 35.7721 12.4265 35.6785 12.8222 35.5785C15.793 37.9443 19.3793 39.4307 23.1672 39.8663C26.9551 40.3018 30.7903 39.6687 34.2301 38.0399C37.67 36.4112 40.5744 33.8533 42.6083 30.6613C44.6421 27.4693 45.7224 23.7733 45.7246 19.9998C45.7261 19.0003 45.6527 18.002 45.5048 17.0132C48.3119 14.1855 50.1891 11.5144 50.7805 9.29786C51.1519 7.93619 51.0508 6.75724 50.4859 5.79145ZM25.5013 1.7282C29.77 1.73333 33.9054 3.19952 37.206 5.87806C40.5066 8.5566 42.7692 12.2825 43.61 16.4238C40.0555 19.8366 35.081 23.4888 29.4339 26.6994C23.4306 30.1122 17.8253 32.4092 13.253 33.66C10.4542 31.1997 8.47718 27.9557 7.5842 24.3581C6.69122 20.7605 6.92444 16.9793 8.25293 13.5159C9.58142 10.0525 11.9424 7.07045 15.0229 4.96526C18.1033 2.86006 21.7576 1.73114 25.5013 1.7282ZM2.03568 33.3337C1.10145 31.7458 2.58523 28.6353 5.93746 25.0549C6.84638 28.4997 8.66755 31.6421 11.2131 34.1581C6.34633 35.2261 2.96332 34.9172 2.03568 33.3337ZM25.5013 38.2714C21.7268 38.275 18.0427 37.1282 14.95 34.9868C19.6937 33.5556 25.0243 31.2085 30.3044 28.2089C35.635 25.1767 40.3303 21.8008 43.8957 18.5424C43.9353 19.0231 43.9617 19.5082 43.9617 19.9998C43.9559 24.8432 42.0092 29.4866 38.5486 32.9118C35.088 36.3371 30.3959 38.2645 25.5013 38.2714ZM49.0835 8.84759C48.6152 10.5877 47.1974 12.6868 45.0718 14.9512C44.1572 11.4985 42.3267 8.3504 39.7697 5.83278C44.5728 4.78434 48.0327 5.08016 48.9648 6.66588C49.2857 7.2162 49.3274 7.94924 49.0835 8.84759Z" fill="#121212"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,3 @@
<svg width="207" height="22" viewBox="0 0 207 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M197.037 1L206 11M206 11L197.037 21M206 11L1 11" stroke="#121212" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,4 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 33C26.2843 33 33 26.2843 33 18C33 16.0529 32.6305 14.1994 31.9606 12.5005C31.7927 12.0745 31.6057 11.6579 31.4007 11.2518C31.1211 10.6979 30.808 10.1633 30.4639 9.65087C27.7663 5.63342 23.1901 3 18 3C9.71573 3 3 9.71573 3 18C3 26.2843 9.71573 33 18 33ZM18 36C27.9411 36 36 27.9411 36 18C36 15.6701 35.5573 13.4436 34.7515 11.4C34.5497 10.8881 34.325 10.3877 34.0789 9.9C33.7431 9.23477 33.3672 8.59322 32.9545 7.97852C29.7235 3.16663 24.2316 0 18 0C8.05888 0 0 8.05888 0 18C0 27.9411 8.05888 36 18 36Z" fill="#DD2127"/>
<path d="M28.4694 18.0918C28.4694 19.4613 27.3534 20.5714 25.9767 20.5714H10.0233C8.64664 20.5714 7.53061 19.4613 7.53061 18.0918C7.53061 16.7224 8.64664 15.6122 10.0233 15.6122H25.9767C27.3534 15.6122 28.4694 16.7224 28.4694 18.0918Z" fill="#DD2127"/>
</svg>

After

Width:  |  Height:  |  Size: 929 B

@ -0,0 +1,11 @@
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.76298 4.44735C3.06952 5.67081 2.13126 7.27684 2.13126 8.95074C2.13126 10.9189 3.43754 12.8055 5.72596 14.0611C6.06925 14.2494 6.23788 14.6639 6.12924 15.0523C5.80108 16.2254 4.97453 17.5082 4.37705 18.4355C4.35717 18.4664 4.33755 18.4969 4.3182 18.5269C4.30813 18.5425 4.29815 18.5581 4.28825 18.5734C4.53639 18.4536 4.80635 18.3131 5.09199 18.1538C6.28443 17.4885 7.6774 16.5358 8.80068 15.5042C8.98115 15.3384 9.22254 15.2642 9.46036 15.3013C10.1165 15.4037 10.7989 15.4578 11.5 15.4578C14.1673 15.4578 16.5467 14.6753 18.237 13.4541C19.9305 12.2307 20.8687 10.6246 20.8687 8.95074C20.8687 7.27684 19.9305 5.67081 18.237 4.44735C16.5467 3.22618 14.1673 2.44368 11.5 2.44368C8.83266 2.44368 6.45327 3.22618 4.76298 4.44735ZM3.0195 19.0408C3.01951 19.0408 3.02033 19.0407 3.02191 19.0407C3.02027 19.0408 3.01948 19.0408 3.0195 19.0408ZM3.83415 3.04862C5.82987 1.60678 8.54267 0.742188 11.5 0.742188C14.4573 0.742188 17.1701 1.60678 19.1659 3.04862C21.1584 4.48816 22.5 6.56104 22.5 8.95074C22.5 11.3404 21.1584 13.4133 19.1659 14.8529C17.1701 16.2947 14.4573 17.1593 11.5 17.1593C10.8501 17.1593 10.2129 17.1176 9.59312 17.0374C8.41664 18.0694 7.04427 18.9942 5.86135 19.6541C5.22123 20.0112 4.61837 20.301 4.11684 20.4893C3.86744 20.583 3.62444 20.6586 3.40353 20.7017C3.21456 20.7385 2.91813 20.7785 2.63153 20.6825C2.42855 20.6146 2.21877 20.4705 2.08381 20.2244C1.95926 19.9972 1.94674 19.7703 1.95698 19.6181C1.97576 19.3391 2.08812 19.078 2.17184 18.9038C2.35249 18.5281 2.6576 18.0542 2.9561 17.5905L2.96393 17.5784C3.47206 16.7891 4.00731 15.953 4.33796 15.1946C2.0636 13.7424 0.5 11.537 0.5 8.95074C0.5 6.56104 1.84159 4.48816 3.83415 3.04862Z" fill="url(#paint0_radial_11432_38673)"/>
<defs>
<radialGradient id="paint0_radial_11432_38673" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.5 0.742189) rotate(137.726) scale(29.7321 40.4084)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 244 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#666666"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,18 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 33C26.2843 33 33 26.2843 33 18C33 16.0529 32.6305 14.1994 31.9606 12.5005C31.7927 12.0745 31.6057 11.6579 31.4007 11.2518C31.1211 10.6979 30.808 10.1633 30.4639 9.65087C27.7663 5.63342 23.1901 3 18 3C9.71573 3 3 9.71573 3 18C3 26.2843 9.71573 33 18 33ZM18 36C27.9411 36 36 27.9411 36 18C36 15.6701 35.5573 13.4436 34.7515 11.4C34.5497 10.8881 34.325 10.3877 34.0789 9.9C33.7431 9.23477 33.3672 8.59322 32.9545 7.97852C29.7235 3.16663 24.2316 0 18 0C8.05888 0 0 8.05888 0 18C0 27.9411 8.05888 36 18 36Z" fill="url(#paint0_radial_11667_42373)"/>
<path d="M27.7631 15.6376C29.0661 15.6376 30.1224 16.6858 30.1224 17.9789C30.1224 19.272 29.0661 20.3203 27.7631 20.3203H20.4725V27.5763C20.4725 28.8811 19.4066 29.9388 18.0918 29.9388C16.7771 29.9388 15.7112 28.8811 15.7112 27.5763V20.3203H8.42059C7.11755 20.3203 6.06122 19.272 6.06122 17.9789C6.06122 16.6858 7.11755 15.6376 8.42058 15.6376H15.7112V8.42367C15.7112 7.11893 16.7771 6.06122 18.0918 6.06122C19.4066 6.06122 20.4725 7.11893 20.4725 8.42367V15.6376H27.7631Z" fill="url(#paint1_radial_11667_42373)"/>
<defs>
<radialGradient id="paint0_radial_11667_42373" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36 1.87286e-06) rotate(135) scale(50.9117 69.5076)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
<radialGradient id="paint1_radial_11667_42373" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36 1.87286e-06) rotate(135) scale(50.9117 69.5076)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12.3633H4.5" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21 12.3633L14.636 18.7272" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21 12.3633L14.636 5.99932" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 458 B

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.5 12.3633H21" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.5 12.3633L10.864 18.7272" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.5 12.3633L10.864 5.99932" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

@ -0,0 +1,4 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6412 11.6412C17.532 10.7504 18.7402 10.25 20 10.25C21.2598 10.25 22.468 10.7504 23.3588 11.6412C24.2496 12.532 24.75 13.7402 24.75 15C24.75 16.2598 24.2496 17.468 23.3588 18.3588C22.468 19.2496 21.2598 19.75 20 19.75C18.7402 19.75 17.532 19.2496 16.6412 18.3588C15.7504 17.468 15.25 16.2598 15.25 15C15.25 13.7402 15.7504 12.532 16.6412 11.6412ZM20 11.75C19.138 11.75 18.3114 12.0924 17.7019 12.7019C17.0924 13.3114 16.75 14.138 16.75 15C16.75 15.862 17.0924 16.6886 17.7019 17.2981C18.3114 17.9076 19.138 18.25 20 18.25C20.862 18.25 21.6886 17.9076 22.2981 17.2981C22.9076 16.6886 23.25 15.862 23.25 15C23.25 14.138 22.9076 13.3114 22.2981 12.7019C21.6886 12.0924 20.862 11.75 20 11.75Z" fill="#333333"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 23.75C17.138 23.75 16.3114 24.0924 15.7019 24.7019C15.0924 25.3114 14.75 26.138 14.75 27V29C14.75 29.4142 14.4142 29.75 14 29.75C13.5858 29.75 13.25 29.4142 13.25 29V27C13.25 25.7402 13.7504 24.532 14.6412 23.6412C15.532 22.7504 16.7402 22.25 18 22.25H22C23.2598 22.25 24.468 22.7504 25.3588 23.6412C26.2496 24.532 26.75 25.7402 26.75 27V29C26.75 29.4142 26.4142 29.75 26 29.75C25.5858 29.75 25.25 29.4142 25.25 29V27C25.25 26.138 24.9076 25.3114 24.2981 24.7019C23.6886 24.0924 22.862 23.75 22 23.75H18Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,46 @@
jQuery(document).ready(function ($) {
$('#ajax-load-author').on('submit', function (e) {
e.preventDefault();
var form = $(this);
var currentPage = parseInt($('#page_num').val());
var totalPosts = parseInt(form.data('total'));
var postsPerPage = 9;
console.log('Current page before load:', currentPage);
console.log('Total posts:', totalPosts);
console.log('Posts loaded before request:', postsPerPage);
var data = {
action: 'get_author_posts',
page_num: currentPage,
author_id: form.data('author')
};
console.log('Sending AJAX request with data:', data);
$.ajax({
url: '/wp-admin/admin-ajax.php',
type: 'POST',
data: data,
success: function (response) {
console.log('AJAX response received');
$(".anons-article__card-wrap").append(response);
$('#page_num').val(currentPage + 1);
console.log('New page number:', currentPage + 1);
// Считаем общее количество загруженных постов
var currentlyDisplayed = $('.anons-article__card-wrap .anons-best__card').length;
console.log('Actually displayed posts:', currentlyDisplayed);
if (currentlyDisplayed >= totalPosts) {
console.log('Hiding load more button - all posts loaded');
form.hide();
}
},
error: function (error) {
console.error('AJAX error:', error);
}
});
});
});

@ -0,0 +1,48 @@
// const homeSwp = new Swiper('.home-swp .swiper', {
// slidesPerView: 1,
// spaceBetween: 0,
// effect: 'fade',
// loop: true,
// navigation: {
// nextEl: '.home-swp__btn-next',
// prevEl: '.home-swp__btn-prev',
// }
// })
// const textsSwp = new Swiper('.texts-swp .swiper', {
// slidesPerView: 1,
// spaceBetween: 0,
// loop: true,
// effect: 'fade',
// navigation: {
// nextEl: '.texts-swp__next',
// prevEl: '.texts-swp__prev'
// },
// pagination: {
// el: ".texts-swp__pagination",
// clickable: true,
// }
// })
// comment
// let answerbtns = document.querySelectorAll('.answer-btn');
// let answerbtnicons = document.querySelectorAll('.answer-btn svg');
// let answerblocks = document.querySelectorAll('.answer-block');
// answerbtns.forEach((answerbtn, index) => {
// answerbtn.addEventListener('click', () => {
// let answerbtnicon = answerbtnicons[index];
// let answerblock = answerblocks[index];
// answerblock.classList.toggle('active');
// answerbtnicon.classList.toggle('active');
// let buttonText = answerbtn.querySelector('span');
// if (buttonText.textContent === 'Ответ') {
// buttonText.textContent = 'Свернуть';
// } else {
// buttonText.textContent = 'ответ';
// }
// });
// });
// comment

@ -0,0 +1,54 @@
<?php
include_component('blog', 'featured-slider');
include_module('forms');
include_component('forms', 'discount');
$context = Timber::context();
$context['blog_title'] = get_field('blog_title', 'options');
$context['blog_desc'] = get_field('blog_desc', 'options');
$context['post_count'] = wp_count_posts()->publish;
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page'));
$context['sub_title'] = get_field('sub_title', 383);
$context['sub_text'] = get_field('sub_text', 383);
$authors = Timber::get_posts([
'post_type' => 'blog_author',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
]);
$authors_arr = iterator_to_array($authors);
foreach ($authors_arr as $author) {
$author_id = $author->ID;
$query = new WP_Query([
'post_type' => 'post',
'posts_per_page' => -1,
'meta_query' => [
[
'key' => 'post_author',
'value' => $author_id,
'compare' => '='
]
]
]);
$author->post_count = $query->found_posts;
$author->position = get_field('post', $author_id);
$author->posts = Timber::get_posts([
'post_type' => 'post',
'posts_per_page' => -1,
'meta_query' => [
[
'key' => 'post_author',
'value' => $author_id,
'compare' => '='
]
]
]);
}
$context['authors'] = $authors_arr;
Timber::render('blog_author/author-archive.twig', $context);

@ -0,0 +1,41 @@
<?php
$context = Timber::get_context();
$author = Timber::get_post();
$author_id = $author->ID;
$author->position = get_field('post', $author_id);
$count_query = new WP_Query([
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => [
[
'key' => 'post_author',
'value' => $author_id,
'compare' => '='
]
]
]);
$author->post_count = $count_query->found_posts;
$author->posts = Timber::get_posts([
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 9,
'meta_query' => [
[
'key' => 'post_author',
'value' => $author_id,
'compare' => '='
]
]
]);
$context['author'] = $author;
$context['total_pages'] = ceil($author->post_count / 9);
Timber::render('blog_author/author-single.twig', $context);

@ -0,0 +1,35 @@
<?php
include_module('author');
function get_author_posts() {
$author_id = isset($_POST['author_id']) ? sanitize_text_field($_POST['author_id']) : '';
$all_posts = Timber::get_posts([
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => [
[
'key' => 'post_author',
'value' => $author_id,
'compare' => '='
]
]
]);
if ($all_posts instanceof \Timber\PostQuery || $all_posts instanceof \Timber\PostCollection) {
$all_posts = $all_posts->get_posts();
}
$remaining_posts = array_slice($all_posts, 9);
$context = Timber::context();
$context['posts'] = $remaining_posts;
Timber::render('blog_author/author-posts-list.twig', $context);
wp_die();
}
add_action('wp_ajax_get_author_posts', 'get_author_posts');
add_action('wp_ajax_nopriv_get_author_posts', 'get_author_posts');

@ -1,3 +1,68 @@
main{
padding-top: 72px;
}
.block-lists_text p {
font-size: 18px!important;
}
.user a{
display: flex;
align-items: center;
gap: 5px;
}
.user a{
display:flex;
gap:5px;
}
.user img{
width:30px;
border-radius:100px;
}
.anons-best__card-body__datas .logo a{
display: flex;
align-items: center;
gap:5px;
margin-top: 10px;
}
.comment-submit-btn{
border: 1px solid #000000;
border-radius: 28px;
background: var(--main_white);
padding: 8.5px 16px 8.5px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
margin-top: 15px;
transition: all .5s;
}
.comment-reply-title , .logged-in-as{
margin: 10px 0;
}
.comment-block.answer-block.active{
margin-top: 15px;
}
.comment-form-comment textarea{
padding: 28px 48px;
border-radius: 24px;
background: #f5f5f5 !important;
}
.comment-respond{
margin-top: 30px;
}
.reply-form-container textarea{
background-color: #fff !important;
margin-top: 2rem;
width: 100%;
}

@ -0,0 +1,10 @@
@media(max-width:600px) {
.article-content h2 {
max-width: 661px;
font-size: 24px!important;
line-height: 40px;
font-weight: bold;
text-transform: uppercase;
color: var(--grey-black);
}
}

@ -0,0 +1,198 @@
// comment
let answerbtns = document.querySelectorAll('.answer-btn');
let answerbtnicons = document.querySelectorAll('.answer-btn svg');
// При загрузке страницы проверяем активные кнопки
document.addEventListener('DOMContentLoaded', function() {
// Для каждой кнопки ответов
answerbtns.forEach((answerbtn) => {
// Находим родительский контейнер, чтобы искать ответы только для этого комментария
const buttonParent = answerbtn.parentElement;
// Находим все блоки ответов для этого комментария (после текущей кнопки)
const answerBlocks = getRelatedAnswerBlocks(answerbtn);
if (answerBlocks.length === 0) return;
// Проверяем, должны ли быть ответы развернуты (если у кнопки или любого ответа есть класс active)
const shouldBeActive = answerbtn.querySelector('svg').classList.contains('active') ||
Array.from(answerBlocks).some(block => block.classList.contains('active'));
if (shouldBeActive) {
// Активируем все ответы только для этого комментария
answerBlocks.forEach(block => {
block.classList.add('active');
});
// Обновляем состояние кнопки
answerbtn.querySelector('svg').classList.add('active');
// Обновляем текст кнопки
let buttonText = answerbtn.querySelector('span');
if (buttonText) {
buttonText.textContent = 'Свернуть';
}
} else {
// Скрываем все ответы
answerBlocks.forEach(block => {
block.classList.remove('active');
});
// Обновляем состояние кнопки
answerbtn.querySelector('svg').classList.remove('active');
// Обновляем текст кнопки в зависимости от количества ответов
let buttonText = answerbtn.querySelector('span');
if (buttonText) {
const count = answerBlocks.length;
buttonText.textContent = count === 1 ? 'ответ' : 'ответа';
}
}
});
});
// Функция для получения блоков ответов, связанных с данной кнопкой
function getRelatedAnswerBlocks(answerBtn) {
// Получаем следующий блок комментариев (если он есть)
let currentElement = answerBtn;
let answerBlocks = [];
// Собираем все блоки ответов до следующего основного комментария или кнопки ответов
while ((currentElement = currentElement.nextElementSibling) !== null) {
if (currentElement.classList.contains('comment-block') && !currentElement.classList.contains('answer-block')) {
// Достигли следующего основного комментария, прерываем сбор
break;
} else if (currentElement.classList.contains('answer-btn')) {
// Достигли следующей кнопки ответов, прерываем сбор
break;
} else if (currentElement.classList.contains('answer-block')) {
// Это блок ответа, добавляем в коллекцию
answerBlocks.push(currentElement);
}
}
return answerBlocks;
}
// Обработчики нажатия на кнопки ответов
answerbtns.forEach((answerbtn) => {
answerbtn.addEventListener('click', () => {
// Получаем все блоки ответов для этого комментария
const answerBlocks = getRelatedAnswerBlocks(answerbtn);
if (answerBlocks.length === 0) return;
// Определяем, развернуты ли ответы сейчас
const isCurrentlyActive = answerbtn.querySelector('svg').classList.contains('active');
// Переключаем состояние
if (isCurrentlyActive) {
// Скрываем все ответы
answerBlocks.forEach(block => {
block.classList.remove('active');
});
// Обновляем состояние кнопки
answerbtn.querySelector('svg').classList.remove('active');
// Обновляем текст кнопки
let buttonText = answerbtn.querySelector('span');
if (buttonText) {
const count = answerBlocks.length;
buttonText.textContent = count === 1 ? 'ответ' : 'ответа';
}
} else {
// Показываем все ответы
answerBlocks.forEach(block => {
block.classList.add('active');
});
// Обновляем состояние кнопки
answerbtn.querySelector('svg').classList.add('active');
// Обновляем текст кнопки
let buttonText = answerbtn.querySelector('span');
if (buttonText) {
buttonText.textContent = 'Свернуть';
}
}
});
});
// Обработка нажатия на кнопку "Ответить" на комментарий
document.addEventListener('DOMContentLoaded', function() {
// Получаем все кнопки "Ответить" на странице
const replyButtons = document.querySelectorAll('.reply-to-comment');
// Добавляем обработчик на каждую кнопку
replyButtons.forEach(button => {
button.addEventListener('click', function() {
// Получаем ID комментария, на который отвечаем
const commentId = this.getAttribute('data-comment-id');
const postId = this.getAttribute('data-post-id');
const replyToName = this.getAttribute('data-reply-to');
// Получаем контейнер для формы ответа
const replyFormContainer = document.getElementById('reply-form-' + commentId);
// Если форма уже открыта, скрываем её
if (replyFormContainer.style.display !== 'none') {
replyFormContainer.style.display = 'none';
return;
}
// Скрываем все открытые формы ответов
document.querySelectorAll('.reply-form-container').forEach(container => {
container.style.display = 'none';
});
// Клонируем основную форму комментариев
const originalForm = document.getElementById('commentform');
if (originalForm) {
const clonedForm = originalForm.cloneNode(true);
// Изменяем атрибуты формы для ответа
clonedForm.id = 'commentform-reply-' + commentId;
// Добавляем скрытое поле с ID родительского комментария
const hiddenInput = document.createElement('input');
hiddenInput.type = 'hidden';
hiddenInput.name = 'comment_parent';
hiddenInput.value = commentId;
clonedForm.appendChild(hiddenInput);
// Изменяем заголовок формы
const formTitle = clonedForm.querySelector('.comment-reply-title');
if (formTitle) {
formTitle.textContent = 'Ответить ' + replyToName;
}
// Добавляем кнопку отмены
const cancelButton = document.createElement('button');
cancelButton.type = 'button';
cancelButton.className = 'cancel-reply-btn';
cancelButton.textContent = 'Отменить';
cancelButton.addEventListener('click', function() {
replyFormContainer.style.display = 'none';
});
// Добавляем кнопку отмены в форму
const submitContainer = clonedForm.querySelector('.form-submit');
if (submitContainer) {
submitContainer.appendChild(cancelButton);
}
// Очищаем контейнер и добавляем клонированную форму
replyFormContainer.innerHTML = '';
replyFormContainer.appendChild(clonedForm);
// Показываем форму
replyFormContainer.style.display = 'block';
// Фокусируемся на текстовой области
const textarea = clonedForm.querySelector('textarea');
if (textarea) {
textarea.focus();
}
}
});
});
});

@ -0,0 +1,200 @@
/* Editorial */
.editorial {
padding-bottom: 68px;
}
.editorial-head {
position: relative;
z-index: 1;
max-width: 841px;
margin-bottom: 37px;
}
.editorial-head__title {
font-size: 82px;
line-height: 96px;
font-weight: bold;
color: var(--main_white);
text-transform: uppercase;
}
.editorial-head__img {
position: absolute;
z-index: -1;
top: -14px;
right: -20px;
width: 221px;
}
.editorial-head__star {
position: absolute;
top: 8.26px;
right: -13.5px;
transform: translateX(100%);
width: 87.5px;
}
.editorial-card__wrap {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 31px 25px;
position: relative;
z-index: 1;
}
.editorial-card {
border: 2px solid var(--creme-white);
border-radius: 30px;
display: flex;
align-items: stretch;
overflow: hidden;
background: var(--linear);
backdrop-filter: blur(28px);
}
.editorial-card .main-img {
min-height: 282px;
width: 207px;
border-radius: 29px;
overflow: hidden;
flex-shrink: 0;
}
.editorial-card:hover .main-img img{
width: 120%;
height: 120%;
}
.editorial-card .main-img img {
width: 100%;
height: 100%;
object-fit: cover;
transition: all .5s;
}
.editorial-card__content {
padding: 42px 19px 19px 35px;
}
.editorial-card__content-alerts {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 7px;
margin-bottom: 17px;
}
.editorial-card__content-alerts a {
background: var(--main_black);
border-radius: 16px;
padding: 6px 8px;
font-size: 16px;
font-weight: 500;
line-height: 20px;
color: var(--background);
}
.editorial-card__content-title {
font-size: 28px;
font-weight: bold;
line-height: 32px;
color: var(--grey-black);
text-transform: uppercase;
margin-bottom: 17px;
}
.editorial-card__content-data {
display: flex;
flex-wrap: wrap;
gap: 5px 16px;
color: var(--interface_hover);
font-size: 16px;
font-weight: 500;
line-height: 20px;
}
.editorial-card__content-data ul {
display: flex;
align-items: center;
gap: 16px;
}
.editorial-card__content-data li {
display: flex;
align-items: center;
gap: 5px;
}
.editorial-card__content-data .logo img {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
}
/* Editorial end */
@media (max-width: 1200px) {
.editorial-card__wrap {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
}
@media (max-width: 992px) {
.editorial {
padding-bottom: 36px;
}
.editorial-head {
margin-bottom: 36px;
max-width: 313px;
}
.editorial-head__title {
font-size: 32px;
line-height: 38px;
}
.editorial-head__img {
width: 100px;
top: -14px;
right: -22.5px;
}
.editorial-head__star {
display: none;
}
}
@media (max-width: 576px) {
.editorial-card {
flex-direction: column;
border-radius: 30px;
position: relative;
}
.editorial-card .main-img {
width: 100%;
height: 203px;
}
.editorial-card__content {
padding: 17px 13px 24px;
}
.editorial-card__content-alerts {
position: absolute;
top: 13px;
left: 8px;
width: calc(100% - 16px);
}
.editorial-card__content-title {
font-size: 20px;
line-height: 24px;
margin-bottom: 17px;
}
.editorial-card__content-data {
gap: 5px 16px;
}
}

@ -0,0 +1,3 @@
<svg width="24" height="21" viewBox="0 0 24 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7934 0.742188C14.0742 0.742188 12.4292 3.534 12.0716 4.92991C11.8093 3.534 10.2263 0.742188 5.99218 0.742188C0.699506 0.742188 -1.66074 7.7458 2.98823 13.7386C6.7074 18.5328 10.5935 20.4052 12.0716 20.7422C13.7166 20.4293 17.8935 18.4895 21.4411 13.2332C25.8755 6.66277 22.4424 0.742188 17.7934 0.742188Z" fill="#FE8D8D"/>
</svg>

After

Width:  |  Height:  |  Size: 439 B

@ -0,0 +1,11 @@
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.76298 4.44735C3.06952 5.67081 2.13126 7.27684 2.13126 8.95074C2.13126 10.9189 3.43754 12.8055 5.72596 14.0611C6.06925 14.2494 6.23788 14.6639 6.12924 15.0523C5.80108 16.2254 4.97453 17.5082 4.37705 18.4355C4.35717 18.4664 4.33755 18.4969 4.3182 18.5269C4.30813 18.5425 4.29815 18.5581 4.28825 18.5734C4.53639 18.4536 4.80635 18.3131 5.09199 18.1538C6.28443 17.4885 7.6774 16.5358 8.80068 15.5042C8.98115 15.3384 9.22254 15.2642 9.46036 15.3013C10.1165 15.4037 10.7989 15.4578 11.5 15.4578C14.1673 15.4578 16.5467 14.6753 18.237 13.4541C19.9305 12.2307 20.8687 10.6246 20.8687 8.95074C20.8687 7.27684 19.9305 5.67081 18.237 4.44735C16.5467 3.22618 14.1673 2.44368 11.5 2.44368C8.83266 2.44368 6.45327 3.22618 4.76298 4.44735ZM3.0195 19.0408C3.01951 19.0408 3.02033 19.0407 3.02191 19.0407C3.02027 19.0408 3.01948 19.0408 3.0195 19.0408ZM3.83415 3.04862C5.82987 1.60678 8.54267 0.742188 11.5 0.742188C14.4573 0.742188 17.1701 1.60678 19.1659 3.04862C21.1584 4.48816 22.5 6.56104 22.5 8.95074C22.5 11.3404 21.1584 13.4133 19.1659 14.8529C17.1701 16.2947 14.4573 17.1593 11.5 17.1593C10.8501 17.1593 10.2129 17.1176 9.59312 17.0374C8.41664 18.0694 7.04427 18.9942 5.86135 19.6541C5.22123 20.0112 4.61837 20.301 4.11684 20.4893C3.86744 20.583 3.62444 20.6586 3.40353 20.7017C3.21456 20.7385 2.91813 20.7785 2.63153 20.6825C2.42855 20.6146 2.21877 20.4705 2.08381 20.2244C1.95926 19.9972 1.94674 19.7703 1.95698 19.6181C1.97576 19.3391 2.08812 19.078 2.17184 18.9038C2.35249 18.5281 2.6576 18.0542 2.9561 17.5905L2.96393 17.5784C3.47206 16.7891 4.00731 15.953 4.33796 15.1946C2.0636 13.7424 0.5 11.537 0.5 8.95074C0.5 6.56104 1.84159 4.48816 3.83415 3.04862Z" fill="url(#paint0_radial_11432_38673)"/>
<defs>
<radialGradient id="paint0_radial_11432_38673" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.5 0.742189) rotate(137.726) scale(29.7321 40.4084)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -173,4 +173,8 @@
.home-card__content-body__link:hover{
background-color: #000;
color: #fff;
}
.blog-home{
padding-bottom: 4rem;
}

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 389 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 244 B

@ -1,23 +1,22 @@
<?php
add_filter('timber/context', function($context) {
$current_category = get_queried_object(); // Получаем текущую категорию
// Простой запрос для получения последних постов
$args = array(
'post_type' => 'post',
'posts_per_page' => 3, // Количество постов
'orderby' => 'meta_value_num',
'key' => 'post_views', // Поле плагина для подсчёта просмотров
'order' => 'DESC', // Сортировка по убыванию
// Условие для фильтрации по текущей категории
'category__in' => $current_category ? array($current_category->term_id) : '',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'DESC'
);
$most_read_query = new WP_Query($args);
$most_read = new Timber\PostQuery($most_read_query);
$context['most_read'] = $most_read;
// Добавляем отладочную информацию
global $wpdb;
$debug_info = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE meta_key LIKE '%view%' LIMIT 5");
$context['debug_info'] = $debug_info;
return $context;
});
});

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -122,4 +122,336 @@ p.discount-description__2 {
font-weight: 500;
color: var(--main_black);
}
/* Discount end */
/* Discount end */
/* Article home */
.article-home {
padding-bottom: 36px;
}
.article-home h1 {
font-size: 64px;
font-weight: bold;
line-height: 120%;
color: var(--main_white);
margin-bottom: 17px;
text-transform: uppercase;
}
.article-home__data {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 24px;
margin-bottom: 17px;
}
.article-home__data-alerts {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.article-home__data-alerts a {
font-size: 16px;
line-height: 20px;
font-weight: 500;
color: var(--background);
padding: 6px 8px;
border-radius: 20px;
background: var(--main_black);
}
.article-home__data p {
font-size: 14px;
line-height: 16px;
font-weight: 500;
color: var(--main_white);
display: flex;
align-items: center;
gap: 4px;
}
.article-home__data .user {
display: flex;
align-items: center;
gap: 7px;
font-size: 14px;
line-height: 16px;
font-weight: 500;
color: var(--main_white);
}
.article-home__data .user img {
width: 32px;
height: 32px;
border-radius: 50px;
object-fit: cover;
}
.article-home__card {
width: 100%;
aspect-ratio: 1223/500;
}
.article-home__card img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 64px;
}
@media (min-width: 992px) {
.article-home.position-1 .container {
position: relative;
z-index: 1;
}
.article-home.position-1 .article-home__card {
width: calc(50% - 12px);
position: absolute;
top: 0;
right: 0;
height: 100%;
z-index: -1;
}
.article-home.position-1 h1 {
width: calc(50% - 12px);
}
.article-home.position-1 .article-home__data {
max-width: 406px;
}
.article-home.position-2 .container {
position: relative;
z-index: 1;
height: 695px;
padding: 45px 42px;
}
.article-home.position-2 .article-home__card {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
overflow: hidden;
}
.article-home.position-2 .article-home__card::before {
content: "";
width: 100%;
height: 100%;
background: linear-gradient(282.92deg, rgba(255, 255, 255, 0) 50.1%, #FFFFFF 77.26%);
position: absolute;
top: 0;
left: 0;
border-radius: 50px;
}
.article-home.position-2 h1 {
color: var(--main_black);
max-width: 838px;
}
.article-home.position-2 .article-home__data {
width: 304px;
}
.article-home.position-2 .article-home__data p {
color: var(--main_black);
}
.article-home.position-2 .article-home__data p img {
filter: brightness(0) invert(0)
}
.article-home.position-2 .article-home__data .user {
color: var(--main_black);
}
}
.article-content {
background: var(--main_white);
border-radius: 64px;
max-width: 1232px;
margin: 0 auto;
padding: 64px 0 116px;
}
.article-container {
max-width: 1022px;
margin: 0 auto;
@media (max-width: 1054px) {
max-width: calc(100% - 32px);
}
}
/* Article home end */
/* comment */
.comment {
border-top: 1px solid var(--placeholder);
padding-top: 48px;
margin-top: 100px;
}
.comment .comment-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
}
.comment .comment-btn button {
padding: 12px 24px;
border-radius: 20px;
display: flex;
align-items: center;
gap: 8px;
background: var(--btn-bg);
font-size: 20px;
font-weight: 600;
line-height: 24px;
font-family: var(--font-craftwork);
}
.comment .comment-btn span {
font-family: var(--font-craftwork);
font-size: 20px;
font-weight: 500;
line-height: 24px;
}
.comment .comment-title {
font-family: var(--font-craftwork);
font-size: 24px;
font-weight: 700;
line-height: 28px;
color: var(--grey-black);
margin: 48px 0 0 0;
}
.comment .comment-in {
max-width: 816px;
margin: 0 auto;
}
.comment .comment-block {
margin-top: 40px;
padding: 28px 48px;
border-radius: 24px;
background: var(--grey-f5);
}
.comment .comment-block p {
font-size: 20px;
font-weight: 500;
line-height: 24px;
color: var(--grey-black);
}
.comment .comment-block p a {
color: var(--green-dark);
text-decoration: underline;
}
.comment .comment-user {
display: flex;
align-items: center;
gap: 12px;
}
.comment .comment-user img {
width: 48px;
height: 48px;
border-radius: 50%;
flex-shrink: 0;
}
.comment .comment-user h6 {
font-size: 20px;
font-weight: 700;
line-height: 24px;
color: var(---main_black);
margin-bottom: 5px;
}
.comment .comment-user span {
font-size: 14px;
font-weight: 500;
line-height: 16px;
color: var(--interface_hover);
}
.comment .comment-block p {
margin: 15px 0;
font-size: 20px;
font-weight: 500;
line-height: 24px;
color: var(---main_black);
}
.comment .comment-btns {
display: flex;
align-items: center;
gap: 33px;
}
.comment .comment-btns button {
font-size: 14px;
font-weight: 500;
line-height: 16px;
color: var(--interface_hover);
display: flex;
align-items: center;
gap: 5px;
}
.comment .answer-btn {
margin-bottom: 10px;
font-family: var(--font-craftwork);
font-size: 16px;
font-weight: 700;
line-height: 20px;
color: var(--green-dark);
display: flex;
align-items: center;
gap: 8px;
padding: 6px 24px;
text-transform: lowercase;
}
.comment .answer-btn svg {
transition: .2s ease;
}
.comment .answer-btn svg.active {
transform: rotate(180deg);
}
.comment .answer-block {
display: none;
margin: 0 0 0 54px;
}
.comment .answer-block.active {
display: block;
}
.comment .comment-block_text {
margin: 0 !important;
}
.other-home {
padding-top: 36px !important;
}
/* comment */

@ -59,4 +59,87 @@
font-size: 12px;
line-height: 120%;
}
.article-home {
padding-bottom: 36px;
}
.article-home .container {
display: flex;
flex-direction: column;
}
.article-home h1 {
order: 1;
font-size: 32px;
line-height: 38px;
margin-bottom: 15px;
}
.article-home__card {
order: 2;
}
.article-home__card img {
border-radius: 32px;
}
.article-home__data {
gap: 8px 16px;
order: 3;
margin: 15px 0 0;
}
.article-home__data-alerts {
gap: 16px;
}
.article-home__data-alerts a {
padding: 6px 8px;
}
.article-content {
padding: 48px 0;
border-radius: 64px;
}
.comment .comment-block {
padding: 20px 24px;
margin-top: 28px;
}
.comment .comment-title {
padding-bottom: 20px;
}
.comment .answer-block {
margin: 10px 0 0 42px;
}
.comment .comment-user h6 {
font-size: 16px;
line-height: 24px;
}
.comment .comment-block p {
font-size: 16px;
line-height: 24px;
}
.comment .comment-btns {
gap: 14px;
}
.comment .comment-btns button {
font-size: 12px;
line-height: 16px;
}
.comment .comment-user span {
font-size: 12px;
line-height: 16px;
}
}

@ -0,0 +1,147 @@
jQuery(document).ready(function ($) {
$(".comment-btn button").on("click", function () {
var postId = $(this).data("post-id");
var $button = $(this);
$.ajax({
url: "/wp-admin/admin-ajax.php",
type: "POST",
data: {
action: "add_post_like",
post_id: postId,
},
success: function (response) {
if (response.error) {
alert(response.error);
window.location.href = "/wp-login.php";
return;
}
$(".comment-btn span").text(response.count);
if (response.is_liked) {
$button.addClass("active");
$button.find("svg path").attr({
fill: "rgba(255, 0, 0, 0.7)",
stroke: "#ff0000",
});
} else {
$button.removeClass("active");
$button.find("svg path").attr({
fill: "rgb(18, 18, 18)",
stroke: "#666666",
});
}
},
error: function (error) {
if (error.responseJSON && error.responseJSON.data) {
alert(error.responseJSON.data);
window.location.href = "/wp-login.php";
}
},
});
});
$(document).on("click", ".comment-like-btn", function () {
var commentId = $(this).data("comment-id");
var $button = $(this);
$.ajax({
url: "/wp-admin/admin-ajax.php",
type: "POST",
data: {
action: "add_comment_like",
comment_id: commentId,
},
success: function (response) {
if (response.error) {
alert(response.error);
window.location.href = "/wp-login.php";
return;
}
if (response.is_liked) {
$button
.empty()
.append(
$(
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"></path></svg>'
)
)
.append(response.count);
$button.addClass("active");
} else {
$button
.empty()
.append(
$(
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#666666" fill="none"></path></svg>'
)
)
.append(response.count);
$button.removeClass("active");
}
},
error: function (error) {
if (error.responseJSON && error.responseJSON.data) {
alert(error.responseJSON.data);
window.location.href = "/wp-login.php";
}
},
});
});
function checkLikedPosts() {
if (!document.body.classList.contains("logged-in")) {
return;
}
$.ajax({
url: "/wp-admin/admin-ajax.php",
type: "POST",
data: {
action: "check_user_likes",
},
success: function (response) {
if (response.error) {
return;
}
try {
var data = JSON.parse(response);
if (data.posts && data.posts.length > 0) {
for (var i = 0; i < data.posts.length; i++) {
var $button = $('.comment-btn button[data-post-id="' + data.posts[i] + '"]');
$button.addClass("active");
$button.find("svg path").attr({
fill: "rgba(255, 0, 0, 0.7)",
stroke: "#ff0000",
});
}
}
if (data.comments && data.comments.length > 0) {
for (var j = 0; j < data.comments.length; j++) {
var $commentButton = $('.comment-like-btn[data-comment-id="' + data.comments[j] + '"]');
$commentButton.addClass("active");
$commentButton.find("svg path").attr({
fill: "rgba(255, 0, 0, 0.7)",
stroke: "#ff0000",
});
}
}
} catch (e) {}
},
error: function (error) {},
});
}
if (document.body.classList.contains("logged-in")) {
checkLikedPosts();
}
});

@ -2,4 +2,6 @@
include_component('blog', 'featured-slider');
$context = Timber::get_context();
$post = Timber::get_post();
$context['post'] = $post;
Timber::render('blog/blog-single.twig', $context);

@ -2,17 +2,7 @@
class BlogPost extends \Timber\Post
{
/**
* Estimates time required to read a post.
*
* The words per minute are based on the English language, which e.g. is much
* faster than German or French.
*
* @link https://www.irisreading.com/average-reading-speed-in-various-languages/
*
* @return string
*/
public function reading_time()
{
$symb_per_minute = 2280;
@ -20,7 +10,6 @@ class BlogPost extends \Timber\Post
$symb = strlen(wp_strip_all_tags($this->content()));
$minutes = round($symb / $symb_per_minute);
/* translators: %s: Time duration in minute or minutes. */
return sprintf(_n('%s ' . pll__('мин.'), '%s ' . pll__('мин.'), $minutes), (int) $minutes);
}
public function get_author_name()
@ -35,6 +24,19 @@ class BlogPost extends \Timber\Post
$id = get_field('post_author', $this->ID);
return get_the_post_thumbnail_url( $id, 'thumbnail' );
}
public function get_author_link()
{
$id = get_field('post_author', $this->ID);
if ($id) {
return get_permalink($id);
}
return false;
}
public function get_comments_number()
{
return get_comments_number($this->ID);
}
}
add_filter('timber/post/classmap', function ($classmap) {
@ -43,4 +45,43 @@ add_filter('timber/post/classmap', function ($classmap) {
];
return array_merge($classmap, $custom_classmap);
});
});
function enable_comments_for_posts() {
update_option('default_comment_status', 'open');
$posts = get_posts([
'post_type' => 'post',
'numberposts' => -1,
'post_status' => 'publish'
]);
foreach ($posts as $post) {
if (!comments_open($post->ID)) {
update_post_meta($post->ID, 'comment_status', 'open');
}
}
}
add_action('after_setup_theme', 'enable_comments_for_posts');
function enqueue_comment_scripts() {
if (is_singular() && comments_open()) {
wp_enqueue_script('comment-reply');
wp_enqueue_script(
'blog-comments-js',
get_template_directory_uri() . '/modules/blog/assets/js/comments.js',
array('jquery', 'comment-reply'),
filemtime(get_template_directory() . '/modules/blog/assets/js/comments.js'),
true
);
wp_localize_script('blog-comments-js', 'ajax_object', array(
'ajax_url' => admin_url('admin-ajax.php')
));
}
}
add_action('wp_enqueue_scripts', 'enqueue_comment_scripts');

@ -151,4 +151,56 @@
text-decoration: underline;
}
/* Footer end */
.modal__aside {
position: fixed;
top: 0;
right: 0;
width: 0;
height: 100%;
overflow: hidden;
transition: width .4s ease-out;
}
.modal__item {
height: 100%;
padding: 24px;
background: var(--background-white);
position: relative;
display: none;
filter: blur(10px);
transition: filter .2s ease-out;
}
.modal__login {
width: 500px;
}
.modal__item.active {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.modal__close {
position: absolute;
top: 32px;
right: 24px;
width: 24px;
height: 24px;
border: none;
background: none;
}
.login_wrap {
height: 100%;
}
.social-media__icon {
width: 32px;
aspect-ratio: 1;
}
.login_btn {
margin-bottom: 24px;
}

@ -0,0 +1,957 @@
'use strict';
(function ($) {
const metaLocale = document.querySelector('meta[property="og:locale"]');
const localeValue = metaLocale.getAttribute('content');
function wc_cart_summary_upd(){
let total = 0
$('.cart_item').each(function(){
total += Number($(this).data('cost'))
})
return total
}
$('[data-pname]').on('click', function(){
$('#sub_product_name').val($(this).data('pname'))
})
$(document).on('submit', '.product-item__form, .detail-block__form', function (e) {
e.preventDefault();
var $form = $(this)
var product_qty = $form.find('input[name=quantity]').val() || 1
var product_id = $form.find('input[name=product_id]').val()
var variation_id = $form.find('input[name=variation_id]').val() || 0;
var title = $(this).data('name')
var data = {
action: 'woocommerce_ajax_add_to_cart',
product_id: product_id,
product_sku: '',
quantity: product_qty,
variation_id: variation_id,
};
dataLayer.push({
"ecommerce": {
"currencyCode": "RUB",
"add": {
"products": [
{
"id": product_id,
"name": title,
"quantity": product_qty,
}
]
}
}
});
// $(document.body).trigger('adding_to_cart', [$thisbutton, data]);
$.ajax({
type: 'post',
url: woocommerce_params.ajax_url,
data: data,
beforeSend: function (response) {
$form.find('.detail-block-form__submit, .store-add-to-cart').addClass('loading').attr('disabled', true)
},
complete: function (response) {
$form.find('.detail-block-form__submit, .store-add-to-cart').removeClass('loading').attr('disabled', false)
},
success: function (response) {
$('.modal__item.modal__basket').html(response['cart']);
if(response['cart_count'] > 0){
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count'])
}
else{
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count'])
}
initCounters();
let modalF = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
device = window.screen.width;
if(!$.cookie('gp-cosmopet-cartadd')){
modalF.classList.add('active');
$('.modal__basket').addClass('active');
let thisContentElement = document.querySelector('.modal__basket');
let width = thisContentElement.clientWidth;
setTimeout(() => {
if (device <= 720) {
aside.style.width = `${device}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}else{
aside.style.width = `${width}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}
}, 10);
$.cookie('gp-cosmopet-cartadd', 'true', { expires: 2 });
}
modalClose('.modal__close');
},
});
return false;
});
$(document).on('submit', '.modal__form-sub', function (e) {
e.preventDefault();
var email = $(this).find('input[name="email"]').val()
var data = $(this).serialize()
$.ajax({
type: 'post',
url: woocommerce_params.ajax_url,
data: data,
beforeSend: function (response) {
// $thisbutton.removeClass('added').addClass('loading');
},
complete: function (response) {
// $thisbutton.addClass('added').removeClass('loading');
},
success: function (response) {
$('.modal__to-know').removeClass('active')
$('#sub-result-email').html(email)
$('.modal__to-know-submit').addClass('active').css('filter', 'blur(0px)')
},
});
});
$(document).on('submit', '.form--contact', function (e) {
e.preventDefault();
var form = this;
var data = $(this).serialize()
$.ajax({
type: 'post',
url: woocommerce_params.ajax_url,
data: data,
beforeSend: function (response) {
// $thisbutton.removeClass('added').addClass('loading');
},
complete: function (response) {
// $thisbutton.addClass('added').removeClass('loading');
},
success: function (response) {
$(form).addClass('submited')
},
});
});
$('body').on('click', '.modal-basket__item .counter__button', function(){
var input = $(this).closest('.counter').find('.counter__input').val()
var price = $(this).closest('.modal-basket-item__control').find('.modal-basket-item__price')
var productID = $(this).data('id')
var pr = $(this).closest('.modal-basket__item').find('.modal-basket__item-before').data('pr')
$(price).html(Number(input) * $(price).data('basecost'))
$(this).closest('.modal-basket__item').data('cost', Number(price.html()))
$('#cart_total').html(wc_cart_summary_upd())
var title = $(this).closest('.cart_item').find('.modal-basket-item__title').html()
if ($(this).hasClass('minus')){
$(this).attr('data-value', Number( $(this).attr('data-value')) - 1)
if(Number($(this).attr('data-value')) == 0){
$(this).closest('.modal-basket__item').find('.modal-basket__item-before').click()
}
dataLayer.push({
"ecommerce": {
"currencyCode": "RUB",
"remove": {
"products": [
{
"id": pr,
"name": title,
"quantity": 1,
}
]
}
}
});
}
else{
var min = $(this).closest('.counter--small').find('.minus')
$(min).attr('data-value', Number($(min).attr('data-value')) + 1)
dataLayer.push({
"ecommerce": {
"currencyCode": "RUB",
"add": {
"products": [
{
"id": pr,
"name": title,
"quantity": 1,
}
]
}
}
});
}
// if ($(this).hasClass('minus') && Number(input) == 1){
// $(this).closest('.modal-basket__item').find('.modal-basket__item-before').click()
// }
var data = {
action: 'get_cartprice',
quantity: input,
product: productID
};
$.ajax({
type: 'post',
url: '/wp-admin/admin-ajax.php',
data: data,
beforeSend: function (response) {
// $thisbutton.removeClass('added').addClass('loading');
},
complete: function (response) {
// $thisbutton.addClass('added').removeClass('loading');
},
success: function (response) {
if (response.error) {
} else {
// $('#cart_total').html(response)
initCounters()
if(response['cart_count'] > 0){
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count'])
}
else{
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count'])
}
}
},
});
})
$('body').on('click', '.product-item-overlay__field .counter__button', function(){
var input = $(this).closest('.counter').find('.counter__input').val()
var price = $(this).closest('.product-item__form').find('.product-item-overlay__price')
$(price).html(Number(input) * $(price).data('basecost'))
})
$('body').on('click', '.modal-basket__item-before', function(){
var key = $(this).data('id')
var p_ID = $(this).data('pr');
var var_ID = $(this).data('var');
var quantity = $(this).closest('.modal-basket__item').find('.counter__input').val()
var layout = `
<p class="modal-basket-item__title">
Удаление товара из корзины: <span id="${key}_timer" class="timer_counter">5</span>с
</p>
<button class="modal-basket-item__return" id="${key}_return" data-id="${p_ID}" data-var="${var_ID}" data-quantity="${quantity}">
Восстановить
</button>
`
if(localeValue == 'en_US'){
var layout = `
<p class="modal-basket-item__title">
Removing product from cart: <span id="${key}_timer" class="timer_counter">5</span>s
</p>
<button class="modal-basket-item__return" id="${key}_return" data-id="${p_ID}" data-var="${var_ID}" data-quantity="${quantity}">
Restore
</button>
`
}
var old_html = $(this).closest('.modal-basket__item').html()
$(this).closest('.modal-basket__item').addClass('.modal-basket__item--return').html(layout)
var title = $(this).closest('.cart_item').find('.modal-basket-item__title').html()
var timerVal = 5;
var interval = setInterval(function(){
timerVal -= 1;
if (timerVal > 0){
$(`#${key}_timer`).html(timerVal)
}
else{
dataLayer.push({
"ecommerce": {
"currencyCode": "RUB",
"remove": {
"products": [
{
"id": p_ID,
"name": title,
"quantity": quantity,
}
]
}
}
});
var input = 0;
var productID = key;
var data = {
action: 'get_cartprice',
quantity: input,
product: productID
};
$.ajax({
type: 'post',
url: '/wp-admin/admin-ajax.php',
data: data,
beforeSend: function (response) {
// $thisbutton.removeClass('added').addClass('loading');
},
complete: function (response) {
// $thisbutton.addClass('added').removeClass('loading');
},
success: function (response) {
if(response['cart_count'] > 0){
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count'])
}
else{
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count'])
}
},
});
$(`#${key}_timer`).closest('.modal-basket__item').remove()
if (Number(wc_cart_summary_upd()) > 0){
$('#cart_total').html(wc_cart_summary_upd())
}
else{
var tmpl = `<div class="modal__header --nb">
<p class="modal__title">Корзина</p>
<p class="modal__text">Ваша корзина пуста</p>
</div>
<div class="modal__footer">
<div class="modal__block-button">
<div class="modal__button">
<a href="/shop/" class="button button--100-perc button--link button--white">
Продолжить покупки
</a>
</div>
</div>
</div>`
if(localeValue == 'en_US'){
var tmpl = `<div class="modal__header --nb">
<p class="modal__title">Cart</p>
<p class="modal__text">Your cart is empty</p>
</div>
<div class="modal__footer">
<div class="modal__block-button">
<div class="modal__button">
<a href="/en/shop-3/" class="button button--100-perc button--link button--white">
Return to catalog
</a>
</div>
</div>
</div>`
}
$('.modal__basket').html(tmpl)
}
clearInterval(interval);
}
}, 1000)
$(`#${key}_return`).one('click', function(){
$(this).closest('.modal-basket__item').removeClass('.modal-basket__item--return').html(old_html)
clearInterval(interval);
})
})
$('body').on('click', '.state__button', function(){
var s = $(this).closest('.select')
var id = $(this).data('id')
var bc = $(this).data('bc')
var form = $(this).closest('.product-item__form')
$(form).find('input[name="variation_id"]').val(id)
$(form).find('.counter__input').data('maxcount', $(this).data('stock')).attr('data-maxcount', $(this).data('stock'))
if (Number($(form).find('.counter__input').val()) > Number($(form).find('.counter__input').data('maxcount'))){
$(form).find('.counter__input').val($(form).find('.counter__input').data('maxcount'))
}
var input = $(form).find('.counter__input').val()
$(form).find('.product-item-overlay__price').data('basecost', bc).html(Number(bc) * Number(input))
})
$('body').on('click', '.btn-load-ajax', function(){
var page = Number($(this).data('page')) + 1
var maxpage = Number($(this).data('maxpage'))
var data = {
ajax_load: 'ajax',
};
var btn = this
var baseUrl = jQuery(location).attr('origin') + jQuery(location).attr('pathname')
baseUrl += 'page/' + page + '/'
var searchUrl = baseUrl
if (jQuery(location).attr('search')){
searchUrl += jQuery(location).attr('search') + '&ajax_search=ajax'
}
else{
searchUrl += '?ajax_search=ajax'
}
$.ajax({
type: 'get',
url: searchUrl,
data: data,
beforeSend: function (response) {
$(btn).attr('disabled', true)
$(btn).attr('data-page', page)
$(btn).data('page', page)
},
complete: function (response) {
if (page >= maxpage){
$(btn).remove()
}
else{
$(btn).attr('disabled', false)
}
},
success: function (response) {
$('.products').append(response)
initCounters()
initOverlay()
initSelect()
modalOpen('.open-to-know', '.modal__to-know');
/// РЕШЕНИЕ ДЛЯ СТЕНДА AJAX ДЛЯ ПОДГРУЗКИ AJAX
document.querySelectorAll('img').forEach(img => {
var str = img.attributes['src'].value.replace('https://cosmopet.good-production.xyz/', 'https://cosmopet.shop/')
checkImage(str, function(){ img.attributes['src'].value = str });
if (img.attributes['srcset']){
img.attributes['srcset'].value = img.attributes['srcset'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>')
}
})
//
},
});
})
// $('body').on('click', '.singular-w-btn', function(){
// var wg = $(this).data('wg')
// var id = $(this).data('id')
// $('#variation_id').val(id)
// $('.detail__block-price').hide()
// $('.detail__block-price[data-wg="' + wg + '"]').show()
// if ($(this).data('available')){
// $('.detail-block-form__item--tn').hide()
// $('.detail-block-form__item--add').show()
// }
// else{
// $('.detail-block-form__item--tn').show()
// $('.detail-block-form__item--add').hide()
// }
// })
// асинхронный запрос при отправке формы
$( '#ajaxform' ).on( 'submit',function( event ) {
event.preventDefault();
const form = $(this);
$.ajax( {
type : 'POST',
url : woocommerce_params.ajax_url,
data : form.serialize(),
beforeSend : function( xhr ) {
$('.products').addClass('loading')
form.find('.button-submit').addClass('loading').attr('disabled', true)
},
success : function( data ) {
$( '.products' ).html( data.products );
$('.product__tag').html(data.tags);
$( '.btn-load-ajax' ).remove()
form.find('.button-submit').removeClass('loading').attr('disabled', false)
form.find('.modal__close').click()
$('.products').removeClass('loading')
if (data.err){
$('.product__error-button').show()
}
else{
$('.product__error-button').hide()
}
initCounters()
initOverlay()
initSelect()
modalOpen('.open-to-know', '.modal__to-know');
document.querySelectorAll('img').forEach(img => {
var str = img.attributes['src'].value.replace('https://cosmopet.good-production.xyz/', 'https://cosmopet.shop/')
checkImage(str, function(){ img.attributes['src'].value = str });
if (img.attributes['srcset']){
img.attributes['srcset'].value = img.attributes['srcset'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>')
}
})
}
} );
} );
$('body').on('click', '.product-tag__item', function(){
$('#tax_' + $(this).data('tag')).find('input').prop('checked', false)
$('#tax_' + $(this).data('tag')).removeClass('active');
$(this).remove()
$('#ajaxform').submit()
})
// Login
$('.login_popup').on('click', function(e){
e.preventDefault();
$('.login_modal').addClass('active');
});
$('.login_close').on('click', function(){
$('.login_modal').removeClass('active');
});
$('.login_back').on('click', function(){
if($(this).is('.disabled')) {
return false;
}
$('.login_wrap .step').toggleClass('active');
});
$('.login_input input').on('input keyup', function(){
$('.login_input').removeClass('error');
});
$('.js-get-code').on('click', function(){
$('.login_input').removeClass('error');
var email = $('.js-input-email input').val();
$('.sended_email').text(email);
if(email === '') {
$('.js-input-email').addClass('error');
$('.js-input-email .login_error').text(localeValue == 'en_US' ? 'Enter your email' : 'Укажите Email');
return false;
} else {
// Проверка Email
$.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {action: 'email_validate', email:email},
success: function(data){
if(data['status'] === 'error') {
$('.js-input-email').addClass('error');
$('.js-input-email .login_error').text(data['text']);
return false;
} else {
$('.login_wrap .step').toggleClass('active');
send_code();
}
}
});
}
});
$('.js-repeat-code').on('click', function(){
$('.login_input').removeClass('error');
send_code();
});
function send_code(){
$('.login_timer').show();
$('.js-repeat-code').hide();
$('.login_back').addClass('disabled');
// Timer
var seconds = 15;
var interval = setInterval(function() {
if (seconds > 0) {
seconds--;
$('.seconds').text(seconds);
} else {
clearInterval(interval);
$('.login_timer').hide();
$('.js-repeat-code').show();
$('.login_back').removeClass('disabled');
$('.seconds').text(15);
}
}, 1000);
//Ajax отправка кода
$.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {action: 'send_code', email: $('.js-input-email input').val()}
});
}
// Проверка кода и регистрация/авторизация
$('.js-input-code input').on('input keydown keyup propertychange paste cut copy change', function(){
var val = $(this).val();
var email = $('.js-input-email input').val();
if(val.length === 4) {
$.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {action: 'check_code', code: val, email: email},
success: function(data){
console.log(data);
if(data['status'] == 'success_reg') {
$('.login_forms').addClass('hide');
$('.login_success').removeClass('hide');
if (typeof wc_checkout_params !== 'undefined') {
location.reload()
}
}
if(data['status'] == 'success_auth') {
$('.login_forms').addClass('hide');
$('.login_auth').removeClass('hide');
if (typeof wc_checkout_params !== 'undefined') {
location.reload()
}
}
if(data['status'] == 'error') {
$('.js-input-code').addClass('error');
$('.js-input-code .login_error').text(data['text']);
}
}
});
}
});
$('.email_link_form').on('submit', function(e){
e.preventDefault();
$('.cabinet-card_linked-email .error').remove();
var data = $(this).serializeArray();
$.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: data,
success: function(data){
if(data['error']) {
$('.cabinet-card_linked-email').append('<div class="cabinet-card__status cabinet-card__status--cancelled error">'+data['error']+'</div>');
} else {
location.reload();
}
}
});
});
})(jQuery);
function checkImage(imageSrc, good) {
var img = new Image();
img.onload = good;
img.src = imageSrc;
}
// header
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false);
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white');
toggleHeader('#phone-menu','.header__menu-block','.header__phone-menu', '.white', 'white');
// header
function initOverlay(){
// overlay
let products = document.querySelectorAll('.product__item');
products.forEach(productItem => {
let button = productItem.querySelector('.open-overlay'),
overlay = productItem.querySelector('.product-item__overlay');
if (button) {
button.onclick = function (e) {
document.querySelectorAll('.product__item').forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
}
});
document.querySelectorAll('.product-item__overlay').forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
}
});
productItem.classList.toggle('active');
overlay.classList.toggle('active');
}
}
})
// overlay
}
initOverlay()
function initSelect(){
// select
toggleOpenX('.select', '.select__state' , '.state__content', '.state__block', true);
let selects = document.querySelectorAll('.select');
selects.forEach(select => {
let state = select.querySelector('.select__state'),
content = select.querySelector('.state__block'),
buttons = select.querySelectorAll('.state__button');
buttons.forEach(e => {
let button = e;
e.onclick = function (event) {
event.preventDefault();
buttons.forEach(element => {
if (element.classList.contains('active')) {
element.classList.remove('active');
}
})
let text = e.textContent.trim();
state.value = text;
button.classList.add('active');
content.style.height = 0;
select.classList.remove('active');
}
})
})
// select
}
initSelect()
// counter
function initCounters(){
let counters = document.querySelectorAll('.counter');
counters.forEach(e => {
let minus = e.querySelector('.minus'),
plus = e.querySelector('.plus'),
input = e.querySelector('.counter__input');
minus.onclick = function (e) {
e.preventDefault();
let number = input.value;
if (number >= 2){
input.value = Number(number) - 1;
input.setAttribute('value', input.value)
}
}
plus.onclick = function (e) {
e.preventDefault();
let number = input.value;
let max = input.dataset.maxcount
if (number <= max - 1) {
input.value = Number(number) + 1;
input.setAttribute('value', input.value)
}
}
})
}
initCounters()
// counter
// checkbox
let checkbox = document.querySelectorAll('.checkbox');
checkbox.forEach(e => {
e.onclick = function (event) {
let input = e.querySelector('.checkbox__input');
if (!e.classList.contains('active')) {
input.checked = 1;
}else{
input.checked = 0;
}
e.classList.toggle('active');
}
})
// checkbox
// function
function modalOpen(buttonElement, contentElement){
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
elements = document.querySelectorAll(buttonElement),
device = window.screen.width;
elements.forEach(e => {
let thisContentElement = document.querySelector(contentElement);
e.onclick = function () {
modal.classList.add('active');
thisContentElement.classList.add('active');
let width = thisContentElement.clientWidth;
setTimeout(() => {
if (device <= 720) {
aside.style.width = `${device}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}else{
aside.style.width = `${width}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}
}, 10);
}
})
}
function modalClose(buttonElement) {
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
asideItems = document.querySelectorAll('.modal__item'),
elements = document.querySelectorAll(buttonElement);
elements.forEach(e => {
e.onclick = function () {
aside.style.width = '0px';
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.style.filter = 'blur(10px)';
}
});
setTimeout(() => {
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
}
});
modal.classList.remove('active');
}, 300);
}
})
}
function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) {
let elements = document.querySelectorAll(mainElement);
elements.forEach(e => {
let thisMainElement = e,
thisButtonElement = e.querySelector(buttonElement),
thisHeightElement = e.querySelector(heightElement),
thisContentElement = e.querySelector(contentElement);
thisButtonElement.onclick = function (e) {
let height = thisHeightElement.clientHeight;
if (close == true && !thisMainElement.classList.contains('active')) {
elements.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
e.querySelector(contentElement).style.height = null
}
})
}
if (!thisMainElement.classList.contains('active')) {
thisContentElement.style.height = `${height}px`;
thisMainElement.classList.add('active');
}else{
thisContentElement.style.height = null;
thisMainElement.classList.remove('active');
}
}
});
}
var menu_opened = false;
function toggleHeader(button, content, blockheight, removeBlock, removeClass) {
let thisButton = document.querySelector(button),
thisContent = document.querySelector(content),
thisRemoveBlock = document.querySelector(removeBlock) || '',
thisBlockheight = document.querySelector(blockheight);
thisButton.onclick = function () {
let height = thisBlockheight.clientHeight;
if (!thisContent.classList.contains('open')) {
thisContent.style.height = `${height}px`;
thisContent.classList .add('open');
if (removeBlock) {
thisRemoveBlock.classList.remove(removeClass);
}
}else{
thisContent.style.height = null;
thisContent.classList.remove('open');
if (removeBlock) {
if (window.Y <= 25) {
thisRemoveBlock.classList.add(removeClass);
}
}
}
menu_opened = !menu_opened;
}
}
// resize
window.addEventListener('resize', (e) => {
let width = window.screen.width;
// media
modalOpen('.button--filter', '.modal__filter');
modalOpen('.basket-open', '.modal__basket');
modalOpen('.login-open', '.modal__login');
modalOpen('.open-to-know', '.modal__to-know');
modalClose('.modal__close');
modalClose('.modal-form-sub__close');
let modalItem = document.querySelectorAll('.modal__item');
// if (width <= 720) {
modalItem.forEach(modal => {
if (modal.classList.contains('active')) {
let aside = document.querySelector('.modal__aside');
if (width <= 720) {
aside.style.width = `${width}px`
}else{
let openAside = document.querySelector('.modal__item.active'),
newWidth = openAside.clientWidth;
aside.style.width = `${newWidth}px`
}
}
})
// }
});
// resize
//
if (document.querySelector('.header').classList.contains('white')) {
window.addEventListener("scroll", function (e) {
let header = document.querySelector('.header');
let scroll = window.scrollY;
if(!menu_opened){
if (scroll >= 25) {
header.classList.remove('white')
}else{
header.classList.add('white')
}
}
});
}
// scroll

@ -9,6 +9,180 @@ add_filter('timber/context', function($context) {
return $context;
});
define('BOT_USERNAME', 'cosmopet_test_AE_bot');
function getTelegramUserData() {
if (isset($_COOKIE['tg_user'])) {
$auth_data_json = urldecode($_COOKIE['tg_user']);
$auth_data = json_decode($auth_data_json, true);
return $auth_data;
}
return false;
}
/*
if ($_GET['logout']) {
setcookie('tg_user', '');
header('Location: login.php');
}
*/
function tgWidget() {
$tg_user = getTelegramUserData();
if ($tg_user !== false) {
$first_name = htmlspecialchars($tg_user['first_name']);
$last_name = htmlspecialchars($tg_user['last_name']);
if (isset($tg_user['username'])) {
$username = htmlspecialchars($tg_user['username']);
$html = "<h1>Hello, <a href=\"https://t.me/{$username}\">{$first_name} {$last_name}</a>!</h1>";
} else {
$html = "<h1>Hello, {$first_name} {$last_name}!</h1>";
}
if (isset($tg_user['photo_url'])) {
$photo_url = htmlspecialchars($tg_user['photo_url']);
$html .= "<img src=\"{$photo_url}\">";
}
$html .= "<p><a href=\"?logout=1\">Log out</a></p>";
} else {
$bot_username = BOT_USERNAME;
$html = '<script async src="https://telegram.org/js/telegram-widget.js?2" data-telegram-login="'.$bot_username.'" data-size="large" data-onauth="onTelegramAuth(user)"></script>';
}
if(!is_user_logged_in()) {
echo $html;
}
}
add_action( 'wp_ajax_ontelegramauth', 'onTelegramAuth' );
add_action( 'wp_ajax_nopriv_ontelegramauth', 'onTelegramAuth' );
function onTelegramAuth(){
$tg_id = $_POST['userid'];
$tg_username = $_POST['username'];
$user = get_users(
array(
'meta_key' => 'tg_account',
'meta_value' => $tg_id
)
);
// $user = get_users(
// array(
// 'meta_key' => 'tg_username',
// 'meta_value' => $tg_username
// )
// );
// Генерация пароля
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#!()';
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < 12; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
$pass = implode($pass);
if($user) {
$user_login = $user[0]->data->user_login;
$user_id = get_user_by( 'login', $user_login )->ID;
wp_set_password( $pass, get_user_by( 'login', $user_login )->ID );
wp_signon(
array(
'user_login' => $user_login,
'user_password' => $pass,
'remember' => 'on',
)
);
} else {
$user_id = wp_create_user( $tg_username, $pass, '');
add_user_meta( $user_id, 'tg_account', $tg_id);
add_user_meta( $user_id, 'tg_username', $tg_username);
wp_update_user( [
'ID' => $user_id,
'first_name' => $_POST['fname'],
'last_name' => $_POST['lname']
] );
wp_set_auth_cookie( $user_id, true );
}
}
add_action( 'wp_ajax_linktelegram', 'linkTelegram' );
add_action( 'wp_ajax_nopriv_linktelegram', 'linkTelegram' );
function linkTelegram(){
$tg_id = $_POST['userid'];
$user_id = get_current_user_id();
add_user_meta( $user_id, 'tg_account', $tg_id);
wp_update_user( [
'ID' => $user_id,
'first_name' => $_POST['fname'],
'last_name' => $_POST['lname']
] );
}
add_action( 'wp_ajax_email_link', 'emailLink' );
add_action( 'wp_ajax_nopriv_email_link', 'emailLink' );
function emailLink(){
$email = $_POST['email'];
$user_id = get_current_user_id();
if(email_exists($email)){
header("Content-Type: application/json");
echo json_encode(array(
'error' => esc_html__( 'Email is already registered', 'woodmart' )
));
exit();
} else {
wp_update_user( [
'ID' => $user_id,
'user_email' => $email
] );
}
}
// Добавляем колонку Telegram в список пользователей
add_filter('manage_users_columns', 'add_tg_account_column');
function add_tg_account_column($columns) {
$columns['tg_username'] = 'Telegram';
return $columns;
}
// Заполняем колонку данными
add_filter('manage_users_custom_column', 'add_tg_account_column_content', 10, 3);
function add_tg_account_column_content($value, $column_name, $user_id) {
if ('tg_username' == $column_name) {
$tg_account = get_user_meta($user_id, 'tg_username', true);
if ($tg_account) {
return '<a href="https://t.me/"' . esc_attr($tg_account) . '" target="_blank">@' . esc_html($tg_account) . '</a>';
}
return '<span style="color:#ccc;">не указан</span>';
}
return $value;
}
// Делаем колонку сортируемой
add_filter('manage_users_sortable_columns', 'make_tg_account_column_sortable');
function make_tg_account_column_sortable($columns) {
$columns['tg_username'] = 'tg_username';
return $columns;
}
// Обрабатываем сортировку
add_action('pre_get_users', 'handle_tg_account_sorting');
function handle_tg_account_sorting($query) {
if (!is_admin() || !$query->is_main_query()) {
return;
}
if ('tg_username' === $query->get('orderby')) {
$query->set('meta_key', 'tg_username');
$query->set('orderby', 'meta_value');
}
}
?>

@ -1,6 +1,57 @@
jQuery(document).ready(function($) {
// Функция для показа модальных окон
function showModal(modalClass) {
const modal = document.querySelector('.' + modalClass);
if (modal) {
modal.style.display = 'flex';
}
}
// Функция для закрытия модальных окон
function closeModals() {
const modals = document.querySelectorAll('.mform');
modals.forEach(modal => {
modal.style.display = 'none';
});
}
// Инициализация после загрузки DOM
document.addEventListener('DOMContentLoaded', function() {
// Обработчики для кнопок закрытия
const closeButtons = document.querySelectorAll('.close-button');
closeButtons.forEach(button => {
button.addEventListener('click', function() {
closeModals();
});
});
// Закрытие при клике вне контента
window.addEventListener('click', function(event) {
const modals = document.querySelectorAll('.mform');
modals.forEach(modal => {
if (event.target === modal) {
modal.style.display = 'none';
}
});
});
});
// Закрытие при клике вне контента
window.addEventListener('click', function(event) {
const modals = document.querySelectorAll('.modal-success, .modal-offer');
modals.forEach(modal => {
if (event.target === modal) {
modal.style.display = 'none';
}
});
});
jQuery(document).ready(function($) {
$('.form-process').submit(function(event) {
event.preventDefault();
let validate = validateForm(this);
@ -15,7 +66,9 @@ jQuery(document).ready(function($) {
formData: formData
},
success: function(response) {
alert(response.message);
closeModals()
showModal('mform-success')
}
});
}
@ -26,65 +79,65 @@ const metaLocale = document.querySelector('meta[property="og:locale"]');
const localeValue = metaLocale.getAttribute('content');
// Функция валидации формы
function validateForm(form) {
// Очищаем предыдущие сообщения об ошибках внутри этой формы
clearErrorMessages(form);
let validated = true
// Валидация поля имени
const nameInput = form.querySelector('input[name="name"]');
if (nameInput && !nameInput.value.trim()) {
if(localeValue == 'en_US'){
showError(nameInput, 'The name is requeried field');
}
if(localeValue == 'ru_RU'){
showError(nameInput, 'Поле имени обязательно для заполнения.');
}
validated = false
}
// Функция валидации формы
function validateForm(form) {
// Очищаем предыдущие сообщения об ошибках внутри этой формы
clearErrorMessages(form);
let validated = true
// Валидация поля имени
const nameInput = form.querySelector('input[name="name"]');
if (nameInput && !nameInput.value.trim()) {
if(localeValue == 'en_US'){
showError(nameInput, 'The name is requeried field');
}
if(localeValue == 'ru_RU'){
showError(nameInput, 'Поле имени обязательно для заполнения.');
}
validated = false
}
// Валидация поля email
const emailInput = form.querySelector('input[name="email"]');
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (emailInput && !emailPattern.test(emailInput.value.trim())) {
// Валидация поля email
const emailInput = form.querySelector('input[name="email"]');
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (emailInput && !emailPattern.test(emailInput.value.trim())) {
if(localeValue == 'en_US'){
showError(emailInput, 'Email is incorrect.');
}
if(localeValue == 'ru_RU'){
showError(emailInput, 'Введите корректный email.');
}
validated = false
}
// Валидация поля телефона
const phoneInput = form.querySelector('input[name="phone"]');
const phonePattern = /^\+?\d{10,15}$/;
if (phoneInput && !phonePattern.test(phoneInput.value.trim())) {
if(localeValue == 'en_US'){
showError(phoneInput, 'The phone is incorrect.');
}
if(localeValue == 'ru_RU'){
showError(phoneInput, 'Введите корректный номер телефона.');
}
validated = false
}
return validated
}
if(localeValue == 'en_US'){
showError(emailInput, 'Email is incorrect.');
}
if(localeValue == 'ru_RU'){
showError(emailInput, 'Введите корректный email.');
}
validated = false
}
// Функция для отображения сообщения об ошибке
function showError(input, message) {
const errorMessage = document.createElement('div');
errorMessage.className = 'error-message';
errorMessage.textContent = message;
input.insertAdjacentElement('afterend', errorMessage);
}
// Валидация поля телефона
const phoneInput = form.querySelector('input[name="phone"]');
const phonePattern = /^\+?\d{10,15}$/;
if (phoneInput && !phonePattern.test(phoneInput.value.trim())) {
if(localeValue == 'en_US'){
showError(phoneInput, 'The phone is incorrect.');
}
if(localeValue == 'ru_RU'){
showError(phoneInput, 'Введите корректный номер телефона.');
}
validated = false
}
return validated
}
// Функция для очистки сообщений об ошибках внутри конкретной формы
function clearErrorMessages(form) {
const errorMessages = form.querySelectorAll('.error-message');
errorMessages.forEach(errorMessage => {
errorMessage.remove();
});
}
// Функция для отображения сообщения об ошибке
function showError(input, message) {
const errorMessage = document.createElement('div');
errorMessage.className = 'error-message';
errorMessage.textContent = message;
input.insertAdjacentElement('afterend', errorMessage);
}
// Функция для очистки сообщений об ошибках внутри конкретной формы
function clearErrorMessages(form) {
const errorMessages = form.querySelectorAll('.error-message');
errorMessages.forEach(errorMessage => {
errorMessage.remove();
});
}

File diff suppressed because one or more lines are too long

@ -13,12 +13,12 @@ add_action('wp_ajax_nopriv_contact_form', function() {
});
add_action('wp_ajax_subscribe_form', function() {
$enabledHandlers = ['b24', 'email', 'mindbox'];
$enabledHandlers = ['b24', 'email'];
process_form($enabledHandlers);
});
add_action('wp_ajax_nopriv_subscribe_form', function() {
$enabledHandlers = ['b24', 'email', 'mindbox'];
$enabledHandlers = ['b24', 'email'];
process_form($enabledHandlers);
});

@ -34,48 +34,48 @@ class zohoHandler extends FormHandler {
}
}
class mindboxHandler extends FormHandler {
public function handle($data) {
// Отправка в стандартный обработчик (например, email)
error_log("Отправка в mindBox: " . json_encode($data));
// if (is_string($data)) {
// parse_str($data, $parsedData); // Преобразуем строку в массив
// $data = $parsedData;
// }
// class mindboxHandler extends FormHandler {
// public function handle($data) {
// // Отправка в стандартный обработчик (например, email)
// error_log("Отправка в mindBox: " . json_encode($data));
// // if (is_string($data)) {
// // parse_str($data, $parsedData); // Преобразуем строку в массив
// // $data = $parsedData;
// // }
// $url = 'https://api.mindbox.ru/v3/operations/async?endpointId=cosmopet.Website&operation=DobavleniePolzovatelyaSSajta';
// // $url = 'https://api.mindbox.ru/v3/operations/async?endpointId=cosmopet.Website&operation=DobavleniePolzovatelyaSSajta';
// $data = array(
// "email" => $data['email'],
// "subscriptions" => array(
// array(
// "pointOfContact"=> "Email"
// ),
// ),
// );
// // $data = array(
// // "email" => $data['email'],
// // "subscriptions" => array(
// // array(
// // "pointOfContact"=> "Email"
// // ),
// // ),
// // );
// $data_string = json_encode(array("customer" =>$data));
// // $data_string = json_encode(array("customer" =>$data));
// $ch = curl_init($url);
// // $ch = curl_init($url);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
// // curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
// curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
// // curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $result = curl_exec($ch);
// // $result = curl_exec($ch);
// curl_close($ch);
return parent::handle($data);
}
}
// // curl_close($ch);
// return parent::handle($data);
// }
// }
class emailHandler extends FormHandler {
public function handle($data) {
$to = 'fcs.andrew@gmail.com'; // Укажите email, на который нужно отправить данные
$to = 'pro@cosmopet.shop'; // Укажите email, на который нужно отправить данные
$subject = 'Форма обработана'; // Тема письма
$message = $this->formatData($data); // Форматируем данные
@ -113,9 +113,9 @@ class FormHandlerFactory {
if (in_array('zoho', $enabledHandlers)) {
$handler = new zohoHandler($handler);
}
if (in_array('mindbox', $enabledHandlers)) {
$handler = new mindboxHandler($handler);
}
// if (in_array('mindbox', $enabledHandlers)) {
// $handler = new mindboxHandler($handler);
// }
if (in_array('b24', $enabledHandlers)) {
$handler = new b24Handler($handler);
}

@ -730,3 +730,33 @@ width: 0px;
}
.mini-profile__button--counter {
display: flex
;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 2px;
position: absolute;
background: var(--gradient-turquoise);
border-radius: 10px;
width: 16px;
height: 16px;
border-radius: 50%;
right: 3px;
bottom: 2px;
font-style: normal;
font-weight: 700;
font-size: 9px;
line-height: 16px;
color: #121212;
}
.mini-profile__button--counter.disabled{
display: none;
}
.mini-profile__button{
position: relative;
}

@ -1,151 +0,0 @@
'use strict';
// function
function modalOpen(buttonElement, contentElement){
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
elements = document.querySelectorAll(buttonElement),
device = window.screen.width;
elements.forEach(e => {
let thisContentElement = document.querySelector(contentElement);
e.onclick = function () {
modal.classList.add('active');
thisContentElement.classList.add('active');
let width = thisContentElement.clientWidth;
setTimeout(() => {
if (device <= 720) {
aside.style.width = `${device}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}else{
aside.style.width = `${width}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}
}, 10);
}
})
}
function modalClose(buttonElement) {
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
asideItems = document.querySelectorAll('.modal__item'),
elements = document.querySelectorAll(buttonElement);
elements.forEach(e => {
e.onclick = function () {
aside.style.width = '0px';
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.style.filter = 'blur(10px)';
}
});
setTimeout(() => {
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
}
});
modal.classList.remove('active');
}, 300);
}
})
}
function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) {
let elements = document.querySelectorAll(mainElement);
elements.forEach(e => {
let thisMainElement = e,
thisButtonElement = e.querySelector(buttonElement),
thisHeightElement = e.querySelector(heightElement),
thisContentElement = e.querySelector(contentElement);
thisButtonElement.onclick = function (e) {
let height = thisHeightElement.clientHeight;
if (close == true && !thisMainElement.classList.contains('active')) {
elements.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
e.querySelector(contentElement).style.height = null
}
})
}
if (!thisMainElement.classList.contains('active')) {
thisContentElement.style.height = `${height}px`;
thisMainElement.classList.add('active');
}else{
thisContentElement.style.height = null;
thisMainElement.classList.remove('active');
}
}
});
}
var menu_opened = false;
function toggleHeader(button, content, blockheight, removeBlock, removeClass) {
let thisButton = document.querySelector(button),
thisContent = document.querySelector(content),
thisRemoveBlock = document.querySelector(removeBlock) || '',
thisBlockheight = document.querySelector(blockheight);
thisButton.onclick = function () {
let height = thisBlockheight.clientHeight;
if (!thisContent.classList.contains('open')) {
thisContent.style.height = `${height}px`;
thisContent.classList .add('open');
if (removeBlock) {
thisRemoveBlock.classList.remove(removeClass);
}
}else{
thisContent.style.height = null;
thisContent.classList.remove('open');
if (removeBlock) {
if (window.Y <= 25) {
thisRemoveBlock.classList.add(removeClass);
}
}
}
menu_opened = !menu_opened;
}
}
if (document.querySelector('.header').classList.contains('white')) {
window.addEventListener("scroll", function (e) {
let header = document.querySelector('.header');
let scroll = window.scrollY;
if(!menu_opened){
if (scroll >= 25) {
header.classList.remove('white')
}else{
header.classList.add('white')
}
}
});
}
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false);
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white');
toggleHeader('#phone-menu','.header__menu-block','.header__phone-menu', '.white', 'white');
// scroll

@ -41,7 +41,11 @@ add_filter('timber/context', function($context) {
if ($about_page) {
$context['about_url'] = '/o-kompanii/';
$context['about_url_en'] = '/en/about-us/';
} else {
}
else if (SITE_DOMAIN == 'AE'){
$context['about_url_en'] = '/about-us/';
}
else {
$context['about_url'] = 'https://cosmopet.shop/chto-takoe-entoprotein/';
$context['about_url_en'] = 'https://cosmopet.shop/en/about-2/';
}
@ -50,7 +54,11 @@ add_filter('timber/context', function($context) {
if ($production_page) {
$context['production_url'] = '/proizvodstvo/';
$context['production_url_en'] = '/en/production/';
} else {
}
else if (SITE_DOMAIN == 'AE'){
$context['production_url_en'] = '/production/';
}
else {
$context['production_url'] = 'https://cosmopet.shop/proizvodstvo/';
$context['production_url_en'] = 'https://cosmopet.shop/en/production/';
}
@ -62,7 +70,9 @@ add_filter('timber/context', function($context) {
$context['front_url'] = "https://cosmopet.shop/";
$context['front_url_en'] = "https://cosmopet.shop/en/main/";
}
if (SITE_DOMAIN == 'AE'){
$context['front_url_en'] = "/";
}
return $context;
});

@ -16,10 +16,6 @@ img {
max-width: 100%;
}
span,
label {
display: inline-block;
}
html {
scroll-behavior: smooth;
@ -44,12 +40,6 @@ address {
font-style: normal;
}
.wrapper {
width: 100%;
overflow: hidden;
min-height: 100svh;
}
ul,
ol,
dl {
@ -75,4 +65,12 @@ input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
margin: 0;
}
main.wrapper{
padding-top: 40px;
}
.checkout-inline-error-message{
display: none;
}

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

Loading…
Cancel
Save