parent
a6b8b68eff
commit
2d3a7878c3
@ -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
@ -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() |
||||
// ]); |
||||
// } |
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@ |
||||
<?php |
||||
|
||||
include_module('blog'); |
||||
include_component('blog', 'archive'); |
||||
|
||||
|
@ -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');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@ -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 %} |
@ -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> |
Loading…
Reference in new issue