Compare commits

..

14 Commits

Author SHA1 Message Date
Andrei c74600377a Andrei | фикс каталога (поместил файлы single страницы в правильные директории удалил лишние файлы которые не использовались) 2 months ago
Andrei 39ef43e7fd Task 6807 | fix стилей (отступы сверху экрана) 2 months ago
Andrei 0866502381 Andrei | фикс каталога (пофиксил условие вывода плашки распродажа в карточке товара) 2 months ago
Andrei eb9c7b7b27 Andrei | фикс каталога (вывод плашки ВАЖНО только при заполненном плоке) 2 months ago
Andrei 076af73a9b Andrei | фикс каталога (вывод акционной цены и скидки при ее наличии на странице товара) 2 months ago
Andrei 8180ba14cf Andrei | фикс каталога (правки в выводе рекоммендуемых товаров, кнопка узнать о наличии на странице товара при его отсутствии) 2 months ago
Andrei 272909cf61 Andrei | фикс каталога (вывод акционной цены в карточке товара) 2 months ago
Andrei ad9ed0fb00 Andrei | фикс каталога (работа формы сообщить о наличии товара в каталоге) 2 months ago
Andrei fdab7e2422 Andrei | фикс каталога (добавил вывод других тегов в карточку товара ранее выводился только вкус) 2 months ago
Andrei 3176223154 Andrei | conflict fix 2 months ago
Andrei 3f0fc9e260 Andrei | правки в каталоге - настроил ошибки и их вывод при добавлении в корзину товара сверх остатков 2 months ago
Andrei fc73740773 Andrei | вывод кнопки узнать о поступлении в карточке товара 2 months ago
Andrei 62cced0e1a Andrei | fix исправил вывод плашек фильтра (не выводились и не удалялись если выбрано более одного значения в фильтре) 2 months ago
Andrei fb9a459246 Andrei | fix поправил футер на странице каталога (удалил лишние стили + перенес необходимые стили из fron-page.css в модуль) 2 months ago
  1. 4
      .gitignore
  2. BIN
      .tmb/l1_d3AtY29udGVudC90aGVtZXMvY29zbW9wZXQtdGltYmVyL3NjcmVlbnNob3QucG5n1744272629.png
  3. 1
      .well-known/apple-developer-merchantid-domain-association
  4. 8147
      afc_fields.json
  5. 14
      robots.txt
  6. 9
      wp-content/ai1wm-backups/.htaccess
  7. 1
      wp-content/ai1wm-backups/index.html
  8. 1
      wp-content/ai1wm-backups/index.php
  9. 3
      wp-content/ai1wm-backups/robots.txt
  10. 13
      wp-content/ai1wm-backups/web.config
  11. 2
      wp-content/themes/cosmopet/404.php
  12. 49
      wp-content/themes/cosmopet/assets/modules/shop/css/cart-loading.css
  13. 746
      wp-content/themes/cosmopet/assets/modules/shop/css/checkout.css
  14. 515
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-core.css
  15. 901
      wp-content/themes/cosmopet/assets/modules/shop/css/product-style.css
  16. 219
      wp-content/themes/cosmopet/comments.php
  17. 21
      wp-content/themes/cosmopet/functions.php
  18. 262
      wp-content/themes/cosmopet/global-functions/core-functions.php
  19. 11
      wp-content/themes/cosmopet/global-functions/global-constaints.php
  20. 380
      wp-content/themes/cosmopet/global-functions/metrics-functions.php
  21. 358
      wp-content/themes/cosmopet/global-functions/multilang-functions.php
  22. 303
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  23. 16
      wp-content/themes/cosmopet/global-functions/plugin-override-functions.php
  24. 25
      wp-content/themes/cosmopet/global-functions/post-types-functions.php
  25. 31
      wp-content/themes/cosmopet/global-functions/redirect-functions.php
  26. 18
      wp-content/themes/cosmopet/global-functions/seo-functions.php
  27. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png
  28. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png.webp
  29. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png
  30. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png.webp
  31. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png
  32. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png.webp
  33. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png
  34. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png.webp
  35. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png
  36. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png.webp
  37. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png
  38. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png.webp
  39. 11
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
  40. 50
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-mobile.css
  41. 12
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-tablet.css
  42. 8
      wp-content/themes/cosmopet/modules/blog/components/archive/component-controller.php
  43. 1
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/css/style.css
  44. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card-mb.png
  45. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card-mb.png.webp
  46. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card.png
  47. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/author-card.png.webp
  48. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-1.png
  49. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-1.png.webp
  50. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-2.png
  51. BIN
      wp-content/themes/cosmopet/modules/blog/components/author-banner/assets/img/star-2.png.webp
  52. 53
      wp-content/themes/cosmopet/modules/blog/components/comments/component-controller.php
  53. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg-sm.png
  54. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg-sm.png.webp
  55. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg.png
  56. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/discount-bg.png.webp
  57. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-card.png
  58. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-card.png.webp
  59. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-icon.png
  60. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-icon.png.webp
  61. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-star.png
  62. BIN
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/editorial-head-star.png.webp
  63. 6
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-desktop.css
  64. 23
      wp-content/themes/cosmopet/modules/blog/components/main-page-block/assets/js/main-page-blog.js
  65. 25
      wp-content/themes/cosmopet/modules/blog/components/main-page-block/component-controller.php
  66. 38
      wp-content/themes/cosmopet/modules/blog/components/most-read/component-controller.php
  67. 28
      wp-content/themes/cosmopet/modules/blog/components/most-read/component-template.twig
  68. 19
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-desktop.css
  69. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/assets/img/preview.png
  70. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/assets/img/preview.png.webp
  71. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/preview.png
  72. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/preview.png.webp
  73. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/preview.png
  74. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/preview.png.webp
  75. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/assets/img/preview.png
  76. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/assets/img/preview.png.webp
  77. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/assets/img/preview.png
  78. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/assets/img/preview.png.webp
  79. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/assets/img/preview.png
  80. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/assets/img/preview.png.webp
  81. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/assets/img/preview.png
  82. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/assets/img/preview.png.webp
  83. 7
      wp-content/themes/cosmopet/modules/blog/editor-blocks/notice/assets/css/style.css
  84. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/notice/assets/img/preview.png
  85. 48
      wp-content/themes/cosmopet/modules/blog/editor-blocks/notice/editor-block-controller.php
  86. 4
      wp-content/themes/cosmopet/modules/blog/editor-blocks/notice/editor-block-template.twig
  87. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/img/preview.png
  88. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/img/preview.png.webp
  89. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/assets/img/preview.png
  90. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/assets/img/preview.png.webp
  91. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/assets/img/preview.png
  92. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/assets/img/preview.png.webp
  93. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/assets/img/preview.png
  94. BIN
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/assets/img/preview.png.webp
  95. 53
      wp-content/themes/cosmopet/modules/blog/module-ajax-controller.php
  96. 8
      wp-content/themes/cosmopet/modules/blog/module-controller.php
  97. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg-sm.png
  98. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg-sm.png.webp
  99. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg.png
  100. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg.png.webp
  101. Some files were not shown because too many files have changed in this diff Show More

4
.gitignore vendored

@ -3,7 +3,7 @@
# GP | SEO
sitemap*.xml
robots.txt
!robots.txt
yandex_*.html
google_*.html
yandex_turbo.xml
@ -71,7 +71,6 @@ wp-content/plugins/*
*.tbk
*.csv
*.json
!afc_fields.json
*.BAK
# GP | Dirs & files
@ -85,7 +84,6 @@ timthumb_cache/
webstat/
.idea/
.tmb/
.well-known/
.csscomb.json
sftp-config.json
bower.json

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -15,7 +15,12 @@ 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: /?
@ -46,7 +51,12 @@ 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: /?
@ -71,7 +81,11 @@ 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

@ -0,0 +1,9 @@
<IfModule mod_mime.c>
AddType application/octet-stream .wpress
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>

@ -0,0 +1 @@
Kangaroos cannot jump here

@ -0,0 +1 @@
Kangaroos cannot jump here

@ -0,0 +1,3 @@
User-agent: *
Disallow: /ai1wm-backups/
Disallow: /wp-content/ai1wm-backups/

@ -0,0 +1,13 @@
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".wpress" mimeType="application/octet-stream" />
</staticContent>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>

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

@ -1,49 +0,0 @@
/* Стили для загрузки корзины на single странице */
.product-incart__wrap.loading {
position: relative;
pointer-events: none;
opacity: 0.7;
}
.product-incart__wrap.loading::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.8);
z-index: 10;
}
.product-incart__wrap.loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin: -10px 0 0 -10px;
border: 2px solid #f3f3f3;
border-top: 2px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
z-index: 11;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Стили для кнопок во время загрузки */
.product-incart__wrap.loading .product-incart__btn {
opacity: 0.5;
pointer-events: none;
}
/* Стили для счетчика во время загрузки */
.product-incart__wrap.loading .product-incart__count {
opacity: 0.5;
}

