temp commit for merge

pull/29/head
parent a6b8b68eff
commit 2d3a7878c3
  1. 91
      robots.txt
  2. 1748
      wp-content/themes/cosmopet/composer-setup.php
  3. 382
      wp-content/themes/cosmopet/functions.php
  4. 261
      wp-content/themes/cosmopet/global-functions/core-functions.php
  5. 1613
      wp-content/themes/cosmopet/global-functions/multilang-functions.php
  6. 164
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  7. 1
      wp-content/themes/cosmopet/home.php
  8. 2
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
  9. 332
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-desktop.css
  10. 83
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-tablet.css
  11. 48
      wp-content/themes/cosmopet/modules/footer/assets/css/gp-style-desktop.css
  12. 174
      wp-content/themes/cosmopet/modules/footer/module-controller.php
  13. 8
      wp-content/themes/cosmopet/modules/forms/assets/js/form.js
  14. 4
      wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php
  15. 60
      wp-content/themes/cosmopet/modules/forms/module-controller.php
  16. 8
      wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css
  17. 236
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
  18. 67
      wp-content/themes/cosmopet/modules/layout/assets/js/gp-cabinet.js
  19. 460
      wp-content/themes/cosmopet/modules/layout/assets/js/gp-form.js
  20. 12
      wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js
  21. 946
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
  22. 42
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/js/gp-product.js
  23. 11
      wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig
  24. 20
      wp-content/themes/cosmopet/page.php
  25. 4
      wp-content/themes/cosmopet/static/front-page/css/style.css
  26. 53
      wp-content/themes/cosmopet/static/front-page/js/main.js
  27. 839
      wp-content/themes/cosmopet/templates/blog/blog-page.twig
  28. 17
      wp-content/themes/cosmopet/templates/blog/most-read.twig
  29. 155
      wp-content/themes/cosmopet/templates/footer.twig
  30. 9
      wp-content/themes/cosmopet/templates/front-page/front-page.twig
  31. 51
      wp-content/themes/cosmopet/templates/header.twig
  32. 44
      wp-content/themes/cosmopet/templates/layout.twig
  33. 2
      wp-content/themes/cosmopet/templates/modal.twig
  34. 1
      wp-content/themes/cosmopet/templates/page.twig
  35. 81
      wp-content/themes/cosmopet/templates/pet-card.twig
  36. 14
      wp-content/themes/cosmopet/templates/shop/bestsellers.twig
  37. 2
      wp-content/themes/cosmopet/templates/shop/cart-contents.twig
  38. 14
      wp-content/themes/cosmopet/templates/shop/review-order.twig
  39. 12
      wp-content/themes/cosmopet/woocommerce/archive-product/archive-product.twig

@ -0,0 +1,91 @@
User-agent: *
Disallow: /cgi-bin
Disallow: /?
Disallow: /wp-
Disallow: /wp/
Disallow: *?s=
Disallow: *&s=
Disallow: /search/
Disallow: /author/
Disallow: /users/
Disallow: */trackback
Disallow: */feed
Disallow: */rss
Disallow: */embed
Disallow: */wlwmanifest.xml
Disallow: /xmlrpc.php
Allow: */uploads
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
User-agent: GoogleBot
Disallow: /cgi-bin
Disallow: /?
Disallow: /wp-
Disallow: /wp/
Disallow: *?s=
Disallow: *&s=
Disallow: /search/
Disallow: /author/
Disallow: /users/
Disallow: */trackback
Disallow: */feed
Disallow: */rss
Disallow: */embed
Disallow: */wlwmanifest.xml
Disallow: /xmlrpc.php
Disallow: *utm*=
Disallow: *etext*=
Disallow: *?add-to-cart*
Disallow: *?per_page*
Disallow: *?per_row*
Disallow: *openstat=
Allow: */uploads
Allow: /*/*.js
Allow: /*/*.css
Allow: /wp-*.png
Allow: /wp-*.jpg
Allow: /wp-*.jpeg
Allow: /wp-*.gif
Allow: /wp-admin/admin-ajax.php
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
User-agent: Yandex
Disallow: /cgi-bin
Disallow: /?
Disallow: /wp-
Disallow: /wp/
Disallow: *?s=
Disallow: *&s=
Disallow: /search/
Disallow: /author/
Disallow: /users/
Disallow: */trackback
Disallow: */feed
Disallow: */rss
Disallow: */embed
Disallow: */wlwmanifest.xml
Disallow: /xmlrpc.php
Allow: */uploads
Allow: /*/*.js
Allow: /*/*.css
Allow: /wp-*.png
Allow: /wp-*.jpg
Allow: /wp-*.jpeg
Allow: /wp-*.gif
Allow: /wp-admin/admin-ajax.php
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
Clean-Param: utm_source&utm_medium&utm_campaign&etext&add-to-cart&per_page&per_row&from&attribute_pa_weight&attribute_pa_ves-upakovki
Clean-Param: openstat

File diff suppressed because it is too large Load Diff