@ -1,746 +0,0 @@
.order{
display: flex;
}
.order__title{
font-family: var(--font-family);
font-weight: 700;
font-size: 24px;
line-height: 117%;
text-transform: uppercase;
color: var(--text-black);
}
.order__contacts{
width: calc(50% - 0.5px);
padding: 24px;
border-right: 1px solid #121212;
}
.order-contacts__header{
display: flex;
justify-content: space-between;
align-items: center;
}
.order-contacts__form{
margin-top: 24px;
}
.order-contacts__delivery{
margin-top: 47.5px;
padding-top: 48px;
border-top: 1px solid var(--background-grey);
}
.order-contacts-deliver__item{
margin-top: 24px;
}
.order-contacts-deliver__date{
padding: 8px;
border-radius: 24px;
background: var(--background-grey);
}
.order-contacts-deliver__date .form-input-radio__item{
margin-top: 24px;
}
.order-contacts-deliver__date .form-input-radio__item:first-child{
margin-top: 0;
}
.order__your{
width: calc(50% - 0.5px);
padding: 24px 24px 24px 48px;
background: var(--background-grey);
}
.order-your__products{
margin-top: 48px;
}
.order-your-products__item{
margin-top: 16px;
display: flex;
justify-content: space-between;
}
.order-your-products__left{
display: flex;
align-items: center;
}
.order-your-products__img{
width: 40px;
aspect-ratio: 1;
border-radius: 16px;
}
.order-your-products__content{
margin-left: 16px;
}
.order-your-products__name{
font-family: var(--font-family);
font-weight: 500;
font-size: 12px;
line-height: 133%;
color: var(--text-black);
text-decoration: none;
}
.order-your-products__description{
margin-top: 8px;
font-family: var(--font-family);
font-weight: 500;
font-size: 12px;
line-height: 133%;
color: var(--text-6);
}
.order-your-products__description span{
font-weight: 700;
}
.order-your-products__description span::before{
margin-left: 3px;
content: 'x ';
}
.order-your-products__right{
display: flex;
}
.order-your-products__count{
font-family: var(--font-family);
font-weight: 700;
font-size: 12px;
line-height: 133%;
text-align: right;
color: var(--text-6);
}
.order-your-products__count::before{
content: 'x';
}
.order-your-products__price{
margin-left: 16px;
font-family: var(--font-family);
font-weight: 700;
font-size: 12px;
line-height: 133%;
text-align: right;
color: var(--text-black);
}
.order-your__calculation{
margin-top: 48px;
}
.order-your__promo{
display: flex;
}
.order-your-promo__button{
margin-left: 8px;
}
.order-your-calculation__item{
margin-top: 24px;
display: flex;
justify-content: space-between;
align-items: center;
}
.order-your-calculation__title{
font-family: var(--font-family);
font-weight: 500;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
.order-your-calculation__value{
font-family: var(--font-family);
font-weight: 700;
font-size: 20px;
line-height: 200%;
text-transform: uppercase;
text-align: right;
color: var(--text-black);
}
.order-your-calculation__value--discount{
background: var(--gradient-red);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.order-your-calculation__description{
font-family: var(--font-family);
font-weight: 500;
font-size: 12px;
line-height: 133%;
text-align: right;
color: var(--text-9);
}
.order-your-calculation__line{
margin-top: 23px;
border: 1px solid var(--background-9);
}
.order-your-calculation__result{
font-family: var(--font-family);
font-weight: 700;
font-size: 24px;
line-height: 117%;
text-transform: uppercase;
color: var(--text-black);
}
.order-your-calculation__submit{
margin-top: 48px;
}
@media only screen and (max-width: 1200px) {
.order{
display: block;
}
.order__contacts, .order__your{
border: none;
width: 100%;
}
}
@media only screen and (max-width: 720px) {
.order__title{
max-width: 181px;
font-size: 20px;
line-height: 120%;
}
.order__your{
margin-top: 16px;
}
.order__contacts{
padding: 24px 16px;
}
.order__your{
padding: 40px 16px 9px 16px;
}
.order-your__promo{
display: block;
}
.order-your-promo__button{
margin-left: 0;
margin-top: 24px;
width: 100%;
}
.order-your-products__content{
max-width: 164px;
}
.order-your-products__count, .order-your-products__price{
flex-shrink: 0;
}
}
/* 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 */
@media (max-width: 720px) {
.modal-map__control{
flex-wrap: wrap;
}
.modal-map-control__item{
width: calc(100% - 24px);
}
.form__full-mobile{
width: 100%;
border-radius: 0;
border: none;
}
}
.container{
max-width: 100% !important;
padding: 0;
}
.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-20_0, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-20_0, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-20_0, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto{
padding: 0;
}
.page-title{
display: none;
}
.modal-map-control-item__input{
display: none;
}
.page .main-page-wrapper{
background: #fff !important;
}
.modal-map-control-item__content{
width: 100%;
}
.woocommerce-shipping-methods{
display: flex;
}
.visually-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px);
clip: rect(1px, 1px, 1px, 1px);
padding: 0 !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
.modal-map-control__item{
display: flex;
flex-direction: column;
}
.modal-map-control__item > label {
flex-grow: 1;
display: flex;
flex-direction: column;
position: relative;
}
.modal-map-control__item > label > *{
flex-grow: 1;
}
.modal-map-control__item:nth-child(n){
margin: 12px;
margin-bottom: 12px;
}
.modal-map-control-item__title{
text-align: left;
}
.modal-map-control__item > label{
margin-bottom: 0;
}
.open-pvz-btn{
position: absolute !important;
clip: rect(1px 1px 1px 1px);
clip: rect(1px, 1px, 1px, 1px);
padding: 0 !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
.order-contacts__delivery.loading{
position: relative;
min-height: 110px;
}
.order-contacts__delivery.loading::before{
content: '';
z-index: 150;
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(255,255,255, .6);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' width='200' height='200' style='shape-rendering: auto; display: block; background: transparent;'%3E%3Cg%3E%3Ccircle stroke-dasharray='164.93361431346415 56.97787143782138' r='35' stroke-width='10' stroke='%23000000' fill='none' cy='50' cx='50'%3E%3CanimateTransform keyTimes='0;1' values='0 50 50;360 50 50' dur='1s' repeatCount='indefinite' type='rotate' attributeName='transform'/%3E%3C/circle%3E%3Cg/%3E%3C/g%3E%3C!-- %5Bldio%5D generated by https://loading.io --%3E%3C/svg%3E");
background-size: 48px;
background-position: center;
background-repeat: no-repeat;
}
.shop_table .woocommerce-shipping-totals{
display:none;
}
.amount{
color: inherit;
}
.order-your-products__item{
align-items: center;
}
.wc_payment_methods.payment_methods.methods{
display: none;
}
.woocommerce-terms-and-conditions-wrapper{
}
.woocommerce-privacy-policy-text p{
color: #121212 !important;
font-size: 14px;
}
.woocommerce-privacy-policy-text a{
color: #121212 !important;
font-size: 14px;
text-decoration: underline;
}
.woocommerce-terms-and-conditions-checkbox-text a{
color: #121212 !important;
font-size: 14px;
text-decoration: underline;
}
.woocommerce-checkout.processing {
position: relative;
opacity: 0.5;
pointer-events: none;
}
.woocommerce-checkout .blockUI.blockOverlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(242, 242, 242, 0.7) !important;
z-index: 9999;
}
.woocommerce-checkout .blockUI-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 10000;
font-size: 16px;
color: #333;
}
.cabinet-card__button{
padding: 8px 8px 6px 0;
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
background: none;
border: none;
position: relative;
text-decoration: none;
}
.cabinet-card__button::before{
content: '';
position: absolute;
bottom: 6px;
width: calc(100% - 8px);
height: 1px;
background: var(--text-black);
transition: opacity .2s ease-out;
}
.cabinet-card__button:hover{
opacity: .8;
}
.form-agreement{
display: flex;
}
.form-agreement__check{
display: flex;
align-items: center;
margin-top: 1rem;
}
.form-agreement__square{
width: 18px;
aspect-ratio: 1;
border-radius: 4px;
border: 2px solid var(--background-black);
}
.form-agreement__label{
margin-left: 8px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
}
.form-agreement__input{
display: none;
}
.form-agreement__input:checked + .form-agreement__square{
border: none;
background: var(--gradient-blue);
position: relative;
}
.form-agreement__input:checked + .form-agreement__square::after{
content: '';
position: absolute;
top: 1px;
left: 1px;
width: 16px;
aspect-ratio: 1;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.50681 0.784901C9.86151 1.14024 9.86101 1.71584 9.50567 2.07055L4.35112 7.216C3.99601 7.57049 3.42085 7.57024 3.06604 7.21544L0.493317 4.64271C0.138295 4.28769 0.138295 3.71208 0.493317 3.35706C0.848339 3.00204 1.42394 3.00204 1.77897 3.35706L3.70944 5.28753L8.22116 0.783766C8.57649 0.429057 9.1521 0.429565 9.50681 0.784901Z' fill='white'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
}
.modal-map__control--delivery > p{
color: #121212;
padding-left: 1rem;
}
.form-agreement__label a{
color: #121212;
text-decoration: underline;
}
.form-input__error.active{
display: block;
}
.order-your__promo{
position: relative;
}
.woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout{
display: none;
}
.woocommerce-terms-and-conditions-wrapper, .woocommerce-message{
display: none;
}
.woocommerce-checkout-review-order-table tr{
border: none !important;
}
.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-20_0, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-20_0, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-20_0, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
padding-right: 0 !important;
padding-left: 0 !important;
}
.cdek-office-info{
display: none;
}
.quantity-control {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.quantity-decrease, .quantity-increase {
background: #f0f0f0;
border: none;
padding: 5px 10px;
cursor: pointer;
font-size: 16px;
border-radius: 4px;
}
.quantity-decrease:hover, .quantity-increase:hover {
background: #e0e0e0;
}
.quantity-input {
width: 50px;
text-align: center;
border: 1px solid #ccc;
border-radius: 4px;
padding: 5px;
}
.form-row{
margin-top: 1rem;
}
.woocommerce-order-overview{
}
.woocommerce .woocommerce-customer-details .woocommerce-column__title, .woocommerce-order-details__title{
margin-bottom: .5em;
margin-top: 1em;
}
.woocommerce ul.order_details{
margin: 3rem 0;
}
.woocommerce .woocommerce-customer-details address p{
margin-top: .5em;
}
.woocommerce .woocommerce-customer-details .woocommerce-customer-details--email::before,
.woocommerce .woocommerce-customer-details .woocommerce-customer-details--phone::before {
margin-top: -.25em;
}
.woocommerce-order-overview__order.order{
display: flex;
flex-direction: column;
}
.woocommerce-order{
max-width: calc(100% - 30px);
margin-right: auto;
margin-left: auto;
}
@media (max-width: 640px) {
.woocommerce ul.order_details li {
margin-right:0em;
font-size: .715em;
line-height: 1.3;
border-right: none;
border-bottom: 1px dashed #cfc8d8;
padding-right: 2em;
width: 100%;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
}

@ -1,515 +0,0 @@
/* breadcrumbs */
.breadcrumbs{
margin: 24px;
display: flex;
align-items: center;
}
.breadcrumbs__item{
display: block;
padding: 0px 16px;
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: var(--text-6);
text-decoration: none;
position: relative;
}
.breadcrumbs__item:first-child{
padding-left: 0;
}
.breadcrumbs__item:nth-child(n+2)::before{
content: '';
position: absolute;
top: -2px;
left: -12px;
width: 24px;
aspect-ratio: 1;
background-image: url(../img/svg/main/arrow-breadcrumbs.svg);
background-repeat: no-repeat;
background-size: contain;
}
/* breadcrumbs */
/* compound */
.compound{
margin: -5px;
min-height: 33.95px;
display: flex;
align-items: start;
flex-wrap: wrap;
}
.compound__item{
margin: 5px;
padding: 4px 8px;
font-family: var(--font-family);
font-weight: 700;
font-size: 12px;
line-height: 133%;
color: var(--text-black);
border-radius: 16px;
background-color: var(--background-white);
display: block;
text-decoration: none;
}
.compound__item:first-child{
margin-left: 0;
}
.product__footer{
margin: 48px 24px 24px;
display: flex;
justify-content: center;
}
.product__footer--error{
margin: 45px 0;
}
/* compound */
/* button */
.button{
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-black);
border-radius: 20px;
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 24px 24px;
font-weight: 700;
text-align: center;
position: relative;
}
.button--high-46{
padding: 12px 24px;
font-size: 20px;
font-weight: 700;
line-height: 24px;
}
.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%; */
border: none;
transition: opacity .2s ease-out;
text-decoration: none;
text-transform: uppercase;
}
.product__item .to-know{
margin-right: auto;
margin-left: auto;
width: auto;
display: flex;
}
.to-know--start{
justify-content: start;
padding-left: 0;
}
.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;
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
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 */
.subscription{
}
.subscription__item{
display: flex;
color: var(--text-black);
font-family: var(--font-family);
font-weight: 500;
line-height: 120%;
}
.subscription__item:nth-last-child(n + 2){
border-bottom: 1px solid var(--background-9);
}
.subscription__item span{
font-weight: 700;
}
.subscription__item span small{
font-size: 16px;
}
.subscription__status{
color: var(--text-black);
}
.subscription__status--close{
color: var(--text-red);
}
.subscription__status--end{
color: var(--text-green);
}
.subscription__add{
width: 100%;
}
.subscription__add-header{
}
.subscription__add-product{
align-items: start;
}
.subscription__add-product > *:not(:first-child){
padding-top: 14px;
}
.subscription__add-title{
font-family: var(--font-family);
font-weight: 600;
line-height: 133%;
}
.subscription__add-content{
}
.tabs__buttons{
margin: -12px;
display: flex;
flex-wrap: wrap;
}
.tabs__content-wrap{
margin-top: 24px;
}
.tabs__content{
display: none;
}
.tabs__content.active{
display: block;
}
.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 0;
width: 345.89px;
max-width: 100%;
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;
}
@media (max-width: 640px) {
.subscription-option-details, .wcsatt-options-prompt-action, .subs-text-title{
font-size: 18px;
line-height: 22px;
display:flex;
gap: 12px;
align-items: center;
}
}
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;
flex-shrink: 0;
}
.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;
}
.detail-block-form__item--radio{
display: flex;
gap: 10px;
}
.amount {
color: #1A1A1A;
font-weight: 600;
}
.detail__wrapper-catalot .swiper-slide {
height: auto;
display: flex;
flex-direction: column;
}
.detail__wrapper-catalot .swiper-wrapper {
display: flex;
align-items: stretch;
}
.detail__catalot .product__item{
flex-grow: 1;
}
.toggle__title{
text-transform: uppercase;
}
.toggle__text p:not(:last-child) {
margin-bottom: 1em;
}

@ -1,901 +0,0 @@
/* breadcrumbs */
.breadcrumbs{
margin: 24px 0px;
display: flex;
align-items: center;
}
.breadcrumbs__item{
display: block;
padding: 0px 16px;
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: var(--text-6);
text-decoration: none;
position: relative;
}
.breadcrumbs__item:first-child{
padding-left: 0;
}
.breadcrumbs__item:nth-child(n+2)::before{
content: '';
position: absolute;
top: -2px;
left: -12px;
width: 24px;
aspect-ratio: 1;
background-image: url(../img/svg/main/arrow-breadcrumbs.svg);
background-repeat: no-repeat;
background-size: contain;
}
/* breadcrumbs */
/* product */
.product_main{
display: flex;
padding: 30px;
border-radius: 30px;
min-height: 766px;
margin-top: 30px;
justify-content: space-between;
background-color: var(--bg-color);
}
.product_main.--food-fish{
--bg-color: #C1DDE6;
--accent-color: #48c1ed;
}
.product_main.--food-lamb{
--bg-color: #E6D7C1;
--accent-color: #863300;
}
.product_main.--food-turkey{
--bg-color: #F3D7D2;
--accent-color: #CD0003;
}
.product_main.--food-beef{
--bg-color: #E6C1D7;
--accent-color: #7e0092;
}
.product_main.--food-salmon{
--bg-color: #F3D7C1;
--accent-color: #ff6b35;
}
.product_main.--food-rabbit{
--bg-color: #E6D7C1;
--accent-color: #8b4513;
}
.product_main.--food-duck{
--bg-color: #F3E6D7;
--accent-color: #d2691e;
}
.product_main.--treats-lamb{
--bg-color: #E6D7F3;
--accent-color: #44006c;
}
.product_main.--treats-rabbit{
--bg-color: #F3D7E6;
--accent-color: #601094;
}
.product_main.--treats-beef{
--bg-color: #D7F3E6;
--accent-color: #004c31;
}
.product_main.--treats-salmon{
--bg-color: #F3D7F3;
--accent-color: #7c007a;
}
.product_main.--treats-duck{
--bg-color: #D7F3F3;
--accent-color: #326e70;
}
.product_main.--treats-fish{
--bg-color: #D7E6F3;
--accent-color: #0066cc;
}
.product_main.--treats-turkey{
--bg-color: #F3E6D7;
--accent-color: #cc3300;
}
/* product info */
.product-info{
width: 364px;
flex-direction: column;
justify-content: space-between;
display: flex;
padding-right: 30px;
}
.product-title{
font-weight: 700;
font-size: 24px;
text-transform: uppercase;
color: #121212;
}
.product-contains{
margin-top: 30px;
}
.product-block-title{
font-weight: 700;
font-size: 20px;
line-height: 100%;
color: #121212;
text-transform: uppercase;
}
.product-contains-text{
font-weight: 400;
font-size: 14px;
line-height: 150%;
color: #121212;
margin-top: 20px;
}
.product-values{
margin-top: 30px;
}
.product-values-list{
display: flex;
flex-wrap: wrap;
margin-top: 10px;
gap: 4px;
}
.product-values-item{
border: 1px solid rgba(18, 18, 18, 0.1);
border-radius: 100px;
padding: 4px 4px 4px 10px;
height: 48px;
display: flex;
align-items: center;
font-weight: 700;
font-size: 14px;
line-height: 143%;
color: #121212;
gap: 10px;
}
.product-values-item-val{
border: 1px solid #000;
border-radius: 100px;
min-width: 40px;
padding-left: 5px;
padding-right: 5px;
height: 40px;
flex-shrink: 0;
display: flex;
justify-content: center;
align-items: center;
}
.product-values-title{
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: #121212;
}
.product-vitamins{
border: 1px solid rgba(18, 18, 18, 0.1);
border-radius: 20px;
padding: 10px;
width: 100%;
font-weight: 700;
font-size: 14px;
line-height: 143%;
color: #121212;
margin-top: 4px;
}
.product-vitamins-list{
margin-top: 10px;
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.product-vitamins-item{
border: 1px solid #000;
border-radius: 100px;
padding: 10px;
}
/* product info */
/* product constructor */
.product-constructor{
width: 395px;
}
.product-constructor__block{
margin-bottom: 1.5rem;
}
.product-constructor__block-title{
font-size: 16px;
line-height: 125%;
color: #121212;
font-weight: 700;
}
.product-constructor__block-list{
display: flex;
margin-top: 10px;
border-radius: 100px;
padding: 5px;
height: 60px;
width: 100%;
background-color: #fff;
}
.product-constructor__block-item{
flex-grow: 1;
padding: 2px 6px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 50px;
font-weight: 700;
font-size: 14px;
color: rgba(18, 18, 18, 0.75);
border-radius: 100px;
}
.product-constructor__block-item svg, .product-constructor__block-item path{
fill: rgba(18, 18, 18, 0.75);
fill-opacity: 1;
}
.product-constructor__block-item.active{
color: #fff;
background-color: var(--accent-color);
}
.product-constructor__block-item.active svg, .product-constructor__block-item.active path{
fill: #fff;
}
.product-constructor__block-item img, .product-constructor__block-item svg{
height: 22px;
width: 22px;
}
/* product constructor */
/* product price */
.product-price{
display: flex;
gap: 10px;
align-items: center;
}
.product-price-main{
border-radius: 100px;
padding: 14px 15px;
width: 135px;
background-color: #fff;
font-size: 24px;
text-transform: uppercase;
text-align: center;
color: #4d4d4d;
font-weight: 700;
}
.product-price-old{
font-weight: 700;
font-size: 16px;
line-height: 150%;
text-transform: uppercase;
text-decoration: line-through;
color: #666;
}
.product-price-percent{
font-weight: 500;
font-size: 12px;
line-height: 133%;
color: #fa0505;
margin-top: 8px;
}
.product-btn, .button{
border: 2px solid #fff;
border-radius: 100px;
padding: 12px 16px;
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
font-size: 12px;
text-align: center;
color: #fff;
margin-top: 20px;
background-color: var(--accent-color);
}
.button::before{
display: none;
}
.to-know{
font-size: 24px;
text-transform: uppercase;
font-weight: 700;
margin-top: 20px;
text-decoration: underline;
}
/* product price */
/* product gallery */
.product-gallery{
width: 390px;
margin-right: 20px;
border: 2px solid #fff;
border-radius: 30px;
}
/* product gallery */
.product-constructor, .product-gallery, .product-info{
flex-grow: 1;
}
.product-gallery{
padding-top: 30px;
padding-bottom: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
}
.product-gallery-item{
background-color: #fff;
border-radius: 24px;
display: flex;
justify-content: center;
align-items: center;
height: auto;
aspect-ratio: 1/1;
}
.product-gallery-slider{
margin-left: 10px;
margin-right: 10px;
position: relative;
}
.product-gallery-slider .swiper-wrapper{
}
.product-gallery__thumbsSlider::before{
background: linear-gradient(270deg, rgba(193, 221, 230, 0) 0%, var(--bg-color) 100%);
height: 120%;
position: absolute;
left: -10px;
top: -10%;
width: 65px;
content: '';
z-index: 2;
pointer-events: none;
}
.product-gallery__thumbsSlider::after{
background: linear-gradient(270deg, rgba(193, 221, 230, 0) 0%, var(--bg-color) 100%);
height: 120%;
position: absolute;
right: -10px;
top: -10%;
width: 65px;
content: '';
transform: scaleX(-1);
z-index: 2;
pointer-events: none;
}
.product-gallery-item img{
height: 100%;
width: 100%;
object-fit: contain;
padding: 10px;
}
/* product */
.product-gallery-arrow{
border-radius: 100px;
background-color: var(--accent-color);
border: 1px solid #fff;
height: 44px;
width: 44px;
pointer-events: all;
background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L1 13' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' /%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
}
.product-gallery-arrows{
width: calc(100% - 10px);
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
justify-content: space-between;
pointer-events: none;
z-index: 3;
display: flex;
}
.product-gallery-prev{
transform: scaleX(-1);
}
.swiper-slide-active.product-gallery-item{
outline: 4px solid #48c1ed;
}
.product_main .swiper-slide {
display: flex;
justify-content: center;
align-items: center;
}
.product_main .swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
}
.product_main .swiper {
width: 100%;
margin-left: auto;
margin-right: auto;
}
.product_main .swiper-slide {
background-size: cover;
background-position: center;
}
.product-gallery__mainSlider {
height: 80%;
width: 100%;
}
.product-gallery__thumbsSlider {
height: 20%;
box-sizing: border-box;
padding: 10px;
height: 110px;
}
.product-gallery__thumbsSlider .swiper-slide {
width: 90px;
height: 90px;
background-color: #fff;
border-radius: 24px;
padding: 10px 20px;
position: relative;
}
.product-gallery__thumbsSlider .swiper-slide-thumb-active {
outline: 4px solid var(--accent-color);
}
.product_main .swiper-slide img {
display: block;
width: calc(100% - 10px);
height: calc(100% - 10px);
object-fit: contain;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.product-desc{
margin-top: 55px;
}
.product-desc-text{
font-weight: 400;
font-size: 16px;
line-height: 150%;
color: #121212;
margin-top: 20px;
}
.product-reviews{
margin-top: 140px;
}
.product-similar{
margin-top: 140px;
}
.main-food_reviews-slide{
box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.12);
background: var(--color);
/* width: 395px; */
border-radius: 40px !important;
}
.product-reviews-slider {
overflow: visible !important;
margin-top: 40px;
}
.product-reviews{
overflow: hidden;
padding-bottom: 60px;
margin-bottom: -60px;
}
.product-similar-slider{
margin-top: 40px;
}
.main-food_products-card-slider .swiper-slide{
align-self: center;
}
.product-similar{
overflow: hidden;
}
.product-single{
padding-bottom: 90px;
}
.product-similar-slider .swiper-wrapper{
align-items: stretch;
}
.product-similar-slider .swiper-slide{
height: auto;
display: flex;
flex-direction: column;
}
.product-title.--m{
display: none;
}
@media (max-width: 1150px) {
.product_main {
flex-direction: column;
}
.product-gallery{
order: 0;
}
.product-info{
order: 3;
}
.product-info, .product-gallery, .product-constructor{
width: 100%;
margin-right: auto;
margin-left: 0;
margin-top: 20px;
}
.product-gallery__thumbsSlider{
display: none;
}
.product-gallery__mainSlider{
width: 100%;
height: auto;
aspect-ratio: 1 / 1.25;
max-height: 540px;
}
.breadcrumbs{
display: none;
}
.product_main{
margin-top: 0;
width: calc(48px + 100%);
margin-left: -24px;
border-radius: 0;
padding: 5px 20px 40px;
}
.product-title.--m{
display: block;
font-size: 18px;
margin-top: 20px;
margin-top: 32px;
margin-bottom: 14px;
}
.product-title.--pc{
display: none;
}
.product-constructor__block-title{
font-size: 14px;
line-height: 143%;
}
.product-constructor__block-item-name{
font-size: 12px;
}
.product-info{
padding-right: 0;
}
.product-desc-text{
font-size: 14px;
}
.product-reviews{
margin-top: 66px;
}
.main-food_reviews-slide{
padding-left: 20px !important;
padding-right: 20px !important;
}
.main-food_products-card{
min-width: 0 !important;
}
.main-food_products-card-img img{
height: 40vw;
}
}
.product-show{
display: flex;
flex-grow: 1;
flex-direction: column;
}
@media (max-width: 576px) {
.product_main {
margin-left: -10px;
width: calc(20px + 100%);
}
.product-show{
flex-direction: column;
min-height: calc(100vh - 80px);
}
.product-gallery{
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 30px;
position: relative;
}
.product-gallery-bullets{
position: absolute;
display: flex;
bottom: 35px !important;
top: unset !important;
width: 100%;
padding-left: 20px;
padding-right: 20px;
gap: 12px;
justify-content: center;
}
.product-gallery-bullets__item{
height: 12px;
width: 12px;
border-radius: 50%;
background-color: #fff;
}
.product-gallery-bullets__item.--active{
background-color: var(--accent-color);
}
}
.product-block-arrows--m{
display: none;
}
.product-similar__head, .product-reviews__head{
display: flex;
justify-content: space-between;
align-items: center;
}
.product-block-arrows{
display: flex;
gap: 20px;
}
@media (max-width: 980px) {
.product-block-arrows--m{
display: flex;
gap: 10px;
margin-top: 20px;
padding-right: 10px;
padding-left: 10px;
}
.product-block-arrows{
display: none;
}
.product-reviews-slider{
padding-right: 10px;
padding-left: 10px;
}
.product-similar{
margin-top: 60px;
}
}
.stock, .quantity{
display: none;
}
.product-incart__wrap{
display: flex;
align-items: center;
gap: 10px;
margin-top: 20px;
}
.product-incart__btn{
height: 50px;
width: 50px;
position: relative;
border-radius: 50%;
background-color: var(--accent-color);
}
.product-incart__btn--minus::before{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 16px;
height: 2px;
background-color: #fff;
}
.product-incart__btn--plus::before{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 16px;
height: 2px;
background-color: #fff;
}
.product-incart__btn--plus::after{
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 16px;
width: 2px;
background-color: #fff;
}
.product-incart{
display: flex;
align-items: center;
justify-content: space-between;
align-items: center;
padding: 23px 5px;
gap: 10px;
margin: 0 auto;
width: 159px;
height: 60px;
background: color-mix(in srgb, var(--accent-color) 25%, transparent);
border: 2px solid #FFFFFF;
border-radius: 100px;
flex: none;
order: 0;
flex-grow: 0;
font-weight: 900;
font-size: 12px;
color: #fff;
}
.product-incart__label{
border: 2px solid #fff;
border-radius: 100px;
padding: 12px 16px;
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
font-size: 12px;
text-align: center;
color: #fff;
background-color: var(--accent-color);
}
.product-incart-btn{
}
/* Стили для загрузки корзины на single странице */
.product-incart__wrap.loading {
position: relative;
pointer-events: none;
opacity: 0.7;
}
.product-incart__wrap.loading::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--bg-color);
opacity: .7;
z-index: 10;
}
.product-incart__wrap.loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin: -10px 0 0 -10px;
border: 2px solid #f3f3f3;
border-top: 2px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
z-index: 11;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Стили для кнопок во время загрузки */
.product-incart__wrap.loading .product-incart__btn {
opacity: 0.5;
pointer-events: none;
}
/* Стили для счетчика во время загрузки */
.product-incart__wrap.loading .product-incart__count {
opacity: 0.5;
}

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