@ -424,6 +424,7 @@ 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');
@ -438,16 +439,7 @@ require_once('modules/author/module-ajax-controller.php');
include_module('forms');
include_module('layout');
add_action('wp_enqueue_scripts', 'disable_woocommerce_css', 999);
function disable_woocommerce_css() {
wp_dequeue_style('woocommerce-general');
wp_dequeue_style('woocommerce-layout');
wp_dequeue_style('woocommerce-smallscreen');
wp_dequeue_style('woocommerce_frontend_styles');
wp_dequeue_style('woocommerce_fancybox_styles');
wp_dequeue_style('woocommerce_chosen_styles');
wp_dequeue_style('woocommerce_prettyPhoto_css');
}
class WooProduct extends Timber\Post {
protected $wc_product;
@ -617,6 +609,173 @@ register_sidebar( array(
) );
// 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() {
@ -980,3 +1139,206 @@ 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()
// ]);
// }

@ -7,7 +7,6 @@ function change_aed_currency_symbol($currency_symbol, $currency) {
$currency_symbol = 'AED';
}
return $currency_symbol;
}
add_filter('timber/context', function($context) {
@ -20,4 +19,167 @@ add_filter('timber/context', function($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');

@ -63,4 +63,6 @@ main{
.reply-form-container textarea{
background-color: #fff !important;
margin-top: 2rem;
width: 100%;
}

@ -123,3 +123,335 @@ p.discount-description__2 {
color: var(--main_black);
}
/* 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;
}
}

@ -151,8 +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;
}

@ -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,9 +1,13 @@
// Функция для показа модальных окон
function showModal(modalClass) {
const modal = document.querySelector('.' + modalClass);
if (modal) {
modal.style.display = 'flex';
}
}
// Функция для закрытия модальных окон
function closeModals() {
@ -25,6 +29,7 @@ function showModal(modalClass) {
// Закрытие при клике вне контента
window.addEventListener('click', function(event) {
const modals = document.querySelectorAll('.mform');
modals.forEach(modal => {
if (event.target === modal) {
@ -42,10 +47,10 @@ function showModal(modalClass) {
modal.style.display = 'none';
}
});
});
});
jQuery(document).ready(function($) {
$('.form-process').submit(function(event) {
event.preventDefault();
@ -63,6 +68,7 @@ jQuery(document).ready(function($) {
success: function(response) {
closeModals()
showModal('mform-success')
}
});
}

@ -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,43 +34,43 @@ 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) {
@ -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);
}

@ -744,8 +744,8 @@ width: 0px;
width: 16px;
height: 16px;
border-radius: 50%;
right: 30px;
bottom: 20px;
right: 3px;
bottom: 2px;
font-style: normal;
font-weight: 700;
font-size: 9px;
@ -756,3 +756,7 @@ width: 0px;
.mini-profile__button--counter.disabled{
display: none;
}
.mini-profile__button{
position: relative;
}

@ -175,11 +175,11 @@ body {
height: 96px;
width: 100%;
resize: none;
background: var(--main_white);
border: 1px solid var(--placeholder);
background: var(--main_white) !important;
border: 1px solid var(--placeholder) !important;;
padding: 12px 16px;
border-radius: 20px;
color: var(--main_black);
color: var(--main_black) !important;
font-size: 20px;
font-weight: 400;
line-height: 24px;
@ -271,6 +271,7 @@ textarea{
}
}
.mform {
position: fixed;
top: 0;
@ -284,7 +285,9 @@ textarea{
z-index: 1000;
}
.mform-content {
position: relative;
width: 100%;
max-width: 600px;
@ -331,7 +334,9 @@ textarea{
color: #000;
}
.mform-title {
font-size: 32px;
font-weight: bold;
margin-bottom: 10px;
@ -340,16 +345,18 @@ textarea{
/* Стили для второго модального окна - Предложить статью */
.mform-offer .mform-content {
background-color: #d6ff9f;
padding-bottom: 30px;
}
.mform-subtitle {
font-size: 18px;
margin-bottom: 20px;
}
.mform-form {
.modal-form {
width: 100%;
}
@ -371,6 +378,16 @@ textarea{
width: 100%;
max-width: 380px;
}
.modal-offer input, textarea {
width: 100%!important;
padding: 12px 15px!important;
border: none!important;
border-radius: 20px!important;
font-size: 16px!important;
background-color: white!important;
}
/* Контейнер для текстового поля и изображения автора */
.message-container {
position: relative;
@ -419,7 +436,9 @@ textarea{
/* Адаптивность */
@media (max-width: 768px) {
.mform-content {
width: 90%;
padding: 30px 20px;
}
@ -452,13 +471,156 @@ textarea{
}
}
.wrapper {
margin: 0 auto;
max-width: 1600px;
}
.modal {
display: none;
}
.modal.active {
display: flex!important;
}
.modal__login.active {
filter: blur(0px);
}
/* button */
.button{
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
border-radius: 20px;
text-transform: none;
cursor: pointer;
}
.button--100-perc{
width: 100%;
}
.button--white{
padding: 11px 24px;
text-align: center;
background-color: var(--background-white);
border: 1px solid var(--background-black);
transition: opacity .2s ease-out;
}
.button--white:hover{
opacity: .8;
}
.button--white.active{
background: var(--background-black);
color: var(--background-white);
}
.button--gradient{
background: var(--gradient-turquoise);
border: none;
transition: opacity .2s ease-out;
}
.button--gradient:hover{
opacity: .8;
}
.button--base{
padding: 12px 24px;
}
.button--high{
height: 56px;
padding: 16px 24px 16px 24px;
font-weight: 700;
text-align: center;
position: relative;
}
.button--icon{
padding-right: 56px;
text-align: start;
}
.button--filter::after{
content: '';
position: absolute;
top: 16px;
right: 24px;
width: 24px;
aspect-ratio: 1;
background-image: url(../img/svg/main/filter.svg);
background-repeat: no-repeat;
background-size: contain;
}
.button--black{
padding: 7px 15px;
font-family: var(--font-family);
font-weight: 500;
font-size: 24px;
line-height: 133%;
color: var(--text-white);
background: var(--background-black);
border: 1px solid var(--text-white);
}
.button--link{
text-decoration: none;
}
.button--red-48-px{
border-radius: 48px;
}
.to-know{
width: 100%;
padding: 12px;
display: flex;
justify-content: center;
border: none;
transition: opacity .2s ease-out;
}
.to-know:hover{
opacity: .8;
}
.to-know p{
padding-bottom: 4px;
font-family: var(--font-family);
font-weight: 700;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
border-bottom: 1px var(--text-black) solid;
cursor: pointer;
}
.to-know--background-none{
background: none;
}
.back{
margin-top: 16px;
margin-left: 16px;
padding: 8px;
padding-left: 32px;
background: none;
border: none;
}
/* modal */
@ -1324,15 +1486,54 @@ textarea{
flex: 1;
padding: 16px 24px;
border-radius: 20px;
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
text-align: center;
cursor: pointer;
transition: all 0.2s ease-out;
color: var(--text-black);
text-decoration: none;
position: relative;
}
.back::before{
content: '';
position: absolute;
top: 8px;
left: 0;
margin-right: 8px;
width: 24px;
height: 24px;
background-image: url(../img/svg/main/arrow-back.svg);
}
.back::after{
content: '';
position: absolute;
bottom: 6px;
left: 0;
width: calc(100% - 8px);
height: 1px;
background: var(--text-black);
}
.button--high-46{
padding: 12px 24px;
font-size: 20px;
font-weight: 700;
line-height: 24px;
}
.modal-basket__button--continue {
background: var(--background-white);
border: 1px solid var(--background-black);
@ -1677,16 +1878,16 @@ textarea{
border-radius: 20px;
padding: 12px 16px;
border: 1px solid var(--text-black);
border: 1px solid var(--text-black) !important;
background: var(--background-white);
background: var(--background-white) !important;
font-family: var(--font-family);
font-family: var(--font-family) !important;
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
color: var(--text-black) !important;
}
.form__input::placeholder{
color: var(--text-grey);
@ -1861,3 +2062,14 @@ textarea{
.wc-block-checkout__form.wc-block-components-form .wc-blocks-components-select .wc-blocks-components-select__select{
border-radius: 10px;
}
.mt-m-3{
margin-top: -3rem;
}
@media (max-width: 768px) {
.mt-m-3{
margin-top: 1rem;
}
}

@ -1,67 +0,0 @@
// 'use strict';
// import * as fun from './_gp-function.js';
// let widthPhoneCabinet = 1200;
// fun.toggleOpenX('.cabinet-card__order', '.cabinet-card-order__open-detail', '.cabinet-card-order__detail', '.cabinet-card-order__block-detail');
// fun.modalFormOpen('.form-open');
// fun.closeModalForm('.modal-form__close');
// fun.closeModalForm('.modal-form__button-close');
// controlCabinet('.cabinet-control__button', '.cabinet', widthPhoneCabinet);
// function controlCabinet(buttons, main, minWidth){
// let thisWidth = window.innerWidth;
// let thisMain = document.querySelector(main);
// let thisButtons = document.querySelectorAll(buttons);
// thisButtons.forEach(e => {
// e.onclick = function (element){
// let thisContent = document.querySelector(`.cabinet__${e.dataset.cabinet}`);
// let newHeight = thisContent.clientHeight + 48;
// let thisButton = element.target;
// thisMain.style.height = `${newHeight}px`
// if (!thisContent.classList.contains('active')) {
// thisMain.querySelector('.active').classList.remove('active');
// thisContent.classList.add('active');
// setTimeout(() => {
// thisMain.style.height = 'auto';
// if (thisMain.querySelector('.hide')) {
// thisMain.querySelector('.hide').classList.remove('hide');
// }
// thisMain.querySelector('.active').classList.add('hide');
// }, 200);
// }
// thisButtons.forEach(e => {
// e.classList.remove('active');
// })
// thisButton.classList.add('active');
// }
// })
// }
// let modal = document.querySelector('.modal');
// modal.onclick = function (eventModal) {
// let thisTarget = eventModal.target;
// if (thisTarget.classList.contains('modal')) {
// thisTarget.classList.remove('active');
// if (!thisTarget.querySelector('.modal-map.active')) {
// thisTarget.querySelector('.modal-form.active').classList.remove('active');
// }else{
// thisTarget.querySelector('.modal-map.active').classList.remove('active');
// }
// }
// }

@ -1,54 +1,54 @@
'use strict';
inputPhone('.form-input__phone', '.form-input-phone__icon', '.form-input-phone__code', '.form-input-phone__input', '.form-input-phone__list', 'form-input-phone-list__item', '.form-input-phone-list-item__icon', '.form-input-phone-list-item__code', 'form-input-phone-list__search');
function inputPhone(main, mainFlag, mainCode, input, list, selects, selectIcon, selectCode, searchInput) {
let inputs = document.querySelectorAll(main);
inputs.forEach(e => {
let thisMainFlag = e.querySelector(mainFlag),
thisMainCode = e.querySelector(mainCode),
thisInput = e.querySelector(input),
thisList = e.querySelector(list),
thisSelects = e.querySelectorAll(`.${selects}`),
thisSearchInput = e.querySelector(`.${searchInput}`);
thisInput.onblur = function (input) {
if (!(input.relatedTarget != null && (input.relatedTarget.classList.contains(searchInput) || input.relatedTarget.classList.contains(selects)))) {
thisList.classList.remove('active');
}
}
e.onclick = function (event) {
if (!event.target.classList.contains(searchInput)) {
if (thisList.classList.contains('active')) {
thisList.classList.remove('active');
}
thisInput.focus();
thisList.classList.add('active');
}
}
thisSelects.forEach(e => {
let newIcon = e.querySelector(selectIcon),
newCode = e.querySelector(selectCode);
e.onclick = function (event) {
event.preventDefault();
thisMainFlag.style.cssText = `background-image:url("${newIcon.src}");`;
thisMainCode.textContent = newCode.textContent;
setTimeout(() => {
thisList.classList.remove('active');
}, 0);
}
})
})
}
// inputPhone('.form-input__phone', '.form-input-phone__icon', '.form-input-phone__code', '.form-input-phone__input', '.form-input-phone__list', 'form-input-phone-list__item', '.form-input-phone-list-item__icon', '.form-input-phone-list-item__code', 'form-input-phone-list__search');
// function inputPhone(main, mainFlag, mainCode, input, list, selects, selectIcon, selectCode, searchInput) {
// let inputs = document.querySelectorAll(main);
// inputs.forEach(e => {
// let thisMainFlag = e.querySelector(mainFlag),
// thisMainCode = e.querySelector(mainCode),
// thisInput = e.querySelector(input),
// thisList = e.querySelector(list),
// thisSelects = e.querySelectorAll(`.${selects}`),
// thisSearchInput = e.querySelector(`.${searchInput}`);
// thisInput.onblur = function (input) {
// if (!(input.relatedTarget != null && (input.relatedTarget.classList.contains(searchInput) || input.relatedTarget.classList.contains(selects)))) {
// thisList.classList.remove('active');
// }
// }
// e.onclick = function (event) {
// if (!event.target.classList.contains(searchInput)) {
// if (thisList.classList.contains('active')) {
// thisList.classList.remove('active');
// }
// thisInput.focus();
// thisList.classList.add('active');
// }
// }
// thisSelects.forEach(e => {
// let newIcon = e.querySelector(selectIcon),
// newCode = e.querySelector(selectCode);
// e.onclick = function (event) {
// event.preventDefault();
// thisMainFlag.style.cssText = `background-image:url("${newIcon.src}");`;
// thisMainCode.textContent = newCode.textContent;
// setTimeout(() => {
// thisList.classList.remove('active');
// }, 0);
// }
// })
// })
// }
if (document.querySelector('.form-input-phone__input')) {
checkPhone('.form-input-phone__input');
@ -84,15 +84,9 @@ function inputTabs(main, button) {
buttons.forEach(button => {
button.onclick = function () {
if (button.classList.contains('active')) {
return ;
}
main.querySelector('.active').classList.remove('active');
button.classList.add('active');
button.querySelector('input').click();
}
})
@ -100,185 +94,283 @@ function inputTabs(main, button) {
}
inputRadio('.form-input__radio', '.form-input-radio__item', '.form-input-radio__title', '.form-input-radio__input')
// inputRadio('.form-input__radio', '.form-input-radio__item', '.form-input-radio__title', '.form-input-radio__input')
function inputRadio(main ,item, textClass, input) {
let inputRadios = document.querySelectorAll(main);
// function inputRadio(main ,item, textClass, input) {
// let inputRadios = document.querySelectorAll(main);
inputRadios.forEach(inputRadio => {
let items = inputRadio.querySelectorAll(item),
thisInput = inputRadio.querySelector(input);
// inputRadios.forEach(inputRadio => {
// let items = inputRadio.querySelectorAll(item),
// thisInput = inputRadio.querySelector(input);
items.forEach(radio => {
let thisText = radio.querySelector(textClass).textContent;
// items.forEach(radio => {
// let thisText = radio.querySelector(textClass).textContent;
radio.onclick = function (event) {
event.preventDefault();
// radio.onclick = function (event) {
// event.preventDefault();
if (inputRadio.querySelector(`${item}.active`)) {
inputRadio.querySelector(`${item}.active`).classList.remove('active');
}
thisInput.value = thisText;
radio.classList.add('active');
}
})
})
}
// if (inputRadio.querySelector(`${item}.active`)) {
// inputRadio.querySelector(`${item}.active`).classList.remove('active');
// }
// thisInput.value = thisText;
// radio.classList.add('active');
// }
// })
// })
// }
listInputRadio('.form-input__list' ,'.form-input-list__item', '.form-input-list-item__text', '.form-input-list__input', '.form-input-list__content', '.form-input-list__block-content');
// listInputRadio('.form-input__list' ,'.form-input-list__item', '.form-input-list-item__text', '.form-input-list__content', '.form-input-list__block-content');
function listInputRadio(main ,item, textClass, input, content, block) {
let listInputRadios = document.querySelectorAll(main);
// function listInputRadio(main ,item, textClass, input, content, block) {
// let listInputRadios = document.querySelectorAll(main);
listInputRadios.forEach(listInputRadio => {
let thisInput = listInputRadio.querySelector(input),
items = listInputRadio.querySelectorAll(item),
thisContent = listInputRadio.querySelector(content),
thisBlock = listInputRadio.querySelector(block);
// listInputRadios.forEach(listInputRadio => {
// let thisInput = listInputRadio.querySelector(input),
// items = listInputRadio.querySelectorAll(item),
// thisContent = listInputRadio.querySelector(content),
// thisBlock = listInputRadio.querySelector(block);
thisInput.onclick = function () {
thisBlock.classList.add('active');
thisBlock.style.height = '192px';
}
// // thisInput.onclick = function () {
// // thisBlock.classList.add('active');
// // thisBlock.style.height = '192px';
// // }
thisInput.onblur = function(){
thisBlock.classList.remove('active');
thisBlock.style.height = '0px';
};
// // thisInput.onblur = function(){
// // thisBlock.classList.remove('active');
// // thisBlock.style.height = '0px';
// // };
items.forEach(item => {
item.onclick = function (event) {
event.preventDefault();
let newText = item.querySelector(textClass).textContent;
// items.forEach(item => {
// item.onclick = function (event) {
// event.preventDefault();
// let newText = item.querySelector(textClass).textContent;
thisInput.value = newText;
// thisInput.value = newText;
if (thisContent.querySelector('.active')) {
thisContent.querySelector('.active').classList.remove('active');
}
// if (thisContent.querySelector('.active')) {
// thisContent.querySelector('.active').classList.remove('active');
// }
item.classList.add('active');
}
})
})
}
// item.classList.add('active');
// }
// })
// })
// }
remoteControl('.form-input__remote-control', '.form-input-tabs__button');
remoteControl('.modal-map__control', '.modal-map-control__item');
function remoteControl(main, button) {
let mains = document.querySelectorAll(main);
// remoteControl('.form-input__remote-control', '.form-input-tabs__button');
// remoteControl('.modal-map__control', '.modal-map-control__item');
mains.forEach(main => {
let subjectClass = main.dataset.content,
subject = document.querySelector(`.${subjectClass}`),
buttons = Array.from(main.querySelectorAll(button));
main.addEventListener('click', function (eventMain) {
setTimeout(() => {
let indexActive = buttons.findIndex((button, index) => {
if (button.classList.contains('active')) {
return true;
}
});
if(subject.children[indexActive].classList.contains('active')){
return ;
}
// function remoteControl(main, button) {
// let mains = document.querySelectorAll(main);
subject.querySelector('.remote-control__item.active').classList.remove('active');
subject.children[indexActive].classList.add('active');
// console.log(mains);
let mandatorys = subject.querySelectorAll('.mandatory');
mandatorys.forEach(mandatory => {
if (mandatory.required) {
mandatory.required = false;
}else{
mandatory.required = true;
}
})
}, 0);
})
})
}
// mains.forEach(main => {
// let subjectClass = main.dataset.content,
// subject = document.querySelector(`.${subjectClass}`),
// buttons = Array.from(main.querySelectorAll(button));
formCheck('.modal-form__content', 'input[type=submit]');
formCheck('.modal-map__form', 'input[type=submit]');
function formCheck(form, submit) {
let forms = document.querySelectorAll(form);
forms.forEach(form => {
let thisSubmit = form.querySelector(submit);
// main.addEventListener('mousedown', function (eventMain) {
// setTimeout(() => {
// let indexActive = buttons.findIndex((button, index) => {
// if (button.classList.contains('active')) {
// return true;
// }
// });
thisSubmit.onclick = function () {
form.classList.add('check')
}
// subject.querySelector('.remote-control__item.active').classList.remove('active');
// subject.children[indexActive].classList.add('active');
// }, 0);
// })
// })
// }
})
}
// formCheck('.modal-form__content', 'input[type=submit]');
// formCheck('.modal-map__form', 'input[type=submit]');
// function formCheck(form, submit) {
// let forms = document.querySelectorAll(form);
// forms.forEach(form => {
// let thisSubmit = form.querySelector(submit);
inputPhoneNoFlag('.no-flag');
// thisSubmit.onclick = function () {
// form.classList.add('check')
// }
function inputPhoneNoFlag(input){
let inputs = document.querySelectorAll(input);
// })
// }
inputs.forEach(input => {
let code = '+' + input.dataset.code;
input.onfocus = function () {
if (input.value == '') {
input.value = code;
jQuery('.form-input-list__item').on('click', function(){
var value = jQuery(this).find('p').html()
var content = jQuery(this).closest('.form-input-list__block-content')
jQuery(content).prev().html(value)
jQuery(content).removeClass('active').css('height', '0px')
})
jQuery('.form-input-list__input').on('click', function(){
// jQuery(this).next().toggleClass('active')
if(!jQuery(this).next().hasClass('active')){
jQuery('.form-input-list__block-content').removeClass('active').css('height', '0px')
jQuery(this).next().css('height', '192px').addClass('active')
}
else{
jQuery(this).next().css('height', '0px').removeClass('active')
}
input.addEventListener('input', function(event) {
let text = event.target.value;
let length = text.length;
let newSymbol = event.data;
})
if (isNaN(event.data) || event.data == ' ') {
event.target.value = text.slice(0, -1);
return;
jQuery(document).mouseup(function(e){
var container = jQuery(".modal-form-content-line__element");
if(!container.is(e.target) && container.has(e.target).length === 0){
jQuery('.form-input-list__block-content').removeClass('active').css('height', '0px')
}
});
if (length == 3 || length == 7 || length == 11) {
if (newSymbol != null) {
event.target.value = text.slice(0, -1) + ' ' + newSymbol;
}
jQuery('#add-pet-form').on('submit', function(e) {
e.preventDefault(); // предотвращаем стандартное поведение формы
var data = jQuery(this).serialize()
jQuery(this).find('button[type="submit"]').addClass('loading').attr('disabled', true)
jQuery.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data, // отправляем данные формы
complete: function(response) {
location.reload(true)
}
});
});
jQuery('.edit-pet-form').on('submit', function(e) {
e.preventDefault(); // предотвращаем стандартное поведение формы
var data = jQuery(this).serialize()
jQuery(this).find('button[type="submit"]').addClass('loading').attr('disabled', true)
jQuery.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data, // отправляем данные формы
complete: function(response) {
location.reload(true)
}
});
});
jQuery('.form-input-list__item').on('click', function(){
jQuery(this).closest('.form-input-list__content').find('.form-input-list__item').removeClass('active')
jQuery(this).addClass('active')
})
jQuery('.form-input-radio__item').on('click', function(){
jQuery(this).closest('.form-input__radio').find('.form-input-radio__item').removeClass('active')
jQuery(this).addClass('active')
})
}
inputCheck('.form-agreement__check');
jQuery('.cabinet-card__block-add-pets').on('click', function(){
function inputCheck(className) {
let checks = document.querySelectorAll(className);
jQuery('#pet_add_form').addClass('active')
})
// jQuery('#pet-form-submit').on('click', function(e) {
// jQuery(this).closest('form').submit()
// });
checks.forEach(check => {
let square = check.querySelector('.form-agreement__square'),
input = check.querySelector('input');
square.onclick = function () {
input.click();
jQuery('.popup-wrap, .modal-form__close, .modal-form__button-close').on('click', function(e){
if (e.target == this){
jQuery(this).closest('.modalProfile').removeClass('active')
}
})
}
jQuery('.close-btn').on('click', function(e){
jQuery(this).closest('.modalProfile').removeClass('active')
})
jQuery('input[name="pet"]').on('change', function(
inputRead('.input-read');
function inputRead(className) {
let inputs = document.querySelectorAll(className);
){
var block = jQuery(this).closest('form').find('.sterilized')
if (jQuery(this).val() == 'cat'){
jQuery(block).show()
jQuery(this).closest('form').find('input[name="sterilized"]').attr('required', true)
}
else{
jQuery(block).hide()
jQuery(this).closest('form').find('input[name="sterilized"]').attr('required', false)
}
})
inputs.forEach(input => {
input.addEventListener("input", function (event) {
let text = event.target.value;
event.target.value = text.slice(0, -1);
})
jQuery('[data-edit]').on('click', function(){
jQuery('#pet_edit_'+jQuery(this).data('edit')).addClass('active')
})
}
// const reset = () => {
// input.classList.remove("error");
// errorMsg.innerHTML = "";
// errorMsg.classList.add("hide");
// validMsg.classList.add("hide");
// };
// const showError = (msg) => {
// input.classList.add("error");
// errorMsg.innerHTML = msg;
// errorMsg.classList.remove("hide");
// };
jQuery('.user-edit-form').on('submit', function(e) {
e.preventDefault(); // предотвращаем стандартное поведение формы
jQuery('.form-input__phone').removeClass('error')
var data = jQuery(this).serialize()
jQuery(this).find('button[type="submit"]').addClass('loading').attr('disabled', true)
jQuery.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data, // отправляем данные формы
complete: function(response) {
location.reload(true)
}
});
});
jQuery('.email_approve_form, .foodSub').on('submit', function(e) {
e.preventDefault(); // предотвращаем стандартное поведение формы
var data = jQuery(this).serialize()
jQuery(this).find('button[type="submit"]').addClass('loading').attr('disabled', true)
jQuery.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data, // отправляем данные формы
complete: function(response) {
location.reload(true)
}
});
});
jQuery('.user-edit-open').on('click', function(){
jQuery('#user_edit').addClass('active')
})
jQuery('[data-rm]').on('click', function(){
var rm = jQuery(this).closest('.rm')
jQuery(rm).find('[data-rmcont]').removeClass('active').find('input').attr('required', false)
jQuery(rm).find('[data-rmcont="' + jQuery(this).data('rm') + '"]').addClass('active').find('input').attr('required', true)
})
jQuery('.form-sub__btn').on('click', function(){
jQuery('#subForm').addClass('active')
})

@ -415,3 +415,15 @@ if (document.querySelector('.header').classList.contains('white')) {
// scroll
jQuery(document).ready(function($) {
jQuery('.popup-wrap').on('click', function(e) {
if (e.target === this) {
$(this).closest('.modalProfile').removeClass('active');
}
});
$('.close-btn').on('click', function(e) {
$('.modalProfile').removeClass('active');
});
});

@ -1330,814 +1330,6 @@ button{
}
/* counter */
/* modal */
.modal{
position: fixed;
top: 0;
left: 0;
padding: 20px;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.25);
z-index: 200;
opacity: 0;
transition: opacity .2s ease-out;
pointer-events: none;
display: flex;
justify-content: center;
align-items: center;
overflow-y: auto;
}
.modal.active{
opacity: 1;
pointer-events: auto;
}
.modal__notification{}
.form__button-mobile{
display: none;
}
.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__item--no-title{
padding-top: 72px;
}
.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;
}
.modal__header{}
.modal__title{
padding-right: 48px;
font-family: var(--font-family);
font-weight: 700;
font-size: 36px;
line-height: 111%;
text-transform: uppercase;
color: var(--text-black);
}
.modal__small-title{
font-family: var(--font-family);
font-weight: 700;
font-size: 24px;
line-height: 100%;
text-transform: uppercase;
color: var(--text-black);
}
.modal__text{
margin-top: 16px;
padding-right: 10px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-0);
}
.modal__form-sub{
margin-top: 48px;
}
.modal-form-sub__submit{
margin-top: 64px;
}
.modal__block-button{
margin-top: 24px;
}
.modal__button{
margin-top: 16px;
}
.modal__button:first-child{
margin-top: 0;
}
.modal__content{
margin-top: 24px;
}
.modal__filter{
width: 400px;
}
.modal__footer{
border-top: 1px solid var(--text-6);
padding-top: 23px;
}
.modal__block-price{
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-block-price__title{
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
.modal-block-price__price{
font-family: var(--font-family);
font-weight: 700;
font-size: 24px;
line-height: 100%;
text-transform: uppercase;
text-align: right;
color: var(--text-black);
}
.modal-block-price__price::after{
content: 'Р';
}
.modal__basket{
width: 600px;
}
.modal__to-know,
.modal__to-know-submit{
width: 412px;
}
.modal-basket__item{
padding-top: 23px;
padding-right: 15px;
padding-bottom: 24px;
display: flex;
border-top: 1px solid var(--background-grey);
position: relative;
}
.modal-basket__item::before{
content: '';
position: absolute;
top: 24px;
right: 6px;
width: 24px;
aspect-ratio: 1;
background-image: url(../img/svg/main/basket.svg);
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
transition: opacity .2s ease-out;
}
.modal-basket__item:hover .modal-basket__item::before{
opacity: .8;
}
.modal-basket__item--return{
padding-right: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-basket__item--return .modal-basket-item__title{
padding-right: 10px;
}
.modal-basket__item--return::before{
display: none;
}
.modal-basket-item__return{
border-radius: 20px;
padding: 4px 24px;
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-white);
background: var(--background-black);
border: none;
}
.modal-basket-item__block-image{
width: 128px;
aspect-ratio: 1;
display: flex;
justify-content: center;
align-items: center;
}
.modal-basket-item__image{
width: 96px;
aspect-ratio: 1;
object-fit: contain;
}
.modal-basket-item__content{
margin-left: 16px;
}
.modal-basket-item__title{
padding-right: 40px;
font-family: var(--font-family);
font-weight: 500;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
.modal-basket-item__sub-title{
margin-top: 8px;
font-family: var(--font-family);
font-weight: 700;
font-size: 12px;
line-height: 133%;
color: var(--text-black);
}
.modal-basket-item__control{
margin-top: 24px;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-basket-item__price{
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
text-align: right;
color: var(--text-black);
}
.modal-basket-item__price::after{
content: 'Р';
padding-left: 4px;
}
.modal__basket .modal__header{
height: calc(100% - 92px);
margin-bottom: -36px;
}
.modal__basket .modal__content{
height: calc(100% - 100px);
overflow-x: hidden;
}
.modal__basket .modal__content::-webkit-scrollbar {
width: 7px;
background-color: #f9f9fd;
}
.modal__basket .modal__content::-webkit-scrollbar-thumb {
background-color: var(--background-black);
border-radius: 2px;
}
.modal-form{
margin: auto;
width: 600px;
padding: 24px;
border-radius: 20px;
position: relative;
display: none;
}
.modal-form.active{
display: block;
}
.modal-form--white{
border: 1px solid var(--background-black);
background: var(--background-white);
}
.modal-form--green-gradient{
background: var(--gradient-blue);
}
.modal-form--width-584{
width: 584px;
}
.modal-form--cdek{
width: 836px;
}
.modal-form__close{
position: absolute;
top: 24px;
right: 24px;
width: 24px;
aspect-ratio: 1;
border: none;
background: none;
background-image: url(../img/svg/main/black-x.svg);
background-repeat: no-repeat;
background-size: 24px;
background-position: center;
transition: opacity .2s ease-out;
z-index: 10;
}
.modal-form__close--white{
background-image: url(../img/svg/main/white-x.svg);
}
.modal-form__close:hover{
opacity: .8;
}
.modal-form__button-close{}
.modal-form__title{
padding-right: 50px;
font-family: var(--font-family);
font-weight: 700;
font-size: 26px;
line-height: 123%;
text-transform: uppercase;
color: var(--text-dark);
}
.modal-form__text--center{
text-align: center;
}
.modal-form__text--center-pc{
text-align: center;
}
.modal-form__title--green-gradient{
background: var(--gradient-blue);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.modal-form__title--white{
color: var(--text-white);
}
.modal-form__element{
margin-top: 24px;
}
.modal-form__element--center{
display: flex;
justify-content: center;
}
.modal-form__element--top-40{
margin-top: 40px;
}
.modal-form__text{
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
.modal-form__text--weight-500{
font-weight: 500;
}
.modal-form__text--white{
color: var(--text-white);
}
.modal-form__img{
width: 100%;
height: 360px;
object-fit: contain;
}
.modal-form__content{
margin-top: 40px;
}
.modal-form-content__line{
margin-top: 24px;
}
.modal-form-content__line:first-child{
margin-top: 0;
}
.modal-form-content__line--two{
display: flex;
justify-content: space-between;
}
.modal-form-content__line--two-mobile{
display: flex;
justify-content: space-between;
}
.modal-form-content__line--two-mobile .modal-form-content-line__element{
width: calc(50% - 12px);
}
.modal-form-content-line__element{
position: relative;
}
.modal-form-content-line__element--arrow::after{
content: '';
position: absolute;
right: 16px;
bottom: 16px;
width: 16px;
height: 16px;
background-image: url(../img/svg/main/arrow-right-input.svg);
pointer-events: none;
}
.modal-form-content__line--two .modal-form-content-line__element{
width: calc(50% - 12px);
}
.modal-form-content__line--three{
display: flex;
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(1){
width: 85px;
flex-shrink: 0;
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(2){
margin-left: 8px;
width: 100%;
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(3){
margin-left: 8px;
width: 85px;
flex-shrink: 0;
}
.modal-form-content__line--margin-top-16{
margin-top: 16px;
}
.modal-form__buttons{
margin-top: 32px;
}
.modal-form__buttons--two{
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-form__buttons--two button,
.modal-form__buttons--two input{
width: calc(50% - 20px);
}
.modal-map{
margin: auto;
width: 1105px;
display: none;
border-radius: 24px;
border: none;
}
.modal-map.active{
display: flex;
}
.modal-map__left{
width: 600px;
padding: 24px;
position: relative;
}
.modal-map__control{
margin: 38px -12px -12px -12px;
display: flex;
}
.modal-map__control--delivery{
margin-top: 12px;
}
.modal-map-control__item{
margin: 12px;
padding: 2px;
width: calc(50% - 24px);
background: var(--background-9);
border-radius: 20px;
border: none;
}
.modal-map-control__item.active{
background: var(--gradient-blue);
}
.modal-map-control__item.active .form-input-radio__circle::before{
content: '';
position: absolute;
top: 4px;
left: 4px;
width: 12px;
aspect-ratio: 1;
border-radius: 50%;
background: var(--gradient-blue);
}
.modal-map-control-item__content{
padding: 14px;
border-radius: 18px;
background: var(--background-white);
}
.modal-map-control-item__header{
display: flex;
align-items: center;
}
.modal-map-control-item__circle{
padding: 2px;
width: 20px;
aspect-ratio: 1;
border-radius: 50%;
background: var(--background-9);
position: relative;
}
.modal-map-control-item__input{
display: none;
}
.modal-map-control-item-circle__content{
width: 16px;
aspect-ratio: 1;
border-radius: 50%;
background: var(--background-white);
}
.modal-map-control__item.active .modal-map-control-item__circle{
background: var(--gradient-blue);
}
.modal-map-control__item.active .modal-map-control-item__circle::before{
content: '';
position: absolute;
top: 4px;
left: 4px;
width: 12px;
aspect-ratio: 1;
border-radius: 50%;
background: var(--gradient-blue);
}
.modal-map-control-item__title{
margin-left: 8px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-dark);
}
.modal-map-control-item__description{
margin-top: 16px;
}
.modal-map-control-item__time{
font-family: var(--font-family);
font-weight: 500;
font-size: 16px;
line-height: 125%;
color: var(--text-black);
text-align: start;
}
.modal-map-control-item__price{
margin-top: 8px;
font-family: var(--font-family);
font-weight: 700;
font-size: 12px;
line-height: 133%;
color: var(--text-6);
text-align: start;
}
.modal-map__form{
margin-top: 24px;
}
.modal-map-form__hidden{
}
.modal-map-form__button{
margin-top: 83px;
}
.modal-map-form__sub-button{
display: none;
}
.modal-map__right{
padding: 16px 0px 16px 16px;
}
.modal-map__map{
border: 2px solid var(--background-9);
border-radius: 16px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.modal-map__map iframe{
height: 650px;
}
.modal__age{
}
.modal__age > div{
display: none;
}
.modal__age > div.active{
display: flex;
}
/* modal */
/* toggle */
.toggle{
padding-top: 26px;
padding-bottom: 25px;
border-bottom: 1px solid var(--text-3);
position: relative;
}
.toggle::after{
content: '';
position: absolute;
top: 24px;
right: 0;
width: 24px;
aspect-ratio: 1;
background-image: url(../img/svg/main/black-x.svg);
transform: rotate(45deg);
transition: transform .2s;
pointer-events: none;
}
.toggle.active::after{
transform: rotate(0deg);
}
.toggle__title{
padding-right: 30px;
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: var(--text-black);
cursor: pointer;
}
.toggle__block-content{
height: 0;
overflow: hidden;
transition: height .2s ease-out;
}
.toggle__content{
padding-top: 24px;
}
.toggle-content__item{
margin: 12px -12px -12px -12px;
display: flex;
align-items: center;
flex-wrap: wrap;
}
.toggle-content__item:first-child{
margin-top: 0;
}
.toggle-content__element{
margin: 12px;
}
.toggle-content__element--width-perc-100{
width: 100%;
}
.toggle-content__element--width-perc-50{
width: calc(50% - 24px);
}
.toggle__text{
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
/* toggle */
/* checkbox */
.checkbox{
display: flex;
align-items: center;
cursor: pointer;
}
.checkbox__state{
border-radius: 4px;
width: 18px;
height: 18px;
border: 2px solid var(--background-black);
background: var(--background-white);
flex-shrink: 0;
}
.checkbox.active .checkbox__state{
background-color: var(--background-black);
background-image: url(../img/svg/main/arrow-selected-white.svg);
background-repeat: no-repeat;
background-position: center;
}
.checkbox__input{
display: none;
}
.checkbox__label{
padding-left: 8px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-dark);
cursor: pointer;
}
.checkbox__label a{
color: #76ce75;
text-decoration: none;
}
.checkbox--small{
margin-top: 24px;
}
.checkbox--small .checkbox__label{
padding-left: 24px;
font-weight: 500;
font-size: 12px;
line-height: 133%;
}
/* checkbox */
/* radio */
.radio{
display: flex;
align-items: center;
}
.radio__input{
width: 18px;
aspect-ratio: 1;
accent-color: var(--background-black);
cursor: pointer;
}
.radio__label{
padding-left: 8px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-dark);
cursor: pointer;
}
/* radio */
@keyframes slidein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.subscription{
@ -2231,3 +1423,141 @@ button{
.cabinet-card-order-payment__price span{
font-size: 12px;
}
.wcsatt-add-to-subscription-wrapper,
form.cart .quantity,
.detail__content .in-stock,
.wcsatt-options-prompt-label-subscription,
.wcsatt-options-product-dropdown {
display: none;
}
.wcsatt-options-product-wrapper {
display: block!important;
}
form.cart .single_add_to_cart_button {
margin: 8px;
min-width: 345.89px;
height: 56px;
padding: 16px 24px 16px 24px;
font-weight: 700;
text-align: center;
position: relative;
background: var(--gradient-turquoise);
border: none;
transition: opacity .2s ease-out;
font-family: var(--font-family);
font-size: 20px;
line-height: 120%;
color: var(--text-black);
border-radius: 20px;
text-transform: none;
cursor: pointer;
}
form.cart .single_add_to_cart_button:hover {
opacity: 0.8;
}
.subscription-option-details span {
color: #000;
cursor: pointer;
}
ul.wcsatt-options-product, .wcsatt-options-product-dropdown {
margin: 0;
}
.wcsatt-options-wrapper input, .wcsatt-add-to-subscription-wrapper input {
width: 18px;
aspect-ratio: 1;
accent-color: var(--background-black);
cursor: pointer;
}
.subscription-option label {
display: flex;
align-items: center;
gap: 5px;
}
form.cart {
margin: 25px 0 -48px;
}
ul.wcsatt-options-product--hidden, .wcsatt-options-product-dropdown--hidden {
display: block!important;
}
.detail-block__form{
margin-top: 48px;
display: flex;
flex-direction: column;
}
.wcsatt-options-prompt-text{
font-family: 'Craftwork Grotesk';
font-style: normal;
font-weight: 700;
font-size: 20px;
line-height: 24px;
text-transform: uppercase;
color: #000000;
}
.subscription-option-details, .wcsatt-options-prompt-action, .subs-text-title{
font-size: 20px;
line-height: 24px;
display:flex;
gap: 12px;
align-items: center;
}
.subs-text{
max-width: 322px;
font-family: 'Craftwork Grotesk';
font-style: normal;
font-weight: 500;
font-size: 16px;
line-height: 20px;
margin-bottom: 20px;
}
input:checked + .subscription-option-details::before, input:checked + .wcsatt-options-prompt-action::before{
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10Z' fill='white'/%3E%3Cpath d='M1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10Z' stroke='url(%23paint0_radial_11890_46040)' stroke-width='2'/%3E%3Ccircle cx='10' cy='10' r='6' fill='url(%23paint1_radial_11890_46040)'/%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_11890_46040' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(19 1) rotate(135) scale(25.4558 34.7538)'%3E%3Cstop stop-color='%23188892'/%3E%3Cstop offset='0.45' stop-color='%231EA49C'/%3E%3Cstop offset='0.9' stop-color='%2376CE75'/%3E%3Cstop offset='1' stop-color='%23BBE38D'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_11890_46040' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(16 4) rotate(135) scale(16.9706 23.1692)'%3E%3Cstop stop-color='%23188892'/%3E%3Cstop offset='0.45' stop-color='%231EA49C'/%3E%3Cstop offset='0.9' stop-color='%2376CE75'/%3E%3Cstop offset='1' stop-color='%23BBE38D'/%3E%3C/radialGradient%3E%3C/defs%3E%3C/svg%3E");
}
.subscription-option-details::before, .wcsatt-options-prompt-action::before{
content: '';
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10Z' fill='white'/%3E%3Cpath d='M1 10C1 5.02944 5.02944 1 10 1C14.9706 1 19 5.02944 19 10C19 14.9706 14.9706 19 10 19C5.02944 19 1 14.9706 1 10Z' stroke='%23121212' stroke-width='2'/%3E%3C/svg%3E");
height: 20px; width: 20px;
}
.wcsatt-options-wrapper input, .wcsatt-add-to-subscription-wrapper input {
aspect-ratio: 1;
accent-color: var(--background-black);
cursor: pointer;
height: 0;
width: 0;
position: absolute;
opacity: 0;
}
.subscription-option .amount {
color: #1A1A1A;
font-weight: 600;
}
.subscription-option del .amount {
color: #bbb;
font-weight: 400;
font-size: .8em;
}
.subscription-option del .woocommerce-Price-amount.amount, .subscription-option del .woocommerce-Price-currencySymbol{
text-decoration: line-through !important;
}
.woocommerce-Price-amount.amount{
font-size: 1.15em;
}
.detail #wc-stripe-express-checkout-element{
display: none !important;
}

@ -108,3 +108,45 @@ const detailCatalot = new Swiper('.detail__catalot', {
});
// detail catalog
//
//
//
jQuery(document).ready(function($) {
// Основные радио-кнопки выбора типа покупки
const $oneTimeRadio = $('input[value="no"][name="subscribe-to-action-input"]');
const $subscribeRadio = $('input[value="yes"][name="subscribe-to-action-input"]');
// Все чекбоксы вариантов подписки
const $subscriptionOptions = $('.wcsatt-options-product input[type="radio"]');
// Обработчик для One-time
$oneTimeRadio.on('change', function() {
if ($(this).is(':checked')) {
// Снимаем выделение со всех вариантов подписки
$subscriptionOptions.prop('checked', false);
}
});
// Обработчик для Subscribe
$subscribeRadio.on('change', function() {
if ($(this).is(':checked')) {
// Снимаем выделение с One-time
$oneTimeRadio.prop('checked', false);
// Если ни один вариант подписки не выбран, выбираем первый
if ($subscriptionOptions.filter(':checked').length === 0) {
$subscriptionOptions.first().prop('checked', true);
}
}
});
// Обработчик для вариантов подписки
$subscriptionOptions.on('change', function() {
if ($(this).is(':checked')) {
// Снимаем выделение с One-time
$oneTimeRadio.prop('checked', false);
// Активируем Subscribe
$subscribeRadio.prop('checked', true);
}
});
});

@ -56,9 +56,9 @@
</div>
{% endif %}
</div>
<p class="detail__title">
<h1 class="detail__title">
{{ product.get_title }}
</p>
</h1>
<div class="detail__images-phone">
<div class="swiper-wrapper">
@ -109,13 +109,8 @@
{% endif %}
<div class="detail-block-form__items">
<a href="?add-to-cart={{ product.id }}" class="button button--gradient button--high add_to_cart_button ajax_add_to_cart" data-product_id="{{ product.id }}" data-quantity="1">
{{ function('pll_e', 'Добавить в корзину') }}
</a> </div>
</form>
{{ function('do_action', 'woocommerce_' ~ product.get_type() ~ '_add_to_cart') }}
<div class="detail__toggle">
<div class="toggle">
<p class="toggle__title">

@ -5,6 +5,26 @@
* This is the template that renders pages using Timber (Twig).
*/
if (is_account_page() && !is_wc_endpoint_url()){
include_module('profile');
$orders_pg = false;
include_component('profile', 'profile');
}
else if (is_account_page() && isset($wp->query_vars['orders'])){
include_module('profile');
$orders_pg = true;
include_component('profile', 'profile');
}
elseif (is_account_page() && isset($wp->query_vars['subscriptions'])){
include_module('profile');
include_component('profile', 'subscriptions');
}
elseif (is_account_page() && isset($wp->query_vars['view-subscription'])){
include_module('profile');
include_component('profile', 'subscription_single');
}
$context = Timber::context();
$context['post'] = Timber::get_post();

@ -4277,3 +4277,7 @@ color: #f4f1f0;
.reviews-plus{
overflow: hidden;
}
.invisible {
visibility: hidden;
}

@ -467,6 +467,59 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
// Находим все элементы с классом login-open
document.addEventListener('DOMContentLoaded', function() {
const loginButtons = document.querySelectorAll('.login-open');
// Добавляем обработчик события для каждой кнопки
loginButtons.forEach(button => {
button.addEventListener('click', function(event) {
event.preventDefault(); // Предотвращаем стандартное действие (если это ссылка)
// Находим элементы модального окна
const modal = document.querySelector('.modal');
const modalAside = document.querySelector('.modal__aside');
const modalLogin = document.querySelector('.modal__login');
// Добавляем классы active
modal.classList.add('active');
modalLogin.classList.add('active');
// Устанавливаем ширину для modal__aside
modalAside.style.width = '412px';
});
});
// Опционально: добавляем функцию закрытия модального окна
// Например, при клике на фон или кнопку закрытия
const closeButtons = document.querySelectorAll('.modal-close');
const modal = document.querySelector('.modal');
// Закрытие по клику на кнопку закрытия
closeButtons.forEach(button => {
button.addEventListener('click', closeModal);
});
// Закрытие по клику на фон (если клик не на модальное окно)
modal.addEventListener('click', function(event) {
if (event.target === modal) {
closeModal();
}
});
function closeModal() {
const modal = document.querySelector('.modal');
const modalAside = document.querySelector('.modal__aside');
const modalLogin = document.querySelector('.modal__login');
// Удаляем классы active
modal.classList.remove('active');
modalLogin.classList.remove('active');
// Сбрасываем ширину
modalAside.style.width = '';
}
});
document.addEventListener('DOMContentLoaded', function() {
// Initialize Swiper

@ -0,0 +1,839 @@
{% extends 'layout.twig' %}
{% block content %}
{% set bodyClass = 'bg-white' %}
<main class="wrapper">
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-mobile">
<div class="cabinet-card__content">
<p class="cabinet-card__title">
<?php echo esc_html__( 'Feed subscription', '_pll_e' ) ?>
</p>
<div class="cabinet-card__element">
<p class="cabinet-card__text"><?php echo esc_html__( 'Weekly food delivery for your pet', '_pll_e' ) ?></p>
</div>
<div class="cabinet-card__element">
<button class="button button--gradient button--high-46 form-sub__btn">
<?php echo esc_html__( 'Get details', '_pll_e' ) ?>
</button>
</div>
</div>
</div>
<div class="cabinet__control">
<button class="cabinet-control__button active start" data-cabinet="orders"> <?php echo esc_html__( 'Orders', '_pll_e' ) ?></button>
<button class="cabinet-control__button" data-cabinet="profile"> <?php echo esc_html__( 'Profile', '_pll_e' ) ?></button>
</div>
<div class="cabinet">
<div class="cabinet__profile cabinet-content">
<div class="cabinet-card cabinet-card--green">
<div class="cabinet-card__content">
<div class="cabinet-card__element">
<?php
$first_name = $current_user->user_firstname;
$last_name = $current_user->user_lastname;?>
<p class="cabinet-card__text <?php if (!$first_name && !$last_name): ?>cabinet-card__text--grey<?php endif; ?>">
<?php
$phone = get_user_meta( $current_user->ID, 'billing_phone', true );
if($first_name || $last_name):
echo $first_name . ' ' . $last_name;
else:
?>
<?php echo esc_html__( 'Name is not set', '_pll_e' ) ?>
<?php endif; ?>
</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label"> <?php echo esc_html__( 'Phone', '_pll_e' ) ?>:</p>
<p class="cabinet-card__text <?php if (!$phone): ?>cabinet-card__text--grey<?php endif; ?>">
<?php if ($phone):
echo $phone;
else:
?>
<?php echo esc_html__( 'Not filled', '_pll_e' ) ?>
<?php endif ?>
</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label"> <?php echo esc_html__( 'Email', '_pll_e' ) ?>:</p>
<?php if($current_user->user_email): ?>
<p class="cabinet-card__text"><?php echo $current_user->user_email ?></p>
<?php
if (get_field('activated', 'user_' . get_current_user_id())):
?>
<p class="cabinet-card__status cabinet-card__status--chek"> <?php echo esc_html__( 'Email is verified', '_pll_e' ) ?></p>
<?php
else:
?>
<p class="cabinet-card__status cabinet-card__status--cancelled"> <?php echo esc_html__( 'Email is not verified', '_pll_e' ) ?></p>
<form class="email_approve_form">
<input type="hidden" name="action" value="email_activate">
<button type="submit" class="cabinet-card__confirm">
<?php echo esc_html__( 'Verify', '_pll_e' ) ?>
</button>
</form>
<?php
if (get_field('uuid', 'user_' . get_current_user_id())):
?>
<p class="cabinet-card__status"> <?php echo esc_html__( 'Email width verification link is sent to your email.', '_pll_e' ) ?></p>
<?php
endif;
?>
<?php
endif;
?>
<?php else: ?>
<div class="cabinet-card__label">
<form class="email_link_form">
<input type="hidden" name="action" value="email_link">
<div class="cabinet-card_linked-email">
<input class="form__input" type="text" name="email" placeholder="example@example.com" required>
</div>
<button class="cabinet-card__confirm" type="submit"><?php echo pll__('Link email', '_pll_e'); ?></button>
</form>
</div>
<?php endif; ?>
</div>
<?php
$tg_account = get_user_meta( $current_user->ID, ' Traveling', true );
?>
<div class="cabinet-card__element">
<p class="cabinet-card__label"> <?php echo pll__( 'Linked accounts') ?>:</p>
<p class="cabinet-card__text cabinet-accounts">
<?php if ($tg_account): ?>
<svg width="40px" height="40px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg>
<?php else: ?>
<script async src="https://telegram.org/js/telegram-widget.js?2" data-telegram-login="<?= BOT_USERNAME; ?>" data-size="large" data-onauth="linkTelegram(user)"></script>
<?php endif ?>
</p>
</div>
<div class="cabinet-card__element">
<div class="cabinet-card__block-buttons">
<button class="cabinet-card__button user-edit-open">
<?php echo esc_html__( 'Edit', '_pll_e' ) ?>
</button>
<a href="<?php echo wp_logout_url(home_url()) ?>" class="cabinet-card__button">
<?php echo esc_html__( 'Logout', '_pll_e' ) ?>
</a>
</div>
</div>
</div>
</div>
<?php
// Получаем текущего пользователя
$current_user_id = get_current_user_id();
// Проверяем, что пользователь авторизован
if ($current_user_id) {
// Параметры для WP_Query
$args = array(
'post_type' => 'pets', // Тип постов
'meta_query' => array(
array(
'key' => 'user', // Имя метаполя
'value' => $current_user_id, // Значение метаполя (ID текущего пользователя)
'compare' => '=' // Условие сравнения
)
)
);
// Создаем новый объект WP_Query
$query = new \WP_Query($args);
if ($query->have_posts()) {
// Начинаем цикл по постам
while ($query->have_posts()) {
$query->the_post();
get_pet_card($post);
}
// Сбрасываем данные постов
wp_reset_postdata();
}
}
?>
<div class="cabinet-card cabinet-card--green">
<div class="cabinet-card__content">
<button class="cabinet-card__block-add-pets form-open" data-form="form-pet">
<div class="cabinet-card-add-pets__circle">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/plus-grey.svg" alt="">
</div>
<p class="cabinet-card-add-pets__text">
<?php echo esc_html__( 'Add a pet', '_pll_e' ) ?>
</p>
</button>
</div>
</div>
</div>
<div class="cabinet__orders cabinet-content active hide">
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc">
<div class="cabinet-card__content">
<p class="cabinet-card__title">
<?php echo esc_html__( 'Feed subscription', '_pll_e' ) ?>
</p>
<div class="cabinet-card__element">
<p class="cabinet-card__text"> <?php echo esc_html__( 'Weekly food delivery for your pet', '_pll_e' ) ?></p>
</div>
<div class="cabinet-card__element">
<button class="button button--gradient button--high-46 form-sub__btn">
<?php echo esc_html__( 'Get details', '_pll_e' ) ?>
</button>
</div>
</div>
</div>
<?php
$customer_orders = wc_get_orders( array(
'customer_id' => $current_user->ID,
) );
if ($customer_orders):
foreach($customer_orders as $order):
$meta_data = get_post_meta($order->get_id(), 'order_data', true);
$shipping_address = $order->get_address( 'shipping' );
?>
<div class="cabinet-card cabinet-card--grey">
<div class="cabinet-card__content">
<div class="cabinet-card__order">
<div class="cabinet-card-order__header">
<div class="cabinet-card-order__main">
<p class="cabinet-card-order-main__date"><?php echo esc_html__( 'Order from', '_pll_e' ) ?> <?php echo $order->get_date_created()->date('Y.m.d') ?></p>
<p class="cabinet-card-order-main__number"><?php echo $order->get_id() ?></p>
</div>
<div class="cabinet-card-order__payment">
<p class="cabinet-card-order-payment__title"><?php echo esc_html__( 'Summary', '_pll_e' ) ?>:</p>
<p class="cabinet-card-order-payment__price"><?php echo $order->get_total() ?></p>
</div>
</div>
<div class="cabinet-card-order__bottom">
<div class="cabinet-card-order__content">
<?php
if ($meta_data){
$order_track = $meta_data['order_number'];
}
else{
$order_track = '';
}
?>
<div class="cabinet-card-order__block-detail">
<div class="cabinet-card-order__detail">
<div class="cabinet-card-order-detail__address">
<p class="cabinet-card-order-detail-address__title"><?php echo esc_html__( 'Delivery address', '_pll_e' ) ?> </p>
<p class="cabinet-card-order-detail-address__text">
<?php
if (isset($meta_data['office_code'])):
echo esc_html__( 'CDEK shipping point', '_pll_e' );
echo '<br>';
echo json_decode($api->getOffices(['code' => $meta_data['office_code']])['body'])[0]->name;
?>
<?php
else:
echo $shipping_address['city'] . ' ' . $shipping_address['address_1'];
?>
<?php
endif;
?>
</p>
</div>
<div class="cabinet-card-order-detail__main">
<div class="cabinet-card-order-detail-main__products">
<?php
foreach ($order->get_items() as $item_id => $item) :
$product_name = $item->get_name();
$product_quantity = $item->get_quantity();
$product_total = $item->get_total();
$product = $item->get_product();
if ($product){
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $product->get_id() ), 'thumbnail' );
}
else{
$thumbnail = '';
}
?>
<div class="cabinet-card-order-detail-main__product">
<img src="<?php echo $thumbnail[0]; ?>" alt="" class="cabinet-card-order-detail-main-product__img">
<div class="cabinet-card-order-detail-main-product__content">
<div class="cabinet-card-order-detail-main-product__description">
<p class="cabinet-card-order-detail-main-product-description__what"><?php echo $product_name ?></p>
<!-- <p class="cabinet-card-order-detail-main-product-description__with-what">Индейка, 2 <?php echo esc_html__('kg', '_pll_e' ); ?></p> -->
</div>
<p class="cabinet-card-order-detail-main-product__count"><?php echo $product_quantity ?></p>
<p class="cabinet-card-order-detail-main-product__price"><?php echo $product_total ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="cabinet-card-order-detail-main__links">
<?php
if($order_track):
?>
<a href="https://www.cdek.ru/ru/tracking/?order_id=<?php echo $order_track ?>" target="_blank" class="cabinet-card__button cabinet-card-order-detail-main__link">
<?php echo esc_html__( 'Track order', '_pll_e' ) ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<button class="cabinet-card-order__open-detail"><?php echo esc_html__( 'Order details', '_pll_e' ) ?></button>
</div>
<div class="cabinet-card-order__detail-short">
<?php
foreach ($order->get_items() as $item_id => $item) :
$product = $item->get_product();
if ($product){
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $product->get_id() ), 'thumbnail' );
}
else{
$thumbnail = '';
}
?>
<?php if ($thumbnail[0]): ?>
<a href="<?php echo get_the_permalink($product->get_id()) ?>"><img src="<?= $thumbnail[0] ?>" alt="" class="cabinet-card-order-detail-short__item"></a>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
<?php
endforeach;
else:
?>
<div class="cabinet-card__no-orders">
<div class="cabinet-card-no-orders__element">
<p class="cabinet-card-no-orders__title"><?php echo esc_html__( 'No orders yet', '_pll_e' ) ?></p>
</div>
<div class="cabinet-card-no-orders__element">
<a href="/shop/" class="to-know button--100-perc to-know--background-none">
<p><?php echo esc_html__( 'Catalog', '_pll_e' ) ?></p>
</a>
</div>
</div>
<?php
endif;
?>
</div>
</div>
</main>
<?php
$args = array(
'post_type' => 'pets', // Тип постов
'meta_query' => array(
array(
'key' => 'user', // Имя метаполя
'value' => $current_user_id, // Значение метаполя (ID текущего пользователя)
'compare' => '=' // Условие сравнения
)
)
);
// Создаем новый объект WP_Query
$query = new \WP_Query($args);
if ($query->have_posts()) {
// Начинаем цикл по постам
while ($query->have_posts()) {
$query->the_post();
switch (get_field('weight')){
case ('below_1_5'):
$w = esc_html__('from 0,5 kg to 1,5 kg', '_pll_e' );
break;
case ('1_5-3'):
$w = esc_html__('from 1.5 to 3 kg', '_pll_e' );
break;
case ('3-5'):
$w = esc_html__('from 3 to 5 kg', '_pll_e' );
break;
case ('5-8'):
$w = esc_html__('from 5 to 8 kg', '_pll_e' );
break;
case ('8-11'):
$w = esc_html__('from 8 to 11 kg', '_pll_e' );
break;
case ('11-15'):
$w = esc_html__('from 11 to 15 kg', '_pll_e' );
break;
case ('15-20'):
$w = esc_html__('from 15 to 20 kg', '_pll_e' );
break;
case ('20-25'):
$w = esc_html__('from 20 to 25 kg', '_pll_e' );
break;
case ('25-35'):
$w = esc_html__('from 25 to 35 kg', '_pll_e' );
break;
case ('more_35'):
$w = esc_html__('More than 35 kg', '_pll_e' );
break;
}
switch (get_field('old')){
case ('normal'):
$old = __('Adult (from 1 year to 7 years)', '_pll_e' );
break;
case ('old'):
$old = __('Elderly (from 7 to 12 years)', '_pll_e' );
break;
case ('very_old'):
$old = __('Aging (12 years and older)', '_pll_e' );
break;
case ('baby'):
$old = __('Baby (from 0 to 1 year)', '_pll_e' );
break;
}
switch (get_field('activity')){
case ('low'):
$act = esc_html__('Low', '_pll_e' );
break;
case ('moderate'):
$act = esc_html__('Moderate', '_pll_e' );
break;
case ('high'):
$act = esc_html__('High', '_pll_e' );
break;
}
?>
<?php
$months = array(
esc_html__('january', '_pll_e' ),
esc_html__('february', '_pll_e' ),
esc_html__('march', '_pll_e' ),
esc_html__('april', '_pll_e' ),
esc_html__('may', '_pll_e' ),
esc_html__('june', '_pll_e' ),
esc_html__('july', '_pll_e' ),
esc_html__('august', '_pll_e' ),
esc_html__('september', '_pll_e' ),
esc_html__('october', '_pll_e' ),
esc_html__('november', '_pll_e' ),
esc_html__('december', '_pll_e' ),
);
?>
<div class="modalProfile" id="pet_edit_<?php echo get_the_ID($post); ?>">
<div class="popup-wrap">
<div class="modal-form form__full-mobile modal-form--white modal-form--height-100-phone form-pet active">
<button class="modal-form__close"></button>
<p class="modal-form__title"><?php echo esc_html__('Edit pet', '_pll_e' ); ?> <?php echo get_the_title() ?></p>
<form class="modal-form__content edit-pet-form" method="post" action="">
<input type="hidden" name="action" value="edit_pet">
<div class="modal-form-content__line">
<label class="label-name"><?php echo esc_html__('Pet type', '_pll_e' ); ?></label>
<div class="form-input__tabs">
<label class="form-input-tabs__button <?php if (get_field('type', $post) == 'cat'): ?> active <?php endif; ?>">
<?php echo esc_html__('Dog', '_pll_e' ); ?>
<input type="radio" value="cat" <?php if (get_field('type', $post) == 'cat'): ?> checked <?php endif; ?> name="pet" class="form-input-tabs__input">
</label>
<label class="form-input-tabs__button <?php if (get_field('type', $post) == 'dog'): ?> active <?php endif; ?>">
<?php echo esc_html__('Cat', '_pll_e' ); ?>
<input type="radio" value="dog" <?php if (get_field('type', $post) == 'dog'): ?> checked <?php endif; ?> name="pet" class="form-input-tabs__input">
</label>
</div>
</div>
<div class="modal-form-content__line sterilized" <?php if (get_field('type', $post) == 'dog'): ?> style="display: none;" <?php endif; ?>>
<label for="" class="label-name"><?php echo esc_html__('Sterilized', '_pll_e' ); ?></label>
<div class="form-input__tabs">
<label class="form-input-tabs__button <?php if (get_field('sterilized', $post)): ?> active<?php endif; ?>">
<?php echo esc_html__('Yes', '_pll_e' ); ?>
<input type="radio" value="1" <?php if (get_field('sterilized', $post)): ?> checked <?php endif; ?> name="sterilized" class="form-input-tabs__input">
</label>
<label class="form-input-tabs__button <?php if (!get_field('sterilized', $post)): ?> active<?php endif; ?>">
<?php echo esc_html__('No', '_pll_e' ); ?>
<input type="radio" value="0" <?php if (!get_field('sterilized', $post)): ?> checked <?php endif; ?> name="sterilized" class="form-input-tabs__input">
</label>
</div>
</div>
<div class="modal-form-content__line">
<div class="modal-form-content-line__element">
<label for="firstname" class="label-name"><?php echo esc_html__('Breed', '_pll_e' ); ?></label>
<input id="firstname" class="form__input" type="text" value="<?php echo get_field('breed', $post) ?>" name="breed"
placeholder="Порода вашего питомца" required="">
<!-- <span class="form-input__error form-input__error--absolute">Порода введено неверно</span> -->
</div>
</div>
<div class="modal-form-content__line">
<label for="" class="label-name"><?php echo esc_html__('Gender of your pet', '_pll_e' ); ?></label>
<div class="form-input__tabs">
<label class="form-input-tabs__button <?php if (get_field('sex', $post) == 'male'): ?> active<?php endif; ?>">
<?php echo esc_html__('Boy', '_pll_e' ); ?>
<input type="radio" value="male" <?php if (get_field('sex', $post) == 'male'): ?> checked<?php endif; ?> name="sex" class="form-input-tabs__input">
</label>
<label class="form-input-tabs__button <?php if (get_field('sex', $post) != 'male'): ?> active<?php endif; ?>">
<?php echo esc_html__('Girl', '_pll_e' ); ?>
<input type="radio" value="female" <?php if (get_field('sex', $post) != 'male'): ?> checked<?php endif; ?> name="sex" class="form-input-tabs__input">
</label>
</div>
</div>
<div class="modal-form-content__line modal-form-content__line--two">
<div class="modal-form-content-line__element">
<label class="label-name"><?php echo esc_html__('Type of activity', '_pll_e' ); ?></label>
<div class="form-input__list">
<div class="form-input-list__input"><?php echo $act ?></div>
<div class="form-input-list__block-content" style="height: 0px;">
<div class="form-input-list__content">
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'low'): ?> active<?php endif; ?>">
<p class="form-input-list-item__text"><?php echo esc_html__('Low', '_pll_e' ); ?></p>
<input type="radio" required name="activity" <?php if (get_field('activity', $post) == 'low'): ?> checked<?php endif; ?> value="low" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'moderate'): ?> active<?php endif; ?>">
<p class="form-input-list-item__text"><?php echo esc_html__('Moderate', '_pll_e' ); ?></p>
<input type="radio" required name="activity" <?php if (get_field('activity', $post) == 'moderate'): ?> checked<?php endif; ?> value="moderate" class="v-hidden"
id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'high'): ?> active<?php endif; ?>">
<p class="form-input-list-item__text"><?php echo esc_html__('High', '_pll_e' ); ?></p>
<input type="radio" required name="activity" value="high" <?php if (get_field('activity', $post) == 'high'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
</div>
</div>
</div>
</div>
<div class="modal-form-content-line__element">
<label for="firstname" class="label-name"><?php echo esc_html__('Weight', '_pll_e' ); ?></label>
<div class="form-input__list">
<div class="form-input-list__input"><?php echo $w ?></div>
<div class="form-input-list__block-content" style="height: 0px;">
<div class="form-input-list__content">
<label class="form-input-list__item">
<p class="form-input-list-item__text">1-1.5 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == 'below_1_5'): ?> checked<?php endif; ?> value="below_1_5" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">1.5-3 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '1_5-3'): ?> checked<?php endif; ?> value="1_5-3" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">3-5 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '3-5'): ?> checked<?php endif; ?> value="3-5" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">5-8 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '5-8'): ?> checked<?php endif; ?> value="5-8" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">8-11 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '8-11'): ?> checked<?php endif; ?> value="8-11" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">11-15 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '11-15'): ?> checked<?php endif; ?> value="11-15" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">15-20 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '15-20'): ?> checked<?php endif; ?> value="15-20" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">20-25 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '20-25'): ?> checked<?php endif; ?> value="20-25" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text">25-35 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '25-35'): ?> checked<?php endif; ?> value="25-35" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('More than', '_pll_e' ); ?> 35 <?php echo esc_html__('kg', '_pll_e' ); ?></p>
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == 'more_35'): ?> checked<?php endif; ?> value="more_35" class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="rm">
<div class="modal-form-content__line">
<label for="" class="label-name"><?php echo esc_html__("Pet's age", '_pll_e' ); ?></label>
<div class="form-input__tabs form-input__remote-control" data-content="modal__age">
<label class="form-input-tabs__button active" data-rm="0">
<?php echo esc_html__('Exemplary', '_pll_e' ); ?>
<input type="radio" checked value="ex" name="old_type" required
class="form-input-tabs__input">
</label>
<label class="form-input-tabs__button" data-rm="1">
<?php echo esc_html__('Exact', '_pll_e' ); ?>
<input type="radio" value="acc" name="old_type" required
class="form-input-tabs__input">
</label>
</div>
</div>
<div class="modal__age">
<div class="form-input__radio remote-control__item active" data-rmcont="0">
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'baby'): ?> active<?php endif; ?>" >
<input type="radio" name="old" value="baby" <?php if (get_field('old', $post) == 'baby'): ?> checked<?php endif; ?> class="v-hidden">
<div class="form-input-radio__circle">
<div class="form-input-radio-circle__content"></div>
</div>
<p class="form-input-radio__title"> <?php echo __('Baby <span>(from 0 to 1 year)</span>', '_pll_e' ); ?></p>
</label>
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'normal'): ?> active<?php endif; ?>">
<input type="radio" name="old" value="normal" <?php if (get_field('old', $post) == 'normal'): ?> checked<?php endif; ?> class="v-hidden">
<div class="form-input-radio__circle">
<div class="form-input-radio-circle__content"></div>
</div>
<p class="form-input-radio__title"> <?php echo __('Adult <span>(from 1 year to 7 years)</span>', '_pll_e' ); ?></p>
</label>
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'old'): ?> active<?php endif; ?>">
<input type="radio" name="old" value="old" <?php if (get_field('old', $post) == 'old'): ?> checked<?php endif; ?> class="v-hidden">
<div class="form-input-radio__circle">
<div class="form-input-radio-circle__content"></div>
</div>
<p class="form-input-radio__title"> <?php echo __('Elderly <span>(from 7 to 12 years)</span>', '_pll_e' ); ?></p>
</label>
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'very_old'): ?> active<?php endif; ?>">
<input type="radio" name="old" <?php if (get_field('old', $post) == 'very_old'): ?> checked<?php endif; ?> value="very_old" class="v-hidden">
<div class="form-input-radio__circle">
<div class="form-input-radio-circle__content"></div>
</div>
<p class="form-input-radio__title"> <?php echo __('Aging <span>(12 years and older)</span>', '_pll_e' ); ?></p>
</label>
</div>
<div data-rmcont="1"
class="modal-form-content__line remote-control__item modal-form-content__line--three modal-form-content__line--margin-top-16 ">
<div class="modal-form-content-line__element">
<label for="firstname" class="label-name"><?php echo esc_html__('Day', '_pll_e' ); ?></label>
<input id="firstname" class="form__input form__input--center" maxlength="2" type="text"
name="day" placeholder="<?php echo esc_html__('DD', '_pll_e' ); ?>" value="<?php echo get_field('day', $post) ?>">
</div>
<div class="modal-form-content-line__element">
<label for="firstname" class="label-name"><?php echo esc_html__('Month', '_pll_e' ); ?></label>
<div class="form-input__list">
<?php
if(get_field('month', $post)):
?>
<div class="form-input-list__input"><?php echo $months[intval(get_field('month', $post)) - 1 ]; ?></div>
<?php
else:
?>
<div class="form-input-list__input"><?php echo esc_html__('Month', '_pll_e' ); ?></div>
<?php
endif;
?>
<div class="form-input-list__block-content">
<div class="form-input-list__content">
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('January', '_pll_e' ); ?></p>
<input type="radio" name="month" value="1" <?php if (get_field('month', $post) == '1'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('February', '_pll_e' ); ?></p>
<input type="radio" name="month" value="2" <?php if (get_field('month', $post) == '2'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('March', '_pll_e' ); ?></p>
<input type="radio" name="month" value="3" <?php if (get_field('month', $post) == '3'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('April', '_pll_e' ); ?></p>
<input type="radio" name="month" value="4" <?php if (get_field('month', $post) == '4'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('May', '_pll_e' ); ?></p>
<input type="radio" name="month" value="5" <?php if (get_field('month', $post) == '5'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('June', '_pll_e' ); ?></p>
<input type="radio" name="month" value="6" <?php if (get_field('month', $post) == '6'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('July', '_pll_e' ); ?></p>
<input type="radio" name="month" value="7" <?php if (get_field('month', $post) == '7'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('August', '_pll_e' ); ?></p>
<input type="radio" name="month" value="8" <?php if (get_field('month', $post) == '8'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('September', '_pll_e' ); ?></p>
<input type="radio" name="month" value="9" <?php if (get_field('month', $post) == '9'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg"
alt="">
</div>
</div>
</label>
<label class="form-input-list__item">
<p class="form-input-list-item__text"><?php echo esc_html__('October', '_pll_e' ); ?></p>
<input type="radio" name="month" value="10" <?php if (get_field('month', $post) == '10'): ?> checked<?php endif; ?> class="v-hidden" id="">
<div class="form-input-list-item__box">
<div class="form-input-list-item-box__content">
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow Progressive Web App (PWA) support
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

@ -1,21 +1,8 @@
{% set current_path = template_path ~ '/modules/blog/components/most-read' %}
<div class="anons-best">
<h2 class="anons-best__title">{{ function('pll_e', 'САМЫЕ ЧИТАЕМЫЕ') }}:</h2>
<!-- Отладочная информация -->
{% if debug_info %}
<div style="display:none;">
<p>Метаполя с просмотрами:</p>
<ul>
{% for item in debug_info %}
<li>ID: {{ item.post_id }}, Ключ: {{ item.meta_key }}, Значение: {{ item.meta_value }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if most_read and most_read|length > 0 %}
<ul class="anons-best__card-wrap">
{% for post in most_read %}
@ -35,12 +22,11 @@
<div class="anons-best__card-body__datas">
<p>{{ post.date|date('d.m.Y') }}</p>
<p>{{ function('pll_e', 'время чтения') }}: {{ post.reading_time|default('5 мин') }}</p>
<ul>
<ul class="anons-best__card-meta">
<li>
<img src="{{ current_path }}/assets/img/heart-white.svg" alt="">
<span>{{ function('get_post_likes_count', post.ID) }}</span>
</li>
<li>
<img src="{{ current_path }}/assets/img/msg-white.svg" alt="">
<span>{{ post.comment_count }}</span>
@ -53,7 +39,6 @@
</li>
{% endif %}
</ul>
</div>
</div>
</li>

@ -55,6 +55,10 @@
<!-- Footer end -->
{% verbatim %}
<div class="mform mform-success" style="display: none;">
<div class="mform-content">
<div class="close-button">&times;</div>
@ -71,7 +75,7 @@
</div>
<div class="mform mform-offer" style="display: none;">
<div class="mform mform-offer modal-offer" style="display: none;">
<div class="mform-content">
<div class="close-button">&times;</div>
<h2 class="mform-title">ПРЕДЛОЖИТЕ СТАТЬЮ</h2>
@ -97,9 +101,156 @@
<button type="submit" class="submit-button">Отправить</button>
</div>
<div class="author-image">
<img src="/wp-content/uploads/2025/04/rectangle.png" alt="Автор">
<img src="/wp-content/uploads/2025/06/rectangle.png" alt="Автор">
</div>
</form>
</div>
</div>
{% endverbatim %}
<script>
function onTelegramAuth(user) {
var data = {
action: 'ontelegramauth',
userid: user.id,
username: user.username,
fname: user.first_name,
lname: user.last_name
}
jQuery.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: data,
success: function(){
location.href = '/my-account';
}
});
}
function linkTelegram(user) {
var data = {
action: 'linktelegram',
userid: user.id,
username: user.username,
fname: user.first_name,
lname: user.last_name
}
jQuery.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: data,
success: function(){
jQuery('.cabinet-accounts').html('<svg width="40px" height="40px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg>');
}
});
}
document.addEventListener('DOMContentLoaded', function() {
// Получаем все формы на странице
const forms = document.querySelectorAll('form');
// Текущий URL страницы
const currentUrl = window.location.href;
// Перебираем все формы
forms.forEach(function(form) {
// Проверяем, нет ли уже такого поля в форме
const existingInput = form.querySelector('input[name="url"]');
if (!existingInput) {
// Создаем скрытое поле input
const urlInput = document.createElement('input');
urlInput.type = 'hidden';
urlInput.name = 'url';
urlInput.value = currentUrl;
// Добавляем поле в форму
form.appendChild(urlInput);
}
});
});
document.addEventListener('DOMContentLoaded', function() {
// Общая функция для открытия модальных окон
function modalOpen(triggerSelector, modalSelector) {
const triggers = document.querySelectorAll(triggerSelector);
const modalLogin = document.querySelector('.modal');
const modalItem = document.querySelector(modalSelector);
const modalAside = modalItem ? modalItem.querySelector('.modal__aside') : null;
triggers.forEach(trigger => {
trigger.addEventListener('click', (e) => {
e.preventDefault(); // Предотвращаем стандартное поведение
// Сбрасываем стили и классы для всех модальных окон
document.querySelectorAll('.modal__item').forEach(item => {
item.classList.remove('active');
item.style.cssText = ''; // Сбрасываем opacity, filter и другие стили
const aside = item.querySelector('.modal__aside');
if (aside) {
aside.style.width = '';
}
});
// Открываем нужное модальное окно
if (modalLogin && modalItem) {
modal.classList.add('active');
modalItem.classList.add('active');
modalItem.style.opacity = '1'; // Устанавливаем видимость
modalItem.style.filter = 'blur(0px)'; // Убираем размытие
if (modalAside) {
modalAside.style.width = '500px'; // Устанавливаем ширину
}
}
});
});
}
// Общая функция для закрытия модальных окон
function modalClose(closeSelector) {
const closes = document.querySelectorAll(closeSelector);
const modalLogin = document.querySelector('.modal');
closes.forEach(close => {
close.addEventListener('click', () => {
document.querySelectorAll('.modal__item').forEach(item => {
item.classList.remove('active');
item.style.cssText = ''; // Сбрасываем opacity, filter и другие стили
const aside = item.querySelector('.modal__aside');
if (aside) {
aside.style.width = '';
}
});
if (modalLogin) {
modal.classList.remove('active');
}
});
});
}
// Обработчик клика по фону модального окна
const modalLogin = document.querySelector('.modal');
if (modalLogin) {
modal.addEventListener('click', (event) => {
if (event.target.classList.contains('modal')) {
const modalItem = modal.querySelector('.modal__item.active');
if (modalItem) {
const aside = modalItem.querySelector('.modal__aside');
if (aside) {
aside.style.width = '0px';
}
modalItem.style.opacity = '0'; // Анимация закрытия
modalItem.style.filter = 'blur(10px)';
setTimeout(() => {
modalItem.classList.remove('active');
modalItem.style.cssText = ''; // Сбрасываем все стили после анимации
modal.classList.remove('active');
}, 300);
}
}
});
}
});
</script>

@ -6,6 +6,7 @@
{% block content %}
<section class="home">
<h1 class="home__title invisible">КОРМ БУДУЩЕГО ДЛЯ ВАШЕГО ПИТОМЦА</h1>
<div class="container">
<div class="home__swiper">
<div class="swiper-wrapper">
@ -13,7 +14,7 @@
<div class="swiper-slide">
<div class="home__item">
<div class="home__block">
<h1 class="home__title">{{ slide.slide_title }}</h1>
<h2 class="home__title">{{ slide.slide_title }}</h2>
<div class="home__subtitle">{{ slide.slide_description }}</div>
<a href="{{ slide.btn_url }}"
class="home__btn"><span>{{ slide.btn_text }}</span> </a>
@ -41,7 +42,7 @@
alt="">
</div>
<div class="about_info">
<h1 class="about_title">{{about_title}}</h1>
<h2 class="about_title">{{about_title}}</h2>
<p class="about_text">{{about_desc}}</p>
</div>
</div>
@ -546,7 +547,7 @@
<div class="section_wrap">
<section class="cosmopet-x">
<div class="container">
<h1 class="cosmopet-x__title">{{ post.meta('cosmopet_x_blocktitle') }}</h1>
<h2 class="cosmopet-x__title">{{ post.meta('cosmopet_x_blocktitle') }}</h2>
<div class="cosmopet-x__swiper">
<div class="swiper-wrapper">
{% for slide in post.meta('cosmopet_x_slider') %}
@ -577,7 +578,7 @@
<div class="container">
<div class="blog_block">
<div class="blog_top">
<h1 class="blog_title">{{ function('pll_e', 'Наш блог') }}</h1>
<h2 class="blog_title">{{ function('pll_e', 'Наш блог') }}</h2>
</div>
<div class="blog__row">
<p class="blog_text">{{ function('pll_e', 'Новости рынка кормов и экологии, полезные статьи о здоровье домашних животных') }}</p>

@ -17,27 +17,27 @@
class="header-pc-menu__title">{% if current_lang == 'ru' %}Кошкам{% elseif current_lang == 'en' %}For cats{% endif %}</a>
<ul class="header-pc-menu__list">
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Корм{% elseif current_lang == 'en' %}Food{% endif %}</a>
<a href="/product-category/cat-food/">{% if current_lang == 'ru' %}Корм{% elseif current_lang == 'en' %}Food{% endif %}</a>
</li>
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Лакомства{% elseif current_lang == 'en' %}Treats{% endif %}</a>
<a href="/product-category/lakomstva-dlya-koshek/">{% if current_lang == 'ru' %}Лакомства{% elseif current_lang == 'en' %}Treats{% endif %}</a>
</li>
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %}</a>
<a href="/product-category/aksessuary/">{% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %}</a>
</li>
</ul>
</div>
<div class="header-pc-menu__item">
<a href="#" class="header-pc-menu__title">{% if current_lang == 'ru' %}Собакам{% elseif current_lang == 'en' %}For dogs{% endif %}</a>
<a href="/shop/" class="header-pc-menu__title">{% if current_lang == 'ru' %}Собакам{% elseif current_lang == 'en' %}For dogs{% endif %}</a>
<ul class="header-pc-menu__list">
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Корм{% elseif current_lang == 'en' %}Food{% endif %}</a>
<a href="/product-category/dog-food/">{% if current_lang == 'ru' %}Корм{% elseif current_lang == 'en' %}Food{% endif %}</a>
</li>
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Лакомства{% elseif current_lang == 'en' %}Treats{% endif %}</a>
<a href="/product-category/lakomstva-dlya-sobak/">{% if current_lang == 'ru' %}Лакомства{% elseif current_lang == 'en' %}Treats{% endif %}</a>
</li>
<li class="header-pc-menu__list-li">
<a href="/shop/">{% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %}</a>
<a href="/product-category/aksessuary/">{% if current_lang == 'ru' %}Аксессуары{% elseif current_lang == 'en' %}Accessories{% endif %}</a>
</li>
</ul>
</div>
@ -60,30 +60,30 @@
class="header-phone-menu__category">Кошкам</a>
<ul class="header-phone-menu__list">
<li class="header-phone-menu__list-item">
<a href="/shop/">Корм</a>
<a href="/product-category/cat-food/">Корм</a>
</li>
<li class="header-phone-menu__list-item">
<a
href="/shop/">Лакомства</a>
href="/product-category/lakomstva-dlya-koshek/">Лакомства</a>
</li>
<li class="header-phone-menu__list-item">
<a
href="/shop/">Аксессуары</a>
href="/product-category/aksessuary/">Аксессуары</a>
</li>
</ul>
<a href="/shop/"
class="header-phone-menu__category">Собакам</a>
<ul class="header-phone-menu__list">
<li class="header-phone-menu__list-item">
<a href="/shop/">Корм</a>
<a href="/product-category/dog-food/">Корм</a>
</li>
<li class="header-phone-menu__list-item">
<a
href="/shop/">Лакомства</a>
href="/product-category/lakomstva-dlya-sobak/">Лакомства</a>
</li>
<li class="header-phone-menu__list-item">
<a
href="/shop/">Аксессуары</a>
href="/product-category/aksessuary/">Аксессуары</a>
</li>
</ul>
</div>
@ -96,26 +96,26 @@
cats</a>
<ul class="header-phone-menu__list">
<li class="header-phone-menu__list-item">
<a href="/shop/">Food</a>
<a href="/product-category/cat-food/">Food</a>
</li>
<li class="header-phone-menu__list-item">
<a href="/shop/">Treats</a>
<a href="/product-category/lakomstva-dlya-koshek/">Treats</a>
</li>
<li class="header-phone-menu__list-item">
<a href="/shop/">Accessory</a>
<a href="/product-category/aksessuary/">Accessory</a>
</li>
</ul>
<a href="/shop/" class="header-phone-menu__category">For
dogs</a>
<ul class="header-phone-menu__list">
<li class="header-phone-menu__list-item">
<a href="/shop/">Food</a>
<a href="/product-category/dog-food/">Food</a>
</li>
<li class="header-phone-menu__list-item">
<a href="/shop/">Treats</a>
<a href="/product-category/lakomstva-dlya-sobak/">Treats</a>
</li>
<li class="header-phone-menu__list-item">
<a href="/shop/">Accessory</a>
<a href="/product-category/aksessuary/">Accessory</a>
</li>
</ul>
</div>
@ -236,6 +236,19 @@
</div>
</button>
</div>
<div class="mini-profile__item">
{% if fn('is_user_logged_in') %}
<a href="{{ fn('wc_get_page_permalink', 'myaccount') }}" class="mini-profile__button">
<img src="https://cosmopet.shop/wp-content/themes/woodmart/gp-include/assets/core/img/svg/mini-profile/profile.svg" alt="" class="mini-profile__icon black">
<img src="https://cosmopet.shop/wp-content/themes/woodmart/gp-include/assets/core/img/svg/mini-profile/profile-w.svg" alt="" class="mini-profile__icon white">
</a>
{% else %}
<button class="mini-profile__button login-open">
<img src="https://cosmopet.shop/wp-content/themes/woodmart/gp-include/assets/core/img/svg/mini-profile/profile.svg" alt="" class="mini-profile__icon black">
<img src="https://cosmopet.shop/wp-content/themes/woodmart/gp-include/assets/core/img/svg/mini-profile/profile-w.svg" alt="" class="mini-profile__icon white">
</button>
{% endif %}
</div>
</div>
</header>

@ -7,6 +7,50 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Top.Mail.Ru counter -->
<script type="text/javascript">
var _tmr = window._tmr || (window._tmr = []);
_tmr.push({id: "3569464", type: "pageView", start: (new Date()).getTime()});
(function (d, w, id) {
if (d.getElementById(id)) return;
var ts = d.createElement("script"); ts.type = "text/javascript"; ts.async = true; ts.id = id;
ts.src = "https://top-fwz1.mail.ru/js/code.js";
var f = function () {var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ts, s);};
if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); }
})(document, window, "tmr-code");
</script>
<noscript><div><img src="https://top-fwz1.mail.ru/counter?id=3569464;js=na" style="position:absolute;left:-9999px;" alt="Top.Mail.Ru" /></div></noscript>
<!-- /Top.Mail.Ru counter -->
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(96481053, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
ecommerce:"dataLayer"
});
window.dataLayer = window.dataLayer || [];
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/96481053" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<meta name="yandex-verification" content="2109bb636b61b248" />
<script>
(function(w,d,u){
var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/60000|0);
var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'https://cdn-ru.bitrix24.ru/b33297602/crm/tag/call.tracker.js');
</script>
</head>
<body class="{{bodyClass}}">

@ -62,5 +62,7 @@
</div>
</div>
{% include 'modal/login.twig' %}
</aside>
</div>

@ -1,5 +1,6 @@
{% set bodyClass = 'bg-white' %}
{% set mainClass = 'wrapper' %}
{% extends 'layout.twig' %}
{% block content %}

@ -0,0 +1,81 @@
<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="{{ function('get_template_directory_uri') }}/static/img/pet/mini-{{ function('get_field', 'type', pet_id) }}.png" alt="">
</div>
</div>
<p class="cabinet-card-pet__name">{{ function('get_the_title', pet_id) }}</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Breed') }}:</p>
<p class="cabinet-card__text">{{ function('get_field', 'breed', pet_id) }}</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Weight') }}:</p>
<p class="cabinet-card__text">
{% set weight_key = function('get_field', 'weight', pet_id) %}
{% if weight_key == 'below_1_5' %}{{ pll_e('from 0,5 kg to 1,5 kg') }}
{% elseif weight_key == '1_5-3' %}{{ pll_e('from 1.5 to 3 kg') }}
{% elseif weight_key == '3-5' %}{{ pll_e('from 3 to 5 kg') }}
{% elseif weight_key == '5-8' %}{{ pll_e('from 5 to 8 kg') }}
{% elseif weight_key == '8-11' %}{{ pll_e('from 8 to 11 kg') }}
{% elseif weight_key == '11-15' %}{{ pll_e('from 11 to 15 kg') }}
{% elseif weight_key == '15-20' %}{{ pll_e('from 15 to 20 kg') }}
{% elseif weight_key == '20-25' %}{{ pll_e('from 20 to 25 kg') }}
{% elseif weight_key == '25-35' %}{{ pll_e('from 25 to 35 kg') }}
{% elseif weight_key == 'more_35' %}{{ pll_e('More than 35 kg') }}
{% endif %}
</p>
</div>
{% if function('get_field', 'old', pet_id) %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Age') }}:</p>
<p class="cabinet-card__text">
{% set age_key = function('get_field', 'old', pet_id) %}
{% if age_key == 'normal' %}{{ pll_e('Adult (from 1 year to 7 years)') }}
{% elseif age_key == 'old' %}{{ pll_e('Elderly (from 7 to 12 years)') }}
{% elseif age_key == 'very_old' %}{{ pll_e('Aging (12 years and older)') }}
{% elseif age_key == 'baby' %}{{ pll_e('Baby (from 0 to 1 year)') }}
{% endif %}
</p>
</div>
{% else %}
{% set month = function('get_field', 'month', pet_id) %}
{% set zero = month < 10 ? '0' : '' %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Birthday') }}:</p>
<p class="cabinet-card__text">
{{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }}
</p>
</div>
{% endif %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Activity') }}:</p>
<p class="cabinet-card__text">
{% set activity_key = function('get_field', 'activity', pet_id) %}
{% if activity_key == 'low' %}{{ pll_e('Low') }}
{% elseif activity_key == 'moderate' %}{{ pll_e('Moderate') }}
{% elseif activity_key == 'high' %}{{ pll_e('High') }}
{% endif %}
</p>
</div>
{% if function('get_field', 'type', pet_id) == 'cat' and function('get_field', 'sterilized', pet_id) %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Sterilized') }}</p>
</div>
{% endif %}
<div class="cabinet-card__element">
<button class="cabinet-card__button" data-edit="{{ pet_id }}">
{{ pll_e('Edit') }}
</button>
</div>
</div>
</div>

@ -8,7 +8,7 @@
<div class="container">
<div class="seller_block">
<div class="sellers_top">
<h1 class="sellers_title">{{ function('pll_e', 'BESTSELLERS') }}</h1>
<h2 class="sellers_title">{{ function('pll_e', 'BESTSELLERS') }}</h2>
<div class="slider-arrows">
<button class="slider-arrow slider-arrow-prev sellerSlider-prev" aria-label="{{ function('pll_e', 'Previous products') }}"></button>
<button class="slider-arrow slider-arrow-next sellerSlider-next" aria-label="{{ function('pll_e', 'Next products') }}"></button>
@ -26,7 +26,7 @@
{% set product = function('wc_get_product', product_id) %}
{% if product %}
{% set thumbnail = product.get_image_id() ? function('wp_get_attachment_image_url', product.get_image_id(), 'medium') : function('wc_placeholder_img_src') %}
{% set price = product.get_price_html() %}
{% set price = product.get_price() ~ ' ' ~ fn('get_woocommerce_currency_symbol') %}
{% set has_sale = product.is_on_sale() %}
{% set regular_price = product.get_regular_price() %}
{% set sale_price = product.get_sale_price() %}
@ -50,16 +50,6 @@
{{ price|raw }}
</div>
{% if has_sale and regular_price and sale_price %}
<div class="product-item__price-disc">
<p class="product-item__price-sale__text">
{{ regular_price }} {{ currency }}
</p>
<p class="product-item__price-sale__perc">
-{{ (1 - (sale_price / regular_price)) * 100|round }}%
</p>
</div>
{% endif %}
</div>
<a href="{{ product.get_permalink() }}" class="seller_link">

@ -1,5 +1,5 @@
{% if cart.is_empty %}
<p class="cart-empty">{{ function('pll_e', 'Ваша корзина пуста') }}</p>
<p class="cart-empty">{{ function('pll_e', 'Your cart is empty') }}</p>
{% else %}
{% for item_key, item in cart.get_cart %}
{% set product = item.data %}

@ -1,23 +1,23 @@
<table class="shop_table woocommerce-checkout-review-order-table">
<tfoot>
<tr class="order-your-calculation__item">
<th class="order-your-calculation__title">{{ pll_e('Товары') }}</th>
<th class="order-your-calculation__title">{{ fn('pll_e', 'Товары') }}</th>
<td class="order-your-calculation__value order-your-calculation__value--price">{{ fn('wc_cart_totals_subtotal_html') }}</td>
</tr>
{% for code, coupon in fn('WC').cart.get_coupons() %}
<tr class="order-your-calculation__item cart-discount coupon-{{ code|sanitize_title|e('html_attr') }}">
<tr class="order-your-calculation__item cart-discount coupon-{{ code }}">
<th class="order-your-calculation__title">{{ fn('wc_cart_totals_coupon_label', coupon) }}</th>
<td class="order-your-calculation__value order-your-calculation__value--price order-your-calculation__value--discount">{{ fn('wc_cart_totals_coupon_html', coupon) }}</td>
</tr>
{% endfor %}
{% if fn('WC').cart.needs_shipping() and fn('WC').cart.show_shipping() %}
{{ do_action('woocommerce_review_order_before_shipping') }}
{{ action('woocommerce_review_order_before_shipping') }}
{{ fn('wc_cart_totals_shipping_html') }}
{{ do_action('woocommerce_review_order_after_shipping') }}
{{ action('woocommerce_review_order_after_shipping') }}
{% endif %}
<tr class="order-your-calculation__item">
@ -40,7 +40,7 @@
{% if fn('wc_tax_enabled') and not fn('WC').cart.display_prices_including_tax() %}
{% if 'itemized' == fn('get_option', 'woocommerce_tax_total_display') %}
{% for code, tax in fn('WC').cart.get_tax_totals() %}
<tr class="tax-rate tax-rate-{{ code|sanitize_title|e('html_attr') }}">
<tr class="tax-rate tax-rate-{{ code }}">
<th>{{ tax.label|e }}</th>
<td>{{ tax.formatted_amount|raw }}</td>
</tr>
@ -53,7 +53,7 @@
{% endif %}
{% endif %}
{{ do_action('woocommerce_review_order_before_order_total') }}
{{ action('woocommerce_review_order_before_order_total') }}
<tr class="order-your-calculation__line"></tr>
<tr class="order-your-calculation__item">
@ -61,6 +61,6 @@
<td class="order-your-calculation__result order-your-calculation__value--price">{{ fn('wc_cart_totals_order_total_html') }}</td>
</tr>
{{ do_action('woocommerce_review_order_after_order_total') }}
{{ action('woocommerce_review_order_after_order_total') }}
</tfoot>
</table>

@ -18,17 +18,21 @@
{% endif %}
</div>
<div class="product">
<div class="product__header">
<p class="product__title">
<h1 class="product__title">
{% if category %}
{{ category.name }}
{% else %}
{{ function('pll_e', 'Продукция') }}
{% endif %}
</p>
</h1>
<div class="active-filters" style="display: none;">
<div class="active-filters__list"></div>
<button class="active-filters__clear button button--white" style="display: none;">
{{ function('pll_e', 'Очистить все') }}
</button>
</div>
<button class="button button--gradient button--high button--icon button--filter">
{{ function('pll_e', 'Фильтры') }}
</button>

Loading…
Cancel
Save