@ -6,16 +6,14 @@ Timber\Timber::init();
// require once вместо include использовать!
require_once __DIR__ . '/temp-functions/timber-logic.php';
require_once __DIR__ . '/temp-functions/modules-logic.php';
require_once __DIR__ . '/temp-functions/cart-logic.php';
require_once __DIR__ . '/temp-functions/timber-logic.php';
require_once __DIR__ . '/temp-functions/woocommerce-logic.php';
require_once __DIR__ . '/temp-functions/modules-logic.php';
require_once __DIR__ . '/temp-functions/ajax-logic.php';
require_once __DIR__ . '/temp-functions/shortcodes-logic.php';
require_once __DIR__ . '/temp-functions/blog-logic.php';
require_once __DIR__ . '/temp-functions/filters-logic.php';
require_once __DIR__ . '/temp-functions/custom-admin-panel-logic.php';
require_once __DIR__ . '/temp-functions/login-logic.php';
// include_module('forms');
// include_module('shop');
@ -24,22 +22,7 @@ require_once __DIR__ . '/temp-functions/login-logic.php';
// include_module('author');
// include_module('layout');
include_once('modules/shop/CosmopetProduct.php');
add_filter('timber/post/classmap', function ($classmap) {
$classmap['product'] = CosmopetProduct::class;
return $classmap;
}, 100);
add_filter('timber/post/classmap', function ($classmap) {
$classmap['product'] = CosmopetProduct::class;
return $classmap;
}, 100);
function allow_svg_upload($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'allow_svg_upload');

@ -0,0 +1,262 @@
<?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()
// ]);
// }

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

@ -1,380 +0,0 @@
<?
/**
* Добавление событий контрибуции для FP Pixel
* только на боевом сайте АЕ
*/
if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
// Проверка на тестовый режим для метрик
// TO_DO: дуюлирует логику is_gp_test_mode в wp-content/themes/cosmopet/global-functions/multisite-functions.php
function is_gp_test_mode()
{
if (isset($_GET['gp-test']) && $_GET['gp-test'] == '1') {
return true;
}
if (is_user_logged_in() && current_user_can('administrator')) {
return true;
}
return false;
}
add_action('wp_footer', 'add_facebook_pixel_events');
function add_facebook_pixel_events()
{
if (is_gp_test_mode())
return;
global $product;
// 1. ViewContent
if (is_product() && $product && $product->get_price() > 0) {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'ViewContent', {
content_ids: ['<?php echo $product->get_id(); ?>'],
content_type: 'product',
value: <?php echo $product->get_price(); ?>,
currency: '<?php echo get_woocommerce_currency(); ?>'
});
});
</script>
<?php
}
// 2. InitiateCheckout
if (is_checkout() && !is_wc_endpoint_url('order-received') && WC()->cart && WC()->cart->get_cart_contents_count() > 0) {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'InitiateCheckout');
});
</script>
<?php
}
// 3. AddToCart
if (is_product() || is_shop() || is_cart()) {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($) {
$(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) {
var productId = $button.data('product_id') || '';
var quantity = $button.data('quantity') || 1;
var productName = $button.data('product_sku') ||
$button.closest('.product').find('.woocommerce-loop-product__title').text().trim() || 'Unknown';
var priceElement = $button.closest('.product').find('.price .amount').text().replace(/[^0-9.]/g, '') || '0.00';
var currency = '<?php echo get_woocommerce_currency(); ?>';
fbq('track', 'AddToCart', {
content_ids: [productId],
content_type: 'product',
value: parseFloat(priceElement) * quantity,
currency: currency
});
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': currency,
'value': parseFloat(priceElement) * quantity,
'items': [{
'item_id': productId,
'item_name': productName,
'price': parseFloat(priceElement),
'quantity': quantity
}]
}
});
});
});
});
</script>
<?php
}
// 4. AddPaymentInfo
if (is_checkout() && !is_wc_endpoint_url('order-received') && WC()->cart && WC()->cart->get_cart_contents_count() > 0) {
$currency = get_woocommerce_currency();
$cart_total = WC()->cart->get_total('edit');
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'AddPaymentInfo', {
value: <?php echo $cart_total; ?>,
currency: '<?php echo $currency; ?>'
});
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'add_payment_info',
'ecommerce': {
'currency': '<?php echo $currency; ?>',
'value': <?php echo $cart_total; ?>
}
});
});
</script>
<?php
}
// 5. Purchase
if (is_wc_endpoint_url('order-received')) {
$order_id = absint(get_query_var('order-received'));
if (!$order_id)
return;
$order = wc_get_order($order_id);
if (!$order || ($order->get_status() !== 'processing' && $order->get_status() !== 'completed'))
return;
$items = [];
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$items[] = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => $product->get_price(),
'quantity' => $item->get_quantity()
];
}
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'Purchase', {
value: <?php echo $order->get_total(); ?>,
currency: '<?php echo $order->get_currency(); ?>',
content_ids: [<?php echo implode(',', array_column($items, 'item_id')); ?>],
content_type: 'product'
});
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'purchase',
'ecommerce': {
'currency': '<?php echo $order->get_currency(); ?>',
'value': <?php echo $order->get_total(); ?>,
'items': <?php echo json_encode($items); ?>
}
});
});
</script>
<?php
}
}
add_action('woocommerce_thankyou', 'send_purchase_to_metrika');
function send_purchase_to_metrika($order_id)
{
if (is_gp_test_mode())
return;
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); ?>
});
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
}
}
// Функция событий Meta Pixel
add_action('wp_head', function () {
global $site_env;
$show_pixel = false;
// Для продакшена
if ($site_env->site_mode === 'production' && $site_env->site_region === 'ae') {
$show_pixel = true;
}
// Для тестовых стендов AE
if ($site_env->site_mode === 'develope' && $site_env->site_region === 'ae') {
$show_pixel = true;
}
// Дополнительные проверки
$skip_tracking = false;
// Исключаем админов
if (current_user_can('administrator')) {
$skip_tracking = true;
}
// Исключаем gp-test режим
if ($site_env->is_gp_test_mode) {
$skip_tracking = true;
}
// Исключаем если есть параметр gp-test=1 в URL
if (isset($_GET['gp-test']) && $_GET['gp-test'] == '1') {
$skip_tracking = true;
}
if ($show_pixel && !$skip_tracking) {
$context = [
'currency' => get_woocommerce_currency(),
];
// Определяем тип страницы и подготавливаем данные
if (is_product()) {
// Страница товара - ViewContent
global $product;
if ($product && $product instanceof WC_Product) {
$context['pixel_event_type'] = 'ViewContent';
$context['product'] = [
'id' => $product->get_id(),
'name' => $product->get_name(),
'price' => floatval($product->get_price()),
'sku' => $product->get_sku(),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
}
} elseif (is_checkout() && !is_order_received_page()) {
// Страница чекаута - InitiateCheckout
$context['pixel_event_type'] = 'InitiateCheckout';
if (WC()->cart && !WC()->cart->is_empty()) {
$context['cart_total'] = floatval(WC()->cart->get_total('edit'));
$context['cart_items'] = [];
$context['content_ids'] = [];
foreach (WC()->cart->get_cart() as $cart_item) {
$product = $cart_item['data'];
if ($product && $product instanceof WC_Product) {
$item_data = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => floatval($product->get_price()),
'quantity' => intval($cart_item['quantity']),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
$context['cart_items'][] = $item_data;
$context['content_ids'][] = $product->get_id();
}
}
}
} elseif (is_order_received_page()) {
// Страница благодарности - Purchase
$order_id = get_query_var('order-received');
if ($order_id) {
$order = wc_get_order($order_id);
if ($order && $order instanceof WC_Order) {
$context['pixel_event_type'] = 'Purchase';
$order_items = [];
$content_ids = [];
foreach ($order->get_items() as $item) {
if ($item instanceof WC_Order_Item_Product) {
$product = $item->get_product();
if ($product && $product instanceof WC_Product) {
$order_items[] = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => floatval($item->get_total() / $item->get_quantity()),
'quantity' => intval($item->get_quantity()),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
$content_ids[] = $product->get_id();
}
}
}
$context['order'] = [
'id' => $order->get_id(),
'total' => floatval($order->get_total()),
'currency' => $order->get_currency(),
'items' => $order_items,
'content_ids' => $content_ids,
'order_key' => $order->get_order_key(),
];
}
}
} else {
// Все остальные страницы - PageView + подготовка для AddToCart
$context['pixel_event_type'] = 'PageView';
$context['enable_addtocart'] = true; // Включаем обработчик AddToCart
// Дополнительные данные для PageView
global $wp_query;
$context['page_data'] = [
'page_title' => wp_get_document_title(),
'page_url' => home_url(add_query_arg(array(), $wp_query->request)),
'page_type' => get_page_type(),
];
}
// Рендерим шаблон
\Timber\Timber::render('templates/head-pixel-functions.twig', $context);
}
});
function get_page_type()
{
if (is_home() || is_front_page()) {
return 'home';
} elseif (is_shop()) {
return 'shop';
} elseif (is_product_category()) {
return 'category';
} elseif (is_product_tag()) {
return 'tag';
} elseif (is_search()) {
return 'search';
} elseif (is_cart()) {
return 'cart';
} elseif (is_account_page()) {
return 'account';
} else {
return 'other';
}
}

@ -1,7 +1,4 @@
<?php
global $site_env;
// $this->site_region
add_action('init', function() {
@ -107,42 +104,6 @@ add_action('init', function () {
],
'group' => 'General',
],
[
'name' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'string' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'translations' => [
'ru' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'en' => 'PRODUCTION STAGES',
],
'group' => 'General',
],
[
'name' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'string' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'translations' => [
'ru' => 'ЭТАПЫ ПРОИЗВОДСТВА',
'en' => 'PRODUCTION STAGES',
],
'group' => 'General',
],
[
'name' => 'Этапы производства корма',
'string' => 'Этапы производства корма',
'translations' => [
'ru' => 'Этапы производства корма',
'en' => 'Stages of feed production',
],
'group' => 'General',
],
[
'name' => 'Наши партнеры',
'string' => 'Наши партнеры',
'translations' => [
'ru' => 'Наши партнеры',
'en' => 'Our partners',
],
'group' => 'General',
],
[
'name' => 'Ваше имя',
'string' => 'Ваше имя',
@ -179,33 +140,6 @@ add_action('init', function () {
],
'group' => 'General',
],
[
'name' => 'Соглашение о конфиденциальности',
'string' => 'Соглашение о конфиденциальности',
'translations' => [
'ru' => 'Соглашение о конфиденциальности',
'en' => 'Privacy policy',
],
'group' => 'General',
],
[
'name' => 'Декларация соответствия корма',
'string' => 'Декларация соответствия корма',
'translations' => [
'ru' => 'Декларация соответствия корма',
'en' => 'Declaration of conformity of feed',
],
'group' => 'General',
],
[
'name' => 'Декларация соответствия лакомств',
'string' => 'Декларация соответствия лакомств',
'translations' => [
'ru' => 'Декларация соответствия лакомств',
'en' => 'Declaration of conformity of treats',
],
'group' => 'General',
],
[
'name' => 'Чат бот с ветеринаром',
'string' => 'Чат бот с ветеринаром',
@ -1610,294 +1544,4 @@ add_action('init', function () {
pll_register_string('Подписки', 'Подписки', 'Theme');
pll_register_string('Не указан', 'Не указан', 'Theme');
pll_register_string('месяц', 'месяц', 'Theme');
pll_register_string('Узнать о поступлении', 'Узнать о поступлении', 'Theme');
pll_register_string('Оставьте свой e-mail, и мы оповестим вас, когда продукт появится', 'Оставьте свой e-mail, и мы оповестим вас, когда продукт появится', 'Theme');
pll_register_string('Я ознакомился с <a href="#">политикой обработки персональных данных</a> и <a href="#">пользовательским соглашением
', 'Я ознакомился с <a href="#">политикой обработки персональных данных</a> и <a href="#">пользовательским соглашением
', 'Theme');
pll_register_string('Оставить почту', 'Оставить почту', 'Theme');
pll_register_string('Подписка на товар оформлена', 'Подписка на товар оформлена', 'Theme');
pll_register_string('На ваш e-mail <span id="email_current"></span> придет письмо, как только продукт появится в наличии.', 'На ваш e-mail <span id="email_current"></span> придет письмо, как только продукт появится в наличии.', 'Theme');
pll_register_string('Продолжить покупки', 'Продолжить покупки', 'Theme');
pll_register_string('Your cart is empty', 'Your cart is empty', 'Cart');
pll_register_string('Feed subscription', 'Feed subscription', 'Profile');
pll_register_string('Weekly food delivery for your pet', 'Weekly food delivery for your pet', 'Profile');
pll_register_string('Get details', 'Get details', 'Profile');
pll_register_string('Name is not set', 'Name is not set', 'Profile');
pll_register_string('Not filled', 'Not filled', 'Profile');
pll_register_string('Email is verified', 'Email is verified', 'Profile');
pll_register_string('Email is not verified', 'Email is not verified', 'Profile');
pll_register_string('Verify', 'Verify', 'Theme');
pll_register_string('Email with verification link is sent to your email.', 'Email with verification link is sent to your email.', 'Profile');
pll_register_string('example@example.com', 'example@example.com', 'Profile');
pll_register_string('Link email', 'Link email', 'Profile');
pll_register_string('Linked accounts', 'Linked accounts', 'Profile');
pll_register_string('Edit', 'Edit', 'Profile');
pll_register_string('Logout', 'Logout', 'Profile');
pll_register_string('Add a pet', 'Add a pet', 'Profile');
pll_register_string('Phone', 'Phone', 'Profile');
pll_register_string('Email', 'Email', 'Profile');
pll_register_string('Order from', 'Order from', 'Profile');
pll_register_string('Summary', 'Summary', 'Profile');
pll_register_string('Delivery address', 'Delivery address', 'Profile');
pll_register_string('CDEK shipping point', 'CDEK shipping point', 'Profile');
pll_register_string('Track order', 'Track order', 'Profile');
pll_register_string('Order details', 'Order details', 'Profile');
pll_register_string('No orders yet', 'No orders yet', 'Profile');
pll_register_string('Catalog', 'Catalog', 'Profile');
pll_register_string('Subscription №', 'Подписка №', 'Profile');
pll_register_string('Status', 'Статус', 'Profile');
pll_register_string('Subscription date', 'Дата подписки', 'Profile');
pll_register_string('Last order date', 'Дата последнего заказа', 'Profile');
pll_register_string('Next payment', 'Следующий платеж', 'Profile');
pll_register_string('Payment method', 'Способ оплаты', 'Profile');
pll_register_string('Products:', 'Товары:', 'Profile');
pll_register_string('Total', 'Сумма', 'Profile');
pll_register_string('month', 'месяц', 'Profile');
pll_register_string('Delivery', 'Доставка', 'Profile');
pll_register_string('Free', 'Бесплатно', 'Profile');
pll_register_string('Amount', 'Итого', 'Profile');
pll_register_string('Shipping:', 'Доставка:', 'Profile');
pll_register_string('Delivery address', 'Адрес доставки', 'Profile');
pll_register_string('Start typing address', 'Начните вводить адрес', 'Profile');
pll_register_string('Invalid address entered', 'Адрес введен неверно', 'Profile');
pll_register_string('Delivery comment', 'Комментарий для доставки', 'Profile');
pll_register_string('For delivery service', 'Для службы доставки', 'Profile');
pll_register_string('Invalid comment entered', 'Комментарий введен неверно', 'Profile');
pll_register_string('Save', 'Сохранить', 'Profile');
pll_register_string('Cancel subscription', 'Отменить подписку', 'Profile');
pll_register_string('Subscription not found.', 'Подписка не найдена.', 'Profile');
pll_register_string('Subscription from', 'Подписка от', 'Profile');
pll_register_string('Amount:', 'Сумма:', 'Profile');
pll_register_string('Next payment:', 'Следующий платеж:', 'Profile');
pll_register_string('Subscription details', 'Детали подписки', 'Profile');
pll_register_string('Details not available', 'Детали недоступны', 'Profile');
pll_register_string('You have no active subscriptions.', 'У вас нет активных подписок.', 'Profile');
pll_register_string('Add a pet', 'Добавить питомца', 'Profile');
pll_register_string('Animal type', 'Вид животного', 'Profile');
pll_register_string('Cat', 'Кошка', 'Profile');
pll_register_string('Dog', 'Собака', 'Profile');
pll_register_string('Sterilized', 'Стерелизован', 'Profile');
pll_register_string('Yes', 'Да', 'Profile');
pll_register_string('No', 'Нет', 'Profile');
pll_register_string('Name', 'Имя', 'Profile');
pll_register_string('Pet name', 'Имя питомца', 'Profile');
pll_register_string('Breed', 'Порода', 'Profile');
pll_register_string('Your pet breed', 'Порода вашего питомца', 'Profile');
pll_register_string('Your pet gender', 'Пол вашего питомца', 'Profile');
pll_register_string('Boy', 'Мальчик', 'Profile');
pll_register_string('Girl', 'Девочка', 'Profile');
pll_register_string('Activity level', 'Вид активности', 'Profile');
pll_register_string('Select from list', 'Выберите из списка', 'Profile');
pll_register_string('Low', 'Низкая', 'Profile');
pll_register_string('Medium', 'Средняя', 'Profile');
pll_register_string('High', 'Высокая', 'Profile');
pll_register_string('Weight', 'Вес', 'Profile');
pll_register_string('Pet age', 'Возраст питомца', 'Profile');
pll_register_string('Approximate', 'Примерный', 'Profile');
pll_register_string('Exact', 'Точный', 'Profile');
pll_register_string('Kitten', 'Малыш', 'Profile');
pll_register_string('(from 0 to 1 year)', '(от 0 до 1 года)', 'Profile');
pll_register_string('Adult', 'Взрослый', 'Profile');
pll_register_string('(from 1 to 7 years)', '(от 1 года до 7 лет)', 'Profile');
pll_register_string('Senior', 'Пожилой', 'Profile');
pll_register_string('(from 7 to 12 years)', '(от 7 до 12 лет)', 'Profile');
pll_register_string('Aging', 'Стареющий', 'Profile');
pll_register_string('(from 12 years and up)', '(от 12 лет и старше)', 'Profile');
pll_register_string('Day', 'День', 'Profile');
pll_register_string('DD', 'ДД', 'Profile');
pll_register_string('Month', 'Месяц', 'Profile');
pll_register_string('Year', 'Год', 'Profile');
pll_register_string('YYYY', 'ГГГГ', 'Profile');
pll_register_string('Add', 'Добавить', 'Profile');
pll_register_string('Feed subscription', 'Feed subscription', 'Profile');
pll_register_string('Weekly food delivery for your pet', 'Weekly food delivery for your pet', 'Profile');
pll_register_string('Get details', 'Get details', 'Profile');
pll_register_string('Order from', 'Order from', 'Profile');
pll_register_string('Summary', 'Summary', 'Profile');
pll_register_string('Delivery address', 'Delivery address', 'Profile');
pll_register_string('CDEK shipping point', 'CDEK shipping point', 'Profile');
pll_register_string('Track order', 'Track order', 'Profile');
pll_register_string('Order details', 'Order details', 'Profile');
pll_register_string('No orders yet', 'No orders yet', 'Profile');
pll_register_string('Catalog', 'Catalog', 'Profile');
pll_register_string('Subscription for food', 'Подписка на корм', 'Profile');
pll_register_string('I want to try first!', 'Хочу попробовать первым!', 'Profile');
pll_register_string('I want to be first!', 'Хочу быть первым!', 'Profile');
pll_register_string('Edit my data', 'Изменить мои данные', 'Profile');
pll_register_string('First name', 'Имя', 'Profile');
pll_register_string('Your name', 'Ваше имя', 'Profile');
pll_register_string('First name is invalid', 'Имя введено неверно', 'Profile');
pll_register_string('Last name', 'Фамилия', 'Profile');
pll_register_string('Your last name', 'Ваша фамилия', 'Profile');
pll_register_string('Last name is invalid', 'Фамилия введена неверно', 'Profile');
pll_register_string('Phone', 'Телефон', 'Profile');
pll_register_string('Phone is invalid', 'Номер введён неверно', 'Profile');
pll_register_string('Save', 'Сохранить', 'Profile');
pll_register_string('Cancel', 'Отмена', 'Profile');
pll_register_string('Breed', 'Breed', 'Profile');
pll_register_string('Weight', 'Weight', 'Profile');
pll_register_string('from 0,5 kg to 1,5 kg', 'from 0,5 kg to 1,5 kg', 'Profile');
pll_register_string('from 1.5 to 3 kg', 'from 1.5 to 3 kg', 'Profile');
pll_register_string('from 3 to 5 kg', 'from 3 to 5 kg', 'Profile');
pll_register_string('from 5 to 8 kg', 'from 5 to 8 kg', 'Profile');
pll_register_string('from 8 to 11 kg', 'from 8 to 11 kg', 'Profile');
pll_register_string('from 11 to 15 kg', 'from 11 to 15 kg', 'Profile');
pll_register_string('from 15 to 20 kg', 'from 15 to 20 kg', 'Profile');
pll_register_string('from 20 to 25 kg', 'from 20 to 25 kg', 'Profile');
pll_register_string('from 25 to 35 kg', 'from 25 to 35 kg', 'Profile');
pll_register_string('More than 35 kg', 'More than 35 kg', 'Profile');
pll_register_string('Age', 'Age', 'Profile');
pll_register_string('Adult (from 1 year to 7 years)', 'Adult (from 1 year to 7 years)', 'Profile');
pll_register_string('Elderly (from 7 to 12 years)', 'Elderly (from 7 to 12 years)', 'Profile');
pll_register_string('Aging (12 years and older)', 'Aging (12 years and older)', 'Profile');
pll_register_string('Baby (from 0 to 1 year)', 'Baby (from 0 to 1 year)', 'Profile');
pll_register_string('Birthday', 'Birthday', 'Profile');
pll_register_string('Activity', 'Activity', 'Profile');
pll_register_string('Low', 'Low', 'Profile');
pll_register_string('Moderate', 'Moderate', 'Profile');
pll_register_string('High', 'High', 'Profile');
pll_register_string('Sterilized', 'Sterilized', 'Profile');
pll_register_string('Edit', 'Edit', 'Profile');
pll_register_string('Редактировать питомца', 'Редактировать питомца', 'Profile');
pll_register_string('Адрес доставки успешно обновлён.', 'Адрес доставки успешно обновлён.', 'profile-sub-single');
pll_register_string('Ошибка безопасности. Обновите страницу.', 'Ошибка безопасности. Обновите страницу.', 'profile-sub-single');
pll_register_string('Вы не авторизованы.', 'Вы не авторизованы.', 'profile-sub-single');
pll_register_string('Недостаточно данных.', 'Недостаточно данных.', 'profile-sub-single');
pll_register_string('Подписка не найдена или не принадлежит вам.', 'Подписка не найдена или не принадлежит вам.', 'profile-sub-single');
pll_register_string('Адрес доставки', 'Адрес доставки', 'profile-sub-single');
pll_register_string('Город', 'Город', 'profile-sub-single');
pll_register_string('contact_recipient', 'Контакты получателя', 'Checkout');
pll_register_string('logout', 'Выйти', 'Checkout');
pll_register_string('login', 'Войти', 'Checkout');
pll_register_string('shipping_title', 'Доставка', 'Checkout');
pll_register_string('pickup_point', 'Пункт выдачи', 'Checkout');
pll_register_string('choose_pickup_point', 'Выберите пункт выдачи', 'Checkout');
pll_register_string('delivery_address', 'Адрес доставки', 'Checkout');
pll_register_string('choose_delivery_address', 'Выберите адрес доставки', 'Checkout');
pll_register_string('delivery_comment', 'Комментарий для доставки', 'Checkout');
pll_register_string('your_order', 'Ваш заказ', 'Checkout');
pll_register_string('coupon_code', 'Код купона', 'Checkout');
pll_register_string('deliver_here', 'Доставить сюда', 'Checkout');
pll_register_string('address', 'Адрес', 'Checkout');
pll_register_string('start_typing_address', 'Начните вводить ваш адрес', 'Checkout');
pll_register_string('apartment', 'Квартира', 'Checkout');
pll_register_string('floor', 'Этаж', 'Checkout');
pll_register_string('entrance', 'Подъезд', 'Checkout');
pll_register_string('intercom', 'Домофон', 'Checkout');
pll_register_string('intercom code', 'Код домофона', 'Checkout');
pll_register_string('coupon_placeholder', 'Промокод', 'Checkout');
pll_register_string('apply_coupon_button', 'Применить', 'Checkout');
pll_register_string('error_invalid_coupon', 'Ошибка! Промокод введен неверно или не существует.', 'Checkout');
pll_register_string('remove_coupon_button', 'Удалить', 'Checkout');
pll_register_string('Применен промокод:', 'Применен промокод:', 'Checkout');
pll_register_string('shipping_method_cdek_courier', 'Курьером', 'Checkout');
pll_register_string('shipping_method_pickup_point', 'Пункт выдачи', 'Checkout');
pll_register_string('shipping_method_time', 'время', 'Checkout');
pll_register_string('shipping_method_price', '₽', 'Checkout');
pll_register_string('shipping_method_no_available', 'Нет доступных способов доставки. Для отображение доступных методов укажите ваш город.', 'Checkout');
pll_register_string('shipping_to', 'Shipping to %s.', 'Checkout');
pll_register_string('change_address', 'Change address', 'Checkout');
pll_register_string('shipping_options_updated', 'Shipping options will be updated during checkout.', 'Checkout');
pll_register_string('Товары', 'Товары', 'Checkout');
pll_register_string('Начните вводить ваш email', 'Начните вводить ваш email', 'Checkout');
pll_register_string('Населенный пункт', 'Населенный пункт', 'Checkout');
pll_register_string('Ваш город', 'Ваш город', 'Checkout');
pll_register_string('Оплатить', 'Оплатить', 'Checkout');
pll_register_string('Запомнить меня', 'Запомнить меня', 'Checkout');
pll_register_string('coming soon', 'coming soon', 'Not found');
pll_register_string('This item is not on our website yet, but it will be here very soon', 'This item is not on our website yet, but it will be here very soon', 'Not found');
});
// Регистрируем строковые переводы для динамической подстановки в JS
/* TO_DO: переделать под ppl_e() */
add_action('wp_head', function () {
if (function_exists('pll_current_language')) {
$lang = pll_current_language();
$translations = [
'en' => [
'name_required' => 'The name is required.',
'email_invalid' => 'Email is incorrect.',
'phone_invalid' => 'The phone number is incorrect.',
'error_coupon_empty' => 'Please enter the coupon code.',
'error_coupon_invalid' => 'Error! The coupon code is invalid or does not exist.',
'error_generic' => 'An error occurred. Please try again.',
'shipping_method_error' => 'No pickup point selected for delivery.',
'shipping_address_error' => 'Delivery address not provided',
'email_taken_error' => 'This email is already registered. Please log in or provide a different email.',
'phone_number_error' => 'Incorrect phone number entered.',
'shipping_method_missing' => 'No delivery method selected. Please check your address or contact the site administration for help.',
'change_address' => 'Change address',
'shipping_updated' => 'Shipping methods will be updated during checkout.',
'coupon_applied' => 'Coupon applied: ',
// 🔽 Новые строки из JS
'Choose pick-up' => 'Choose pick-up',
'Re-select pick-up' => 'Re-select pick-up',
'There are no CDEK pick-up points available in this direction, please select another delivery method' =>
'There are no CDEK pick-up points available in this direction, please select another delivery method'
],
'ru' => [
'name_required' => 'Поле имени обязательно для заполнения.',
'email_invalid' => 'Введите корректный email.',
'phone_invalid' => 'Введите корректный номер телефона.',
'error_coupon_empty' => 'Пожалуйста, введите код купона.',
'error_coupon_invalid' => 'Ошибка! Промокод введен неверно или не существует.',
'error_generic' => 'Произошла ошибка. Попробуйте ещё раз.',
'shipping_method_error' => 'Не выбран ПВЗ для доставки заказа.',
'shipping_address_error' => 'Не указан адрес доставки',
'email_taken_error' => 'Этот email уже зарегистрирован. Войдите в свой аккаунт или укажите другой E-mail.',
'phone_number_error' => 'Неправильно введен номер',
'shipping_method_missing' => 'Не выбран метод доставки. Пожалуйста перепроверьте ваш адрес или обратитесь за помощью к администрации сайта.',
'change_address' => 'Изменить адрес',
'shipping_updated' => 'Методы доставки будут обновлены в процессе оформления заказа.',
'coupon_applied' => 'Применен промокод: ',
'Choose pick-up' => 'Выбрать пункт выдачи',
'Re-select pick-up' => 'Выбрать другой пункт выдачи',
'There are no CDEK pick-up points available in this direction, please select another delivery method' =>
'В этом направлении нет доступных пунктов выдачи CDEK, пожалуйста, выберите другой способ доставки'
]
];
$current_translations = $translations[$lang] ?? $translations['en'];
?>
<? // GP | Обращаемся из wp-content/themes/cosmopet/modules/forms/assets/js/form.js ?>
<script>
window.langData = {
currentLang: "<?php echo esc_js($lang); ?>",
translations: <?php echo json_encode($current_translations, JSON_UNESCAPED_UNICODE); ?>
};
</script>
<?php
}
});
});

@ -1,13 +1,13 @@
<?php
/* Start | Работа с проверкой мультисайтовости и стендов */
global $site_env;
$site_env = new SiteEnvironment();
class SiteEnvironment {
public string $site_mode;
public string $site_region;
public bool $is_gp_test_mode;
public function __construct(string $host = null) {
class SiteEnvironment
{
public string $mode;
public string $region;
public function __construct(string $host = null)
{
$map = [
'cosmopet.ru' => ['mode' => 'production', 'region' => 'ru'],
'cosmopet.ae' => ['mode' => 'production', 'region' => 'ae'],
@ -15,24 +15,297 @@ class SiteEnvironment {
'cosmopet-test-ru.cp.good-production.xyz' => ['mode' => 'develope', 'region' => 'ru'],
'cosmopet-test-ae.cp.good-production.xyz' => ['mode' => 'develope', 'region' => 'ae'],
];
$host = strtolower($host ?: $_SERVER['SERVER_NAME']);
$config = $map[$host] ?? ['mode' => 'develope', 'region' => 'unknown'];
$this->site_mode = $config['mode'];
$this->site_region = $config['region'];
$this->is_gp_test_mode = (isset($_GET['gp-test']) && $_GET['gp-test'] == '1') || (is_user_logged_in() && current_user_can('administrator'));
}
}
add_filter('timber/twig', function (\Twig\Environment $twig) {
global $site_env;
$site_env = new SiteEnvironment();
$twig->addGlobal('site_region', $site_env->site_region);
$twig->addGlobal('site_env', $site_env);
$twig->addGlobal('site_mode', $site_env->site_mode);
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option'));
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option')); // со страницы "Общих настроек контента ACF"
return $twig;
});
/* End | Работа с проверкой мультисайтовости и стендов */
add_filter('woocommerce_currency_symbol', function($currency_symbol, $currency) {
return $currency === 'AED' ? 'AED' : $currency_symbol;
}, 10, 2);
add_filter('woocommerce_currency_symbol', 'change_aed_currency_symbol', 10, 2);
function change_aed_currency_symbol($currency_symbol, $currency) {
if ($currency == 'AED') {
$currency_symbol = 'AED';
}
return $currency_symbol;
}
add_filter('timber/context', function($context) {
// Передаем все нужные константы в контекст Twig
$context['CONSTANTS'] = [
'DOMAIN' => defined('SITE_DOMAIN') ? SITE_DOMAIN : null,
];
return $context;
});
// Отключаем канонические ссылки и hreflang от Yoast SEO
add_filter('wpseo_canonical', '__return_false');
add_filter('wpseo_opengraph_url', '__return_false'); // Отключаем OG URL
add_filter('wpseo_add_x_default_hreflang', '__return_false'); // Отключаем hreflang от Yoast
add_filter('wpseo_disable_adjacent_rel_links', '__return_true'); // Отключаем соседние rel-ссылки
// Добавляем каноническую ссылку
add_action('wp_head', 'custom_canonical_url', 5);
function custom_canonical_url() {
if (!is_admin()) {
// Защищаем от дублирования
static $canonical_added = false;
if ($canonical_added) {
return;
}
$canonical_added = true;
// Формируем текущий URL без лишних параметров
$current_url = trailingslashit(home_url($_SERVER['REQUEST_URI']));
// Удаляем возможные параметры запроса, если они не нужны
$current_url = strtok($current_url, '?');
echo '<link rel="canonical" href="' . esc_url($current_url) . '" />' . "\n";
}
}
add_action('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
}
/**
* Добавление событий контрибуции для FP Pixel
* только на боевом сайте АЕ
* */
if($site_env->site_mode == 'production' and $site_env->site_region == 'ae') {
add_action('wp_footer', 'add_facebook_pixel_events');
function add_facebook_pixel_events() {
// 1. Событие AddToCart (Добавление в корзину)
if (is_product() || is_shop() || is_cart()) {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($) {
$(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) {
var productId = $button.data('product_id') || '';
var quantity = $button.data('quantity') || 1;
var productName = $button.data('product_sku') ||
$button.closest('.product').find('.woocommerce-loop-product__title').text().trim() || 'Unknown';
var priceElement = $button.closest('.product').find('.price .amount').text().replace(/[^0-9.]/g, '') || '0.00';
var currency = '<?php echo get_woocommerce_currency(); ?>'; // Динамическая валюта
// Событие для Facebook Pixel
fbq('track', 'AddToCart', {
content_ids: [productId],
content_type: 'product',
value: parseFloat(priceElement) * quantity,
currency: currency
});
// Событие для Google Analytics
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': currency,
'value': parseFloat(priceElement) * quantity,
'items': [{
'item_id': productId,
'item_name': productName,
'price': parseFloat(priceElement),
'quantity': quantity
}]
}
});
});
});
});
</script>
<?php
}
// 2. Событие Purchase (Покупка)
if (is_wc_endpoint_url('order-received')) {
$order_id = absint(get_query_var('order-received'));
if (!$order_id) return;
$order = wc_get_order($order_id);
if (!$order || ($order->get_status() !== 'processing' && $order->get_status() !== 'completed')) return;
$items = [];
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$items[] = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => $product->get_price(),
'quantity' => $item->get_quantity()
];
}
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'Purchase', {
value: <?php echo $order->get_total(); ?>,
currency: '<?php echo $order->get_currency(); ?>',
content_ids: [<?php echo implode(',', array_column($items, 'item_id')); ?>],
content_type: 'product'
});
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'purchase',
'ecommerce': {
'currency': '<?php echo $order->get_currency(); ?>',
'value': <?php echo $order->get_total(); ?>,
'items': <?php echo json_encode($items); ?>
}
});
});
</script>
<?php
}
// 3. Событие AddPaymentInfo
if (is_checkout() && !is_wc_endpoint_url('order-received')) {
$currency = get_woocommerce_currency();
$cart_total = WC()->cart ? WC()->cart->get_total('edit') : 0;
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'AddPaymentInfo', {
value: <?php echo $cart_total; ?>,
currency: '<?php echo $currency; ?>'
});
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'add_payment_info',
'ecommerce': {
'currency': '<?php echo $currency; ?>',
'value': <?php echo $cart_total; ?>
}
});
});
</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');
}
});
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";
}
}

@ -1,16 +0,0 @@
<?php
add_action('wp_enqueue_scripts', 'override_cdek_widget_script', 100);
function override_cdek_widget_script() {
// Убираем оригинал
wp_dequeue_script('cdek-map');
wp_deregister_script('cdek-map');
// Подключаем свой модифицированный
wp_enqueue_script(
'cdek-map', // тот же handle — это ВАЖНО!
get_stylesheet_directory_uri() . '/static/js/cdek-map.js',
['jquery', 'lodash', 'wp-i18n', 'cdek-widget'], // зависимости, если нужны
'1.0',
true // в футере
);
}

@ -1,25 +0,0 @@
<?php
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')
) );
}

@ -1,31 +0,0 @@
<?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('template_redirect', 'custom_redirect_cart_to_checkout');
function custom_redirect_cart_to_checkout() {
if (is_cart()) {
// Проверка, если корзина пуста
if (WC()->cart->is_empty()) {
wp_redirect(home_url());
exit;
} else {
// Редирект на страницу чекаута
wp_redirect(wc_get_checkout_url());
exit;
}
}
}

@ -1,18 +0,0 @@
<?
add_filter('wpseo_canonical', '__return_false');
add_filter('wpseo_opengraph_url', '__return_false');
add_filter('wpseo_add_x_default_hreflang', '__return_false');
add_filter('wpseo_disable_adjacent_rel_links', '__return_true');
/* Добавление canonical-ссылок */
add_action('wp_head', function () {
if (!is_admin()) {
static $canonical_added = false;
if ($canonical_added)
return;
$canonical_added = true;
$current_url = strtok(trailingslashit(home_url($_SERVER['REQUEST_URI'])), '?');
echo '<link rel="canonical" href="' . esc_url($current_url) . '" />' . "\n";
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 KiB

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

@ -2,19 +2,10 @@ main{
padding-top: 72px;
}
main .other-home {
background: none!important;
padding-bottom: 68px;
}
.block-lists_text p {
font-size: 18px!important;
}
.home-blog {
padding: 60px 0 68px!important;
}
.user a{
display: flex;
align-items: center;
@ -100,5 +91,3 @@ main .other-home {

@ -1,53 +1,3 @@
@media(max-width:768px) {
body {
background: radial-gradient(261.43% 263.03% at 124% -28.000000000000004%, rgb(15, 88, 129), rgb(30, 164, 156) 36.979%, rgb(118, 206, 117) 66.667%, rgb(236, 243, 159) 91.146%);
font-family: var(--font-craftwork);
font-weight: 500;
}
main {
padding-top: 55px!important;
}
main .home-blog {
background: none!important;
}
main .home-blog .container {
padding: 0px 30px 36px !important;
}
.home-title {
font-size: 32px!important;
padding-top: 15px!important;
}
.home-description {
font-weight: bold;
font-size: 20px!important;
line-height: 24px!important;
margin-bottom: 36px!important;
}
.anons-best__card-wrap {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr))!important;
gap: 24px;
}
.anons-article__card-wrap {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr))!important;
gap: 10px 25px!important;
}
.author h2 {
font-size: 26px!important;
line-height: 30px!important;
}
.anons-theme ul a {
font-size: 16px!important;
}
main .other-home .container{
padding: 0px 30px 0px !important;
}
.home-blog {
padding: 60px 0 20px!important;
}
}
@media(max-width:600px) {
.article-content h2 {
max-width: 661px;

@ -1,13 +1 @@
/* Стили для планшетов */
@media (min-width:769px) and (max-width:1200px) {
.anons-best__card-wrap {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr))!important;
gap: 24px;
}
.anons-article__card-wrap {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr))!important;
gap: 40px 25px;
}
}

@ -11,14 +11,10 @@ wp_localize_script('blog-archive-posts-ajax-js', 'ajax', array(
'ajax_url' => admin_url('admin-ajax.php'),
));
global $wp_query;
$context = Timber::context();
$context['blog_title'] = get_field('blog_title', 'options');
$context['blog_desc'] = get_field('blog_desc', 'options');
$context['total_pages'] = $wp_query->max_num_pages;
if (is_category()) {
$context['category'] = get_queried_object();
}
$context['post_count'] = wp_count_posts()->publish; // Количество опубликованных постов
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); // Общее количество страниц
Timber::render('blog/blog-archive.twig', $context);

@ -13,7 +13,6 @@
align-items: center;
justify-content: space-between;
padding: 35px 42px 35px 209px;
gap: 20px;
position: relative;
box-shadow: 6px 9px 20px rgba(0, 0, 0, 15%);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

@ -1,53 +0,0 @@
<?php
use Timber\Timber;
$context = Timber::context();
$post = Timber::get_post();
$context['post'] = $post;
$context['top_level_comments'] = get_comments([
'post_id' => $post->ID,
'status' => 'approve',
'parent' => 0,
'order' => 'ASC'
]);
$context['is_user_logged_in'] = is_user_logged_in();
$context['comment_form_args'] = [
'comment_field' => '<div class="comment-form-comment"><textarea id="comment" name="comment" placeholder="' . pll__('Ваш комментарий') . '" required></textarea></div>',
'title_reply' => pll__('Оставить комментарий'),
'title_reply_to' => pll__('Ответить %s'),
'cancel_reply_link' => pll__('Отменить'),
'id_form' => 'commentform',
'id_submit' => 'submit',
'class_submit' => 'comment-submit-btn',
'submit_button' => '<button name="%1$s" type="submit" id="%2$s" class="%3$s">%4$s</button>',
'submit_field' => '<div class="form-submit">%1$s %2$s</div>',
'fields' => [
'author' => '',
'email' => '',
'url' => '',
'cookies' => '',
],
];
function get_all_nested_replies($comment_id, $post_id) {
$all_replies = [];
$direct_replies = get_comments([
'post_id' => $post_id,
'status' => 'approve',
'parent' => $comment_id,
'order' => 'ASC'
]);
$all_replies = array_merge($all_replies, $direct_replies);
foreach ($direct_replies as $reply) {
$all_replies = array_merge($all_replies, get_all_nested_replies($reply->comment_ID, $post_id));
}
return $all_replies;
}
foreach ($context['top_level_comments'] as $comment) {
$comment->replies = get_all_nested_replies($comment->comment_ID, $post->ID);
}
Timber::render('/blog/comments/comments.twig', $context);
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -33,7 +33,7 @@
border-radius: 60px;
overflow: hidden;
display: flex;
align-items: stretch;
align-items: flex-start;
gap: 24px;
position: relative;
}
@ -54,7 +54,7 @@
width: 395px;
border-radius: 60px;
overflow: hidden;
height: auto;
height: 393px;
flex-shrink: 0;
}
.home-card__img:hover img{
@ -69,7 +69,7 @@
}
.home-card__content {
padding: 32px 79px 100px 0;
padding: 32px 79px 0 0;
}
.home-card__content-title {

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

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

@ -1,38 +1,22 @@
<?php
add_filter('timber/context', function($context) {
// Получаем текущую категорию
$current_category = get_queried_object();
$category_id = null;
if (isset($current_category) && !is_wp_error($current_category) && !empty($current_category->term_id)) {
$category_id = $current_category->term_id;
$category_name = $current_category->name;
} else {
$category_name = null;
}
// Формируем аргументы для запроса
// Простой запрос для получения последних постов
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'meta_key' => 'post_views_count', // Предполагаемое мета-поле для просмотров
'orderby' => 'meta_value_num', // Сортировка по числовому значению мета-поля
'order' => 'DESC',
'orderby' => 'date',
'order' => 'DESC'
);
// Если выбрана категория, добавляем фильтр по ней
if ($category_id) {
$args['cat'] = $category_id;
}
// Выполняем запрос
$most_read_query = new WP_Query($args);
$most_read = new Timber\PostQuery($most_read_query);
// Добавляем данные в контекст
$context['most_read'] = $most_read;
$context['current_category'] = $category_name;
$context['category_list'] = get_categories();
// Добавляем отладочную информацию
global $wpdb;
$debug_info = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE meta_key LIKE '%view%' LIMIT 5");
$context['debug_info'] = $debug_info;
return $context;
});

@ -0,0 +1,28 @@
<div class="anons-best">
<h2 class="anons-best__title">{{ function('pll_e', 'САМЫЕ ЧИТАЕМЫЕ') }}:</h2>
<ul class="anons-best__card-wrap">
{% for post in most_read %}
<li class="anons-best__card">
<ul class="anons-best__card-alerts">
{% for category in post.categories %}
<li>
<a href="{{ category.link }}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
<a href="{{post.link}}" class="main-img">
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}">
</a>
<div class="anons-best__card-body">
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a>
<div class="anons-best__card-body__datas">
<p>{{post.date}}</p>
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>

@ -359,12 +359,9 @@ p.discount-description__2 {
color: var(--grey-black);
}
.comment .comment-block p a, .comment .comment-block p button {
.comment .comment-block p a {
color: var(--green-dark);
font-family: inherit;
font-size: inherit;
text-decoration: underline;
font-weight: inherit;
}
.comment .comment-user {
@ -457,16 +454,4 @@ p.discount-description__2 {
.other-home {
padding-top: 36px !important;
}
/* comment */
.wp-block-video video {
vertical-align: middle;
width: 100%;
max-height: 640px;
width: auto;
max-width: 100%;
margin-left: auto;
margin-right: auto;
display: block;
}
/* comment */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 453 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

@ -1,7 +0,0 @@
.blog-notice{
font-size: .8em;
font-weight: 300;
color: rgba(0, 0, 0, 0.55);
padding-top: .3rem;
padding-bottom: .3rem;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

@ -1,48 +0,0 @@
<?php
function notice_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['content'] = get_field('content');
// Проверяем, есть ли картинка превью в блоке
if ($is_preview && !empty($block['data']['preview_image'])) {
echo '<img src="' . esc_url($block['data']['preview_image']) . '" alt="Preview" style="max-width: 100%; height: auto;">';
return;
}
Timber::render('modules/blog/editor-blocks/notice/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_notice',
'title' => __('GP - Notice'),
'description' => __('A block to serve a text notice'),
'render_callback' => 'notice_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'notice', 'simple block', 'gp-block',),
'mode' => 'preview',
'example' => array(
'attributes' => array(
'data' => array(
'is_preview' => true,
'preview_image' => get_template_directory_uri() . '/modules/blog/editor-blocks/notice/assets/img/preview.png'
)
)
),
'enqueue_assets' => function(){
wp_enqueue_style('gp_notice_style', get_template_directory_uri() . '/modules/blog/editor-blocks/notice/assets/css/style.css', array(), '5.0', 'all');
}
));
}
});
?>

@ -1,4 +0,0 @@
<section class="blog-notice">
{{ content }}
</section>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 KiB

After

Width:  |  Height:  |  Size: 683 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

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

@ -14,19 +14,19 @@ class BlogPost extends \Timber\Post
}
public function get_author_name()
{
if (get_field('post_author_name', $this->ID)){
return get_the_title(get_field('post_author_name', $this->ID));
if (get_field('post_author', $this->ID)){
return get_the_title(get_field('post_author', $this->ID));
}
return false;
}
public function get_author_img()
{
$id = get_field('post_author_name', $this->ID);
$id = get_field('post_author', $this->ID);
return get_the_post_thumbnail_url( $id, 'thumbnail' );
}
public function get_author_link()
{
$id = get_field('post_author_name', $this->ID);
$id = get_field('post_author', $this->ID);
if ($id) {
return get_permalink($id);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

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

Loading…
Cancel
Save