Compare commits

..

30 Commits

Author SHA1 Message Date
Максим Максимов c732040f75 Andrei | изменил логику конструктора товаров. Исключил дубли при двойном значении аттрибута, добавил проверку по полному совпадению категорий 20 hours ago
Максим Максимов f88fd2b39f Andrei | исправления после натяжки single страницы 21 hours ago
Максим Максимов ad2f1f4268 Andrei | добавил попап для отображения всех характеристик товара 22 hours ago
Максим Максимов 3d0813989b TAsk 7783 | Доработка карточки товара (добавил попап для ингридиентов) 22 hours ago
Максим Максимов a9f298cbc9 Andrei | рефакторинг - заменил в карточке товара все вызовы функций на методы класса CosmopetProduct 22 hours ago
Максим Максимов f062cbf11f Andrei | wip: refacting module shop 22 hours ago
Максим Максимов d6ae2ec32f Task 7719 | натяжка верстки single страницы товара 22 hours ago
Максим Максимов 8a26495373 Task 7719 | натяжка верстки single товара. 22 hours ago
Максим Максимов 69a3325070 Task 7719 | натяжка верстки single страницы товара 22 hours ago
Максим Максимов fb27b4b04c Andrei | зафиксировал изменения по рефакторингу 22 hours ago
Максим Максимов 5c7182812d Task 7775 | изменил robots.txt добавил в гÐgitignore 22 hours ago
Максим Максимов 3077d7ee75 Task 7715 | добавил динамическое разбиение цены доставки на цена + НДС 22 hours ago
Максим Максимов 893472a4b9 Task 7715 | исправлено отображение цен доставки на цену с учетом НДС 22 hours ago
Максим Максимов cbc6e74957 Task 7721 | Доработки бота отправки заказов 22 hours ago
Максим Максимов a83df458dc Andrei | fix texts lang in static pages 22 hours ago
Максим Максимов c3e02ed8fc Task 7719 | fix product class definition 7 days ago
Максим Максимов 8cbe7e8aaa Task 7719 | fix пути в main page 7 days ago
Максим Максимов 8e354cb729 Task 7719 | натяжка верстки single товара. 7 days ago
Максим Максимов 7499a8aa24 Task 7719 | натяжка верстки single страницы товара 1 week ago
Максим Максимов 6e2a763cb7 Andrei | зафиксировал изменения по рефакторингу 1 week ago
Максим Максимов 377cabf3cc Task 7515 | правки по верстке (добавил к слайдерам буллеты и стрелочки, изменил главный экран на телефоне и ширину карточек товара в блоке рекоммендуемые, пофиксил кнопку читать подробный отзыв) 2 weeks ago
Максим Максимов 36fda393f6 Task 7515 | верстка отдельной страницы товара 2 weeks ago
Максим Максимов b241ce250b Andrei | fix comment template path recursive 2 weeks ago
Максим Максимов 1f2bfa9fbb Andrei | fix blog featured slider styles 2 weeks ago
Максим Максимов 1fa876ba0a Andrei | fix old tempalte main page style path 2 weeks ago
Максим Максимов e196205d2a Andrei | fix sitemode variable in twig templates didnt work 2 weeks ago
Максим Максимов f49c8e2741 Andrei | fixes of styles conflicts overlay 2 weeks ago
Максим Максимов c4fcf438a4 Andrei | fix style includes for new main page 3 weeks ago
Максим Максимов de3c9caf0f Task 7497 | добавил превью изображение для блока сноска для текста 3 weeks ago
Максим Максимов 8cff3ba603 Task 7497 | добавил новый тип блока в блог (сноска для текста) 3 weeks ago
  1. 49
      wp-content/themes/cosmopet/assets/modules/shop/css/cart-loading.css
  2. 746
      wp-content/themes/cosmopet/assets/modules/shop/css/checkout.css
  3. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-core.css
  4. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-desktop.css
  5. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-mobile.css
  6. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-order.css
  7. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-tablet.css
  8. 0
      wp-content/themes/cosmopet/assets/modules/shop/css/gp-style-ultra.css
  9. 901
      wp-content/themes/cosmopet/assets/modules/shop/css/product-style.css
  10. 17
      wp-content/themes/cosmopet/functions.php
  11. 380
      wp-content/themes/cosmopet/global-functions/metrics-functions.php
  12. 88
      wp-content/themes/cosmopet/global-functions/multilang-functions.php
  13. 387
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  14. 18
      wp-content/themes/cosmopet/global-functions/seo-functions.php
  15. 30
      wp-content/themes/cosmopet/modules/layout/assets/css/core-styles.css
  16. 693
      wp-content/themes/cosmopet/modules/shop/CosmopetProduct.php
  17. 173
      wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
  18. 12
      wp-content/themes/cosmopet/modules/shop/components/catalog/assets/js/gp-main.js
  19. 2
      wp-content/themes/cosmopet/modules/shop/components/catalog/component-controller.php
  20. 327
      wp-content/themes/cosmopet/modules/shop/components/product-card/assets/css/product-card.css
  21. 6
      wp-content/themes/cosmopet/modules/shop/components/product-card/assets/js/product-card.js
  22. 959
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/css/product-style.css
  23. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/avg.svg
  24. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/beef.svg
  25. 5
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/dog-face.svg
  26. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/fish.svg
  27. 5
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/lamb.svg
  28. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/lg.svg
  29. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/mini.svg
  30. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/cat.png
  31. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/cat.png.webp
  32. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/dog.png
  33. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/dog.png.webp
  34. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/mini-dog.png
  35. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/pet/mini-dog.png.webp
  36. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/arrow-back.svg
  37. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/arrow-breadcrumbs.svg
  38. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/arrow-left.svg
  39. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/arrow-right.svg
  40. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/arrow-selected.svg
  41. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/svg/main/black-x.svg
  42. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/img/turkey.svg
  43. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/js/cart-controls.js
  44. 98
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/assets/js/product-single.js
  45. 20
      wp-content/themes/cosmopet/modules/shop/components/product-single--new/component-controller.php
  46. 49
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/cart-loading.css
  47. 515
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-core.css
  48. 1706
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-desktop.css
  49. 336
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-mobile.css
  50. 241
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-order.css
  51. 352
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-tablet.css
  52. 4
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/css/gp-style-ultra.css
  53. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/cat.png
  54. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/cat.png.webp
  55. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/dog.png
  56. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/dog.png.webp
  57. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/mini-dog.png
  58. BIN
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/pet/mini-dog.png.webp
  59. 5
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/arrow-back.svg
  60. 3
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/arrow-breadcrumbs.svg
  61. 5
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/arrow-left.svg
  62. 5
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/arrow-right.svg
  63. 11
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/arrow-selected.svg
  64. 11
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/img/svg/main/black-x.svg
  65. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/js/gp-form.js
  66. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/js/gp-main.js
  67. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/js/gp-product.js
  68. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/js/tabs.js
  69. 0
      wp-content/themes/cosmopet/modules/shop/components/product-single/assets/js/toggle.js
  70. 156
      wp-content/themes/cosmopet/modules/shop/components/product-single/component-controller.php
  71. 331
      wp-content/themes/cosmopet/modules/shop/components/reviews/assets/css/reviews.css
  72. 13
      wp-content/themes/cosmopet/modules/shop/components/reviews/assets/js/reviews.js
  73. 152
      wp-content/themes/cosmopet/modules/shop/components/single-product/component-controller.php
  74. 58
      wp-content/themes/cosmopet/modules/shop/module-ajax-controller.php
  75. 1
      wp-content/themes/cosmopet/modules/shop/module-controller.php
  76. 15
      wp-content/themes/cosmopet/modules/static-pages/new-front-page/template-new-front-page.php
  77. 7
      wp-content/themes/cosmopet/page.php
  78. 6
      wp-content/themes/cosmopet/single-blog_author.php
  79. 6
      wp-content/themes/cosmopet/single-post.php
  80. 12
      wp-content/themes/cosmopet/single-product.php
  81. 26
      wp-content/themes/cosmopet/single.php
  82. 520
      wp-content/themes/cosmopet/static/css/new-front-page-style.css
  83. 14
      wp-content/themes/cosmopet/static/js/new-front-page.js
  84. 23
      wp-content/themes/cosmopet/temp-functions/ajax-logic.php
  85. 128
      wp-content/themes/cosmopet/temp-functions/timber-logic.php
  86. 3
      wp-content/themes/cosmopet/temp-functions/woocommerce-logic.php
  87. 38
      wp-content/themes/cosmopet/templates/_pages/new-front-page.twig
  88. 9
      wp-content/themes/cosmopet/templates/_pages/new-front-page/main-food.twig
  89. 19
      wp-content/themes/cosmopet/templates/profile/profile-orders.twig
  90. 27
      wp-content/themes/cosmopet/templates/profile/profile.twig
  91. 66
      wp-content/themes/cosmopet/templates/shop/product-card_element.twig
  92. 0
      wp-content/themes/cosmopet/views/404.twig
  93. 4
      wp-content/themes/cosmopet/views/_blocks/shop/archive-product-ajaxload.twig
  94. 0
      wp-content/themes/cosmopet/views/_blocks/shop/archive-product-tease.twig
  95. 0
      wp-content/themes/cosmopet/views/_pages/about.twig
  96. 0
      wp-content/themes/cosmopet/views/_pages/front-page.twig
  97. 37
      wp-content/themes/cosmopet/views/_pages/new-front-page.twig
  98. 0
      wp-content/themes/cosmopet/views/_pages/new-front-page/main-about.twig
  99. 0
      wp-content/themes/cosmopet/views/_pages/new-front-page/main-bot.twig
  100. 0
      wp-content/themes/cosmopet/views/_pages/new-front-page/main-cosmopetx.twig
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,49 @@
/* Стили для загрузки корзины на 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;
}

@ -0,0 +1,746 @@
.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;
}
}

@ -0,0 +1,901 @@
/* 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;
}

@ -24,5 +24,22 @@ 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,380 @@
<?
/**
* Добавление событий контрибуции для 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';
}
}

@ -1842,50 +1842,50 @@ pll_register_string('This item is not on our website yet, but it will be here ve
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, пожалуйста, выберите другой способ доставки'
]
];
$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, пожалуйста, выберите другой способ доставки'
]
];

@ -36,390 +36,3 @@ add_filter('timber/twig', function (\Twig\Environment $twig) {
add_filter('woocommerce_currency_symbol', function($currency_symbol, $currency) {
return $currency === 'AED' ? 'AED' : $currency_symbol;
}, 10, 2);
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');
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";
}
});
/**
* Добавление событий контрибуции для FP Pixel
* только на боевом сайте АЕ
*/
if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
// Проверка на тестовый режим для метрик
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 round_price_with_tax($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 round_price_with_tax($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 round_price_with_tax($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' => round_price_with_tax($product->get_price()),
'quantity' => $item->get_quantity()
];
}
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'Purchase', {
value: <?php echo round_price_with_tax($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 round_price_with_tax($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' => round_price_with_tax($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' => round_price_with_tax(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'] = round_price_with_tax(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' => round_price_with_tax(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' => round_price_with_tax(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' => round_price_with_tax(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';
}
}

@ -0,0 +1,18 @@
<?
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";
}
});

@ -474,9 +474,16 @@ textarea{
.wrapper {
margin: 0 auto;
max-width: 1600px;
padding-left: 24px;
padding-right: 24px;
}
@media (max-width: 576px) {
.wrapper {
padding-left: 10px;
padding-right: 10px;
}
}
.modal {
display: none;
}
@ -2217,4 +2224,25 @@ textarea{
a, button{
cursor: pointer;
}
.slider-button{
width: 48px;
height: 48px;
border: 1px solid #121212;
border-radius: 20px;
background-repeat: no-repeat;
background-position: center;
background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 12.364H4.5' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cpath d='M21 12.364L14.636 18.728' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cpath d='M21 12.364L14.636 6.00005' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' /%3E%3C/svg%3E");
}
.slider-button-prev{
transform: scaleX(-1);
}
.swiper-button-disabled{
opacity: .5;
cursor: default;
}

@ -0,0 +1,693 @@
<?php
use Timber;
use Timber\PostCollection;
use Timber\Integrations\WooCommerce\Product as TimberProduct;
class CosmopetProduct extends TimberProduct {
protected $sibling_categories = [
'pa_compound',
'pa_dog-size',
'pa_reproductive-status',
'pa_age-of-the-cat',
'pa_age-of-the-dog',
'pa_series',
];
public function __construct ($pid = null) {
parent::__construct($pid);
}
public function getComposition() {
return get_post_meta($this->id, '_composition', true);
}
public function getImageGallery($size) {
// Инициализируем массив для результатов
$images_array = array();
// Получаем ID основного изображения товара
$thumbnail_id = get_post_thumbnail_id($this->id);
// Добавляем основное изображение
if ($thumbnail_id) {
$images_array[] = array(
'url' => wp_get_attachment_image_url($thumbnail_id, $size),
'alt' => get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true)
);
} else {
// Используем заглушку, если нет основного изображения
$images_array[] = array(
'url' => wc_placeholder_img_src(),
'alt' => __('Placeholder image', 'woocommerce')
);
}
// Получаем галерею изображений
if ($this->product && method_exists($this->product, 'get_gallery_image_ids')) {
$gallery_image_ids = $this->product->get_gallery_image_ids();
} else {
$gallery_image_ids = [];
}
// Добавляем изображения из галереи
if (!empty($gallery_image_ids)) {
foreach ($gallery_image_ids as $image_id) {
$image_url = wp_get_attachment_image_url($image_id, $size);
if ($image_url) {
$images_array[] = array(
'url' => $image_url,
'alt' => get_post_meta($image_id, '_wp_attachment_image_alt', true)
);
}
}
}
return $images_array;
}
public function get_weight() {
$custom_measurement = get_post_meta($this->id, '_custom_measurement', true) ?: pll__('кг');
$custom_size = get_post_meta($this->id, '_size_for_display', true) ?: '';
if ($custom_size){
return $custom_size ? $custom_size . ' ' . $custom_measurement : '';
}
else{
if ($this->product && method_exists($this->product, 'get_weight')) {
return $this->product->get_weight() ? $this->product->get_weight() . ' ' . $custom_measurement : '';
}
return '';
}
return '';
}
public function getNumericWeight() {
$custom_size = get_post_meta($this->id, '_size_for_display', true) ?: '';
if ($custom_size){
return floatval($custom_size);
}
else{
if ($this->product && method_exists($this->product, 'get_weight')) {
return floatval($this->product->get_weight());
}
return 0;
}
return 0;
}
/**
* Получает CSS класс вкуса для товара
* @return string CSS класс вкуса (например, --food-fish, --treats-beef)
*/
public function getTasteClass() {
// Получаем категории товара
$product_categories = wp_get_post_terms( $this->product->get_id(), 'product_cat' );
$is_food = false;
$is_treats = false;
// Определяем тип товара (корм или лакомство) по slug
foreach ( $product_categories as $cat ) {
if ( $cat->slug === 'korm' ) {
$is_food = true;
} elseif ( $cat->slug === 'lakomstva' ) {
$is_treats = true;
}
}
// Определяем префикс типа товара
$type_prefix = '';
if ($is_food) {
$type_prefix = 'food';
} elseif ($is_treats) {
$type_prefix = 'treats';
} else {
$type_prefix = 'acc'; // Дефолтный тип
}
// Получаем термины атрибута compound (вкус)
$compound_terms = get_the_terms($this->id, 'pa_compound');
$taste_suffix = '';
if ($compound_terms && !is_wp_error($compound_terms)) {
foreach ($compound_terms as $term) {
switch ($term->slug) {
case 'govyadina':
$taste_suffix = 'beef';
break;
case 'indejka':
$taste_suffix = 'turkey';
break;
case 'krolik':
$taste_suffix = 'rabbit';
break;
case 'losos':
$taste_suffix = 'salmon';
break;
case 'ryba':
$taste_suffix = 'fish';
break;
case 'utka':
$taste_suffix = 'duck';
break;
case 'yagnenok':
$taste_suffix = 'lamb';
break;
}
// Если нашли вкус, прерываем цикл
if ($taste_suffix) {
break;
}
}
}
// Если вкус не найден, используем дефолтные суффиксы по типу товара
if (!$taste_suffix) {
if ($is_food) {
$taste_suffix = 'fish';
} elseif ($is_treats) {
$taste_suffix = 'beef';
} else {
$taste_suffix = ''; // Дефолтный суффикс
}
}
return '--' . $type_prefix . '-' . $taste_suffix;
}
public function getSizeSiblings() {
$term = get_the_terms($this->id, 'pa_collection');
if ($term) {
$term = $term[0]->term_id;
} else {
return [];
}
$args = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order' => 'ASC',
'orderby' => 'name', // Fixed parameter name (was 'order_by')
'tax_query' => [
[
'taxonomy' => 'pa_collection',
'terms' => $term,
'field' => 'id',
]
],
);
$siblings = Timber::get_posts($args);
// Create array with products and their weights
$siblings_with_weights = [];
foreach ($siblings as $sibling) {
$weight = $sibling->get_weight();
$siblings_with_weights[] = [
'post' => $sibling,
'weight' => floatval($weight) // Ensure weight is treated as a number
];
}
// Sort by weight
usort($siblings_with_weights, function($a, $b) {
return $a['weight'] <=> $b['weight'];
});
// Extract just the posts in sorted order
$sorted_siblings = array_map(function($item) {
return $item['post'];
}, $siblings_with_weights);
return $sorted_siblings;
}
protected function get_category_products() {
// Получаем категории текущего товара
$current_product_categories = get_the_terms($this->id, 'product_cat');
if (!$current_product_categories || is_wp_error($current_product_categories)) {
return [];
}
$current_category_ids = array_map(function($cat) {
return $cat->term_id;
}, $current_product_categories);
// Получаем текущий товар
$current_product = Timber::get_post($this->id);
// Получаем ВСЕ товары
$args = array(
'posts_per_page' => -1,
'post_type' => 'product',
'order' => 'ASC',
'orderby' => 'name',
'post_status' => 'publish',
'tax_query' => [
[
'taxonomy' => 'product_visibility',
'field' => 'slug',
'terms' => 'exclude-from-catalog',
'operator' => 'NOT IN'
]
],
'fields' => 'ids' // Получаем только ID товаров для оптимизации
);
$all_products = Timber::get_posts($args);
$matching_products = [];
foreach ($all_products as $product) {
// Получаем категории товара
$product_categories = get_the_terms($product->ID, 'product_cat');
if (!$product_categories || is_wp_error($product_categories)) {
continue;
}
$product_category_ids = array_map(function($cat) {
return $cat->term_id;
}, $product_categories);
// Проверяем полное совпадение категорий
if (empty(array_diff($current_category_ids, $product_category_ids)) &&
empty(array_diff($product_category_ids, $current_category_ids))) {
$matching_products[] = $product;
}
}
// Добавляем текущий товар в начало массива
if ($current_product) {
array_unshift($matching_products, $current_product);
}
error_log("get_category_products: Полное совпадение категорий. Найдено товаров: " . count($matching_products));
return $matching_products;
}
public function getProductConstructor() {
$all_products = $this->get_category_products();
$constructor = [];
// Получаем атрибуты текущего товара
$current_product_attributes = [];
$current_weight = $this->getNumericWeight();
// Получаем значения атрибутов текущего товара
foreach ($this->sibling_categories as $taxonomy) {
$terms = get_the_terms($this->id, $taxonomy);
if ($terms && !is_wp_error($terms)) {
$current_product_attributes[$taxonomy] = array_map(function($term) {
return $term->term_id;
}, $terms);
}
}
// Получаем упорядоченные таксономии
$ordered_taxonomies = $this->getOrderedTaxonomies();
// Инициализируем конструктор для всех таксономий
foreach ($this->sibling_categories as $taxonomy) {
if (isset($current_product_attributes[$taxonomy])) {
$constructor[$taxonomy] = [
'taxonomy' => $taxonomy,
'label' => $this->getAttributeLabel($taxonomy),
'current_value' => $this->getCurrentAttributeValue($taxonomy),
'options' => []
];
}
}
// Создаем массив для отслеживания уже добавленных товаров по таксономиям
$added_products = [];
foreach (array_keys($constructor) as $taxonomy) {
$added_products[$taxonomy] = [];
}
foreach ($all_products as $product) {
$compare_attributes = [];
$compare_weight = $product->getNumericWeight();
foreach ($this->sibling_categories as $taxonomy) {
$terms = get_the_terms($product->id, $taxonomy);
if ($terms && !is_wp_error($terms)) {
$compare_attributes[$taxonomy] = array_map(function($term) {
return $term->term_id;
}, $terms);
}
}
// Проверяем для каждой таксономии, куда можно добавить этот товар
foreach ($this->sibling_categories as $taxonomy) {
if (!isset($current_product_attributes[$taxonomy]) ||
!isset($constructor[$taxonomy]) ||
in_array($product->id, $added_products[$taxonomy])) {
continue;
}
$attributes_match = true;
foreach ($this->sibling_categories as $compare_taxonomy) {
if ($compare_taxonomy === $taxonomy) continue;
if (isset($current_product_attributes[$compare_taxonomy])) {
if (!isset($compare_attributes[$compare_taxonomy])) {
$attributes_match = false;
break;
}
$current_values = $current_product_attributes[$compare_taxonomy];
$compare_values = $compare_attributes[$compare_taxonomy];
if (array_diff($current_values, $compare_values) !== [] ||
array_diff($compare_values, $current_values) !== []) {
$attributes_match = false;
break;
}
} else {
if (isset($compare_attributes[$compare_taxonomy])) {
$attributes_match = false;
break;
}
}
}
if (abs($current_weight - $compare_weight) > 0.01) {
$attributes_match = false;
}
if ($attributes_match) {
$product_terms = get_the_terms($product->id, $taxonomy);
if ($product_terms && !is_wp_error($product_terms)) {
foreach ($product_terms as $term) {
$option_key = $term->term_id;
if (!isset($constructor[$taxonomy]['options'][$option_key])) {
$constructor[$taxonomy]['options'][$option_key] = [
'term_id' => $term->term_id,
'name' => $this->getTermName($term->term_id, $taxonomy),
'slug' => $term->slug,
'icon' => $this->getTermIcon($term->term_id, $taxonomy),
'products' => []
];
}
// Добавляем товар только если его еще нет в этой опции
if (!in_array($product->id, $added_products[$taxonomy])) {
$constructor[$taxonomy]['options'][$option_key]['products'][] = $product;
$added_products[$taxonomy][] = $product->id;
}
}
}
}
}
}
// Сортируем опции по порядку терминов для каждой таксономии
foreach ($constructor as $taxonomy => $taxonomy_data) {
if (isset($ordered_taxonomies[$taxonomy])) {
$ordered_options = [];
foreach ($ordered_taxonomies[$taxonomy] as $term) {
if (isset($constructor[$taxonomy]['options'][$term->term_id])) {
$ordered_options[$term->term_id] = $constructor[$taxonomy]['options'][$term->term_id];
}
}
$constructor[$taxonomy]['options'] = $ordered_options;
}
}
// Сортируем итоговый конструктор по порядку таксономий
$ordered_constructor = [];
foreach ($this->sibling_categories as $taxonomy) {
if (isset($constructor[$taxonomy])) {
$ordered_constructor[$taxonomy] = $constructor[$taxonomy];
}
}
return $ordered_constructor;
}
protected function getAttributeLabel($taxonomy) {
// Fallback на старые метки
$labels = [
'pa_age-of-the-cat' => pll__('ВОЗРАСТ КОШКИ'),
'pa_age-of-the-dog' => pll__('ВОЗРАСТ СОБАКИ'),
'pa_dog-size' => pll__('РАЗМЕР СОБАКИ'),
'pa_compound' => pll__('ВКУС КОРМА'),
'pa_reproductive-status' => pll__('ВИД КОШКИ'),
'pa_series' => pll__('СЕРИЯ'),
];
return $labels[$taxonomy] ?? wc_attribute_label($taxonomy);
}
protected function getCurrentAttributeValue($taxonomy) {
$terms = get_the_terms($this->id, $taxonomy);
if ($terms && !is_wp_error($terms)) {
return $terms[0]->term_id;
}
return null;
}
/**
* Получает таксономии в правильном порядке с учетом сортировки
* @return array Массив таксономий с их порядком
*/
protected function getOrderedTaxonomies() {
$ordered_taxonomies = [];
foreach ($this->sibling_categories as $taxonomy) {
// Получаем все термины для данной таксономии
$terms = get_terms([
'taxonomy' => $taxonomy,
'hide_empty' => false,
'orderby' => 'menu_order',
'order' => 'ASC'
]);
// Если menu_order не работает, пробуем сортировку по name
if (is_wp_error($terms) || empty($terms)) {
$terms = get_terms([
'taxonomy' => $taxonomy,
'hide_empty' => false,
'orderby' => 'name',
'order' => 'ASC'
]);
}
if (!is_wp_error($terms) && !empty($terms)) {
$ordered_taxonomies[$taxonomy] = $terms;
}
}
return $ordered_taxonomies;
}
/**
* Получает таксономии в правильном порядке для отображения
* @return array Массив таксономий в порядке отображения
*/
public function getOrderedSiblingCategories() {
return $this->sibling_categories;
}
/**
* Получает таксономии с их метками в правильном порядке
* @return array Массив таксономий с метками
*/
public function getOrderedTaxonomiesWithLabels() {
$taxonomies_with_labels = [];
foreach ($this->sibling_categories as $taxonomy) {
$label = $this->getAttributeLabel($taxonomy);
$taxonomies_with_labels[$taxonomy] = $label;
}
return $taxonomies_with_labels;
}
/**
* Получает иконку термина из ACF поля
* @param int $term_id ID термина
* @param string $taxonomy Таксономия
* @return string|false URL иконки или false если иконка не найдена
*/
public function getTermIcon($term_id, $taxonomy) {
// Проверяем, есть ли ACF поле 'icon' у термина
$icon = get_field('icon', $taxonomy . '_' . $term_id);
if ($icon) {
return $icon;
}
// Если ACF поле не найдено, возвращаем false
return false;
}
/**
* Получает название термина с приоритетом описания
* @param int $term_id ID термина
* @param string $taxonomy Таксономия
* @return string Название термина
*/
public function getTermName($term_id, $taxonomy) {
$term = get_term($term_id, $taxonomy);
if (!$term || is_wp_error($term)) {
return '';
}
// Сначала пытаемся получить описание термина
$description = get_term_meta($term_id, 'description', true);
// Также пробуем получить из ACF поля
$acf_description = get_field('description', $taxonomy . '_' . $term_id);
// Пробуем получить из стандартного поля термина
$term_description = $term->description;
// Пробуем ACF поле сначала
if (!empty($acf_description)) {
return $acf_description;
}
// Потом стандартное поле термина
if (!empty($term_description)) {
return $term_description;
}
// Потом обычное мета-поле
if (!empty($description)) {
return $description;
}
return $term->name;
}
/**
* Получает количество товара в корзине
* @return int Количество товара в корзине
*/
public function getCartQuantity() {
if (!function_exists('WC') || !WC()->cart) {
return 0;
}
$cart = WC()->cart;
$cart_item_key = $this->getCartItemKey();
if ($cart_item_key) {
$cart_item = $cart->get_cart_item($cart_item_key);
return $cart_item ? $cart_item['quantity'] : 0;
}
return 0;
}
/**
* Получает ключ товара в корзине
* @return string|false Ключ товара в корзине или false если товар не найден
*/
public function getCartItemKey() {
if (!function_exists('WC') || !WC()->cart) {
return false;
}
$cart = WC()->cart;
foreach ($cart->get_cart() as $cart_item_key => $cart_item) {
if ($cart_item['product_id'] == $this->id) {
return $cart_item_key;
}
}
return false;
}
/**
* Проверяет, есть ли товар в корзине
* @return bool True если товар в корзине, false если нет
*/
public function isInCart() {
return $this->getCartQuantity() > 0;
}
public function getAllAttributes() {
$attributes = [];
foreach ($this->sibling_categories as $taxonomy) {
$terms = get_the_terms($this->id, $taxonomy);
if ($terms && !is_wp_error($terms)) {
$attributes[$taxonomy] = [];
foreach ($terms as $term) {
$attributes[$taxonomy][] = [
'term_id' => $term->term_id,
'name' => $term->name,
'slug' => $term->slug
];
}
}
}
return $attributes;
}
public function getPriceWithCurrency(){
$price = $this->product->get_price() . ' ' . get_woocommerce_currency_symbol();
return $price;
}
public function getRegularPriceWithCurrency(){
$regular_price = $this->product->get_regular_price() . ' ' . get_woocommerce_currency_symbol();
if ($regular_price != $this->getPriceWithCurrency()){
return $regular_price;
}
else{
return '';
}
}
public function getPriceDifferenceInPercent(){
$regular_price = $this->product->get_regular_price();
$price = $this->product->get_price();
$difference = ($regular_price - $price) / $regular_price * 100;
$difference = round($difference, 0) . '%';
return $difference;
}
public function getReviews(){
$reviews = get_posts(array(
'post_type' => 'p_reviews',
'numberposts' => -1,
'meta_query' => array(
array(
'key' => 'products',
'value' => '"' . $this->id . '"',
'compare' => 'LIKE'
)
)
));
return $reviews;
}
public function getRelatedProducts(){
$related_products = [];
$related_products_ids = $this->product->get_upsell_ids();
if ($related_products_ids) {
foreach ($related_products_ids as $related_id) {
$related_product = Timber::get_post($related_id);
if ($related_product) {
$related_products[] = $related_product;
}
}
}
return $related_products;
}
};

@ -1,4 +1,26 @@
jQuery(document).ready(function($) {
$(document).on('click', '.product-incart__btn--plus', function(e) {
e.preventDefault();
const key = $(this).data('key');
const quantity = parseInt($(this).siblings('.product-incart__count').text()) + 1;
updateCart(key, quantity);
$('.product-incart__wrap').addClass('loading');
});
// // Уменьшение количества
$(document).on('click', '.product-incart__btn--minus', function(e) {
e.preventDefault();
const key = $(this).data('key');
const quantity = parseInt($(this).siblings('.product-incart__count').text()) - 1;
$('.product-incart__wrap').addClass('loading');
if (quantity <= 0) {
removeItem(key); // Вызываем удаление, если количество становится 0
} else {
updateCart(key, quantity); // Обновляем количество, если больше 0
}
});
// Открытие/закрытие модалки
// $(document).on('click', '.cart-contents, .continue-shopping, .modal__close', function(e) {
// e.preventDefault();
@ -19,7 +41,7 @@ jQuery(document).ready(function($) {
});
$(document).on('click', '.modal__basket .counter__button.plus', function(e) {
$(document).on('click', '.modal__basket .counter__button.plus, .product-incart__btn--plus', function(e) {
e.preventDefault();
const key = $(this).data('key');
const input = $(this).siblings('.counter__input');
@ -28,7 +50,7 @@ jQuery(document).ready(function($) {
});
// // Уменьшение количества
$(document).on('click', '.modal__basket .counter__button.minus', function(e) {
$(document).on('click', '.modal__basket .counter__button.minus, .product-incart__btn--minus', function(e) {
e.preventDefault();
const key = $(this).data('key');
const input = $(this).siblings('.counter__input');
@ -144,6 +166,9 @@ jQuery(document).ready(function($) {
updateCartFragment();
updateNotices();
// Обновляем блок покупки на single странице
updateProductBuyBlock();
// $('[data-key="' + key + '"]').remove()
}
}
@ -182,6 +207,9 @@ jQuery(document).ready(function($) {
updateCartFragment();
updateNotices();
// Обновляем блок покупки на single странице
updateProductBuyBlock();
}
}
});
@ -241,10 +269,13 @@ jQuery(document).ready(function($) {
}
// Обновление корзины при добавлении товара
$(document.body).on('added_to_cart', function() {
$(document.body).on('added_to_cart', function(e, fragments, cart_hash, $button) {
updateCartFragment();
updateNotices();
openBasketOnFirstAdd();
// Обновляем блок покупки на single странице
updateProductBuyBlock();
});
// Функция обновления количества
@ -262,11 +293,16 @@ jQuery(document).ready(function($) {
},
complete: function() {
$('#modal-basket').removeClass('loading');
$('.product-incart__wrap').removeClass('loading');
},
success: function(response) {
if (response.success) {
updateCartFragment(update_full);
updateNotices();
// Обновляем блок покупки на single странице
updateProductBuyBlock();
} else {
console.error('Ошибка при обновлении корзины');
}
@ -398,6 +434,9 @@ jQuery(document).ready(function($) {
updateCartFragment();
updateNotices();
openBasketOnFirstAdd();
// Обновляем блок с кнопкой покупки на single странице
updateProductBuyBlock();
}
},
complete: function() {
@ -412,6 +451,132 @@ jQuery(document).ready(function($) {
});
// ===== ФУНКЦИИ ДЛЯ SINGLE СТРАНИЦЫ ===
// Обновление количества через input на single странице
$(document).on('change', '.product-incart__count', function () {
const $count = $(this);
const $wrap = $count.closest('.product-incart__wrap');
const key = $count.data('key');
const quantity = parseInt($count.text(), 10);
if (quantity > 0) {
if (key) {
updateCart(key, quantity);
}
} else {
if (key) {
removeItem(key);
}
}
});
// Увеличение количества на single странице
$(document).on('click', '.product-incart__btn--plus', function(e) {
e.preventDefault();
const $btn = $(this);
const $wrap = $btn.closest('.product-incart__wrap');
const $count = $wrap.find('.product-incart__count');
const key = $btn.data('key');
const currentQuantity = parseInt($count.text());
const newQuantity = currentQuantity + 1;
// Показываем загрузку
$wrap.addClass('loading');
// Обновляем количество через updateCart
if (key) {
updateCart(key, newQuantity);
}
});
// Уменьшение количества на single странице
$(document).on('click', '.product-incart__btn--minus', function(e) {
e.preventDefault();
const $btn = $(this);
const $wrap = $btn.closest('.product-incart__wrap');
const $count = $wrap.find('.product-incart__count');
const key = $btn.data('key');
const currentQuantity = parseInt($count.text());
const newQuantity = currentQuantity - 1;
if (newQuantity <= 0) {
// Показываем загрузку
$wrap.addClass('loading');
// Удаляем товар из корзины
if (key) {
removeItem(key);
}
} else {
// Показываем загрузку
$wrap.addClass('loading');
// Обновляем количество через updateCart
if (key) {
updateCart(key, newQuantity);
}
}
});
// Функция обновления блока с кнопкой покупки
function updateProductBuyBlock() {
console.log('Updating product buy block');
// Проверяем, что мы на странице нового шаблона (не старого)
if ($('.detail').length > 0) {
console.log('Old template detected, skipping buy block update');
return;
}
const $container = $('#product-buy-block-wrapper');
if (!$container.length) {
console.log('Product buy block wrapper not found');
return;
}
// Получаем product_id из текущей страницы
const productId = $container.find('[name="add-to-cart"]').val() ||
$container.find('.product-incart__wrap').data('product-id') ||
$('.product-single').data('product-id');
if (!productId) {
console.log('Product ID not found');
return;
}
console.log('Product ID:', productId);
$.ajax({
url: woocommerce_params.ajax_url,
type: 'POST',
data: {
action: 'update_product_buy_block',
product_id: productId
},
success: function(response) {
console.log('Update product buy block response:', response);
if (response.success) {
// Обновляем содержимое контейнера
$container.html(response.data.html);
console.log('HTML updated successfully');
// Если товар добавлен в корзину, обновляем фрагменты корзины
if (response.data.in_cart) {
updateCartFragment();
}
console.log('Product buy block updated successfully');
} else {
console.error('Ошибка обновления блока покупки:', response);
}
},
error: function(xhr, status, error) {
console.error('AJAX ошибка обновления блока покупки:', error);
console.error('Response:', xhr.responseText);
}
});
}
});
@ -419,3 +584,5 @@ jQuery(document).ready(function($) {

@ -107,6 +107,18 @@ jQuery(document).ready(function ($) {
$('#load-more-products').detach();
$('.product__main').append(data);
$('#load-more-products').prependTo('.product__footer');
var productSwiper = new Swiper('.main-food_products-card-slider', {
effect: 'fade',
fadeEffect: { crossFade: true },
loop: true,
pagination: {
el: '.swiper-dots',
clickable: true,
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
},
});
},
error: function(data) {
console.log(data);

@ -137,5 +137,5 @@ $context['posts'] = Timber::get_posts($args);
$context['count'] = count(Timber::get_posts($count_args));
$context['sidebar_filters'] = Timber::get_widgets('sidebar_filters');
Timber::render('_pages/shop/archive-product.twig', $context);
Timber::render('woocommerce/archive-product.twig', $context);
?>

@ -1,3 +1,178 @@
.main-food_products-card-title{
padding: 8px 16px 8px 16px;
border-radius: 36px;
background: #fff;
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
}
.main-food_products-card-bottom {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-top: 10px;
}
.main-food_products-card {
--accent-color: #121212;
border-radius: 30px;
padding: 8px;
width: 265px;
min-width: 194px;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: var(--accent-color);
background-image: linear-gradient(
rgba(255, 255, 255, 0.6),
rgba(255, 255, 255, 0.6)
);
}
.main-food_products-card.--acc-{
background: #e7e7e7;
}
.main-food_products-card.--acc- .main-food_products-cardbottom-btn,
.main-food_products-card.--acc- .main-food_products-card-slider .swiper-pagination-bullet.swiper-pagination-bullet-active{
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, #ee6868 0%, #569ef0 57.69%);
}
.main-food_products-card-img {
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 8px 0px 32px;
padding-bottom:20px;
/* filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.1)); */
}
/* .shadow-svg {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-65%);
width: 80%;
height: auto;
z-index: 0;
pointer-events: none;
} */
.main-food_products-card-img img {
position: relative;
z-index: 1;
display: block;
max-width: 100%;
height: auto;
aspect-ratio: 1/1;
object-fit: contain;
}
.main-food_products-card-title{
padding: 8px 16px 8px 16px;
border-radius: 36px;
background: #fff;
font-weight: 500;
font-size: 12px;
text-transform: uppercase;
color: var(--accent-color);
}
.--food-lamb.main-food_products-card {
--accent-color: #863300;
}
.--food-turkey.main-food_products-card {
--accent-color: #CD0003;
}
.--food-beef.main-food_products-card{
--accent-color: #7e0092;
}
.--food-fish.main-food_products-card{
--accent-color: #48c1ed;
}
.--treats-lamb.main-food_products-card {
--accent-color: #44006c;
}
.--treats-rabbit.main-food_products-card {
--accent-color: #601094;
}
.--treats-beef.main-food_products-card{
--accent-color: #004c31;
}
.--treats-salmon.main-food_products-card{
--accent-color: #7c007a;
}
.--treats-duck.main-food_products-card{
--accent-color: #326e70;
}
.main-food_products-card-bottom {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 8px;
}
.main-food_products-card-bottom-price{
border-radius: 36px;
padding: 10px;
background: #fff;
font-weight: 600;
font-size: 18px;
text-transform: uppercase;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: var(--accent-color);
}
.main-food_products-cardbottom-btn{
border: 2px solid #fff;
border-radius: 36px;
padding: 0px 32px;
height: 42px;
font-weight: 900;
font-size: 12px;
text-align: center;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
transition: all .3s;
background-color: var(--accent-color);
}
.main-food_products-card-slider .swiper-pagination-bullet {
background: #fff;
height: 10px;
width: 10px;
border-radius: 50%;
opacity: 1;
}
.main-food_products-card-slider .swiper-pagination-bullet.swiper-pagination-bullet-active{
background-color: var(--accent-color);
}
.swiper-dots{
position: absolute;
bottom: 16px !important;
display: flex;
justify-content: center;
z-index: 5;
}
.main-food_products-cardbottom-btn .spinner{
height: 17px;
width: 17px;
@ -18,6 +193,7 @@
display: flex;
justify-content: space-around;
margin-bottom: 10px;
margin-top: 10px;
}
.main-food_products-card__weight:empty{
display: none;
@ -37,8 +213,159 @@
color: var(--accent-color);
}
@media (max-width: 1200px) {
.main-food_products-card {
width: calc(50% - 5px);
min-width: 0;
}
}
@media (max-width: 940px) {
.main-food_products-card-img img{
height: 50vw;
}
.main-food_products-card-title{
font-size: 10px;
}
.main-food_products-card-bottom-price{
font-size: 12px;
height: 44px;
padding-left: 10px;
padding-right: 10px;
}
.main-food_products-cardbottom-btn{
font-size: 0;
height: 44px;
width: 44px;
position: relative;
padding: 0;
flex-grow: 0;
}
.main-food_products-cardbottom-btn::after{
background-image: url("data:image/svg+xml,%3Csvg width='18' height='20' viewBox='0 0 18 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.99891 0C10.0882 1.85362e-05 11.1353 0.416463 11.908 1.15941L12.0484 1.30206C12.7329 2.02913 13.1164 2.97793 13.1165 3.96649V5.03207L14.9288 5.02729L15.0941 5.03207C15.4787 5.05208 15.8566 5.14206 16.208 5.29727L16.357 5.36716C16.6986 5.54015 17.0042 5.7742 17.257 6.05744L17.3621 6.18191C17.5979 6.47719 17.7739 6.81389 17.8808 7.17377L17.9228 7.32887C17.9969 7.64101 18.0178 7.96276 17.9849 8.28147L17.9639 8.4404L16.6522 16.6376C16.5114 17.5178 16.0674 18.3238 15.3969 18.9287L15.2603 19.0464C14.5603 19.6238 13.6814 19.9569 12.7659 19.9962L12.5815 20H5.41634C4.49677 19.9999 3.60472 19.7028 2.88179 19.1584L2.73944 19.0464C2.03929 18.4688 1.56066 17.6815 1.37998 16.8119L1.3475 16.6376L0.0357986 8.4404C-0.03187 8.0173 -0.00329994 7.58521 0.118914 7.17377L0.168592 7.02058C0.295244 6.6677 0.489965 6.34073 0.742759 6.05744L0.854535 5.93968C1.12207 5.67071 1.44011 5.45265 1.79174 5.29727L1.94364 5.23408C2.25097 5.11719 2.57599 5.04922 2.90568 5.03207L3.07095 5.02729H4.60525L4.87155 5.03207L4.8823 3.96649C4.88242 2.91203 5.31814 1.90251 6.09082 1.15941L6.2389 1.02346C6.99437 0.365708 7.97783 0.000101636 8.99891 0ZM3.07095 6.92772C2.95004 6.92773 2.83041 6.94761 2.71652 6.9842L2.60378 7.02633C2.49444 7.07468 2.39447 7.13951 2.30763 7.21781L2.22451 7.3011C2.14669 7.38833 2.08465 7.48682 2.04013 7.59215L2.00191 7.69938C1.95855 7.84531 1.94843 7.99859 1.9723 8.1484L3.28495 16.3456L3.32221 16.5256C3.42862 16.9407 3.66723 17.3168 4.00911 17.5989L4.16101 17.7128C4.47324 17.927 4.83998 18.0579 5.22336 18.091L5.41634 18.0996H12.5824L12.7754 18.091C13.223 18.0525 13.6486 17.8809 13.9906 17.5989L14.1301 17.4725C14.4421 17.1647 14.6468 16.7708 14.7148 16.3456L16.0274 8.14935L16.0389 8.03638C16.0424 7.96081 16.0379 7.88502 16.0246 7.81044L15.9978 7.69938C15.9653 7.58999 15.9149 7.48606 15.8478 7.39205L15.7752 7.3011C15.6974 7.21384 15.6049 7.13906 15.502 7.07994L15.3959 7.02633C15.2863 6.9779 15.1689 6.94689 15.0492 6.93442L14.9288 6.92772H13.1165V8.99473C13.1163 9.52694 12.6697 9.94443 12.1363 9.94447C11.6029 9.94439 11.1562 9.52691 11.1561 8.99473V6.92772H6.84172V8.99473C6.84159 9.52685 6.39576 9.9443 5.86249 9.94447C5.32907 9.94447 4.88244 9.52696 4.8823 8.99473V6.92772H3.07095ZM8.99891 1.90043C8.49608 1.90053 8.01257 2.06912 7.62893 2.37147L7.4713 2.50838C7.0677 2.89647 6.84185 3.4213 6.84172 3.96649V4.74102H11.1561V3.96649C11.156 3.48959 10.9841 3.0284 10.6708 2.6606L10.5275 2.50838C10.1235 2.12005 9.57346 1.90045 8.99891 1.90043Z' fill='white' /%3E%3C/svg%3E");
height: 20px;
width: 18px;
background-size: contain;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
content: '';
background-repeat: no-repeat;
}
}
@media (max-width: 640px) {
.main-food_products-card__weight{
display: none;
}
}
/* GP | Mobile */
@media (max-width: 768px) {
.main-food{
padding-top: 2rem;
}
}
.mform__review__media{
display: block;
width: 100%;
max-width: 350px;
}
.product-archive-card{
width: calc(25% - 7.5px);
}
@media (max-width: 1200px) {
.product-archive-card{
width: calc(33.333% - 6.666px);
}
}
@media (max-width: 640px) {
.product-archive-card{
width: calc(50% - 5px);
}
}
.product__main{
gap: 10px;
}
/* Стили для загрузки на карточках товаров */
.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;
}
.main-food_products-card-bottom-nv{
padding: 10px 30px;
font-size: 18px;
text-transform: uppercase;
background-color: #fff;
border-radius: 100px;
color: var(--accent-color);
}
@media (max-width: 1200px) {
.main-food_products-card-bottom-nv{
font-size: 10px;
height: 44px;
padding-left: 6px;
padding-right: 6px;
display: flex;
align-items: center;
}
.main-food_products-card-bottom-price{
flex-shrink: 0;
}
}

@ -13,7 +13,7 @@ jQuery(document).ready(function() {
},
});
jQuery('[data-image-set]').on('click', function() {
jQuery('body').on('click', '[data-image-set]', function() {
// Получаем родительский элемент карточки продукта
var productCard = jQuery(this).closest('.main-food_products-card');
jQuery(productCard).find('.main-food_products-card__weight-item').removeClass('active')
@ -54,4 +54,6 @@ jQuery(document).ready(function() {
jQuery(productCard).find('.main-food_products-cardbottom-btn').attr('data-product_id', jQuery(this).data('product_id'))
jQuery(productCard).find('.main-food_products-cardbottom-btn').attr('href', '?add-to-cart=' + jQuery(this).data('product_id'))
});
});
});

@ -0,0 +1,959 @@
/* 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;
max-width: calc(100% - 1000px);
margin-right: 2rem;
}
@media (max-width: 1200px) {
.product-show{
margin-right: 0;
max-width: 100%;
}
}
@media (max-width: 576px) {
.product_main {
margin-left: -10px;
width: calc(20px + 100%);
}
.product-show{
flex-direction: column;
min-height: calc(100vh - 80px);
margin-right: 0;
max-width: 100%;
}
.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;
}
.product-pp-btn{
display: flex;
justify-content: center;
margin-top: 1rem;
gap: 1rem;
/* Смотреть все */
font-weight: 700;
font-size: 16px;
line-height: 20px;
text-decoration-line: underline;
color: var(--accent-color);
align-items: center;
margin-right: auto;
margin-left: auto;
}
.product-pp-btn svg, .product-pp-btn path{
fill: var(--accent-color);
stroke: var(--accent-color);
}
.mform__info__c{
display: flex;
justify-content: space-between;
margin-top: 2rem;
flex-wrap: wrap;
}
.mform__info__col{
width: 48.5%;
}
.mform__info__col .product-values{
margin-top: 0;
}
@media (max-width: 640px) {
.mform__info__col{
width: 100%;
}
}
.mform__review-wrap{
max-height: 100vh;
overflow: auto;
}

@ -0,0 +1,3 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22.5 4.42414C22.5 3.82477 22.0107 3.33842 21.4077 3.33842C20.9265 3.33842 20.5187 3.64831 20.3734 4.07779C19.6032 3.91446 18.7684 3.58269 18.282 2.91259C17.2059 1.43021 16.5706 0.409387 14.1154 0.506365C11.6602 0.603343 9.4551 4.95424 9.9928 6.58245C10.2092 7.23797 10.7513 7.77681 11.3205 8.1866L10.9589 9.33722H5.08895C4.95544 9.33722 4.8234 9.34669 4.69503 9.36492C4.67889 9.25992 4.64661 9.15565 4.59673 9.05576L2.51048 4.88205C2.25007 4.3607 1.61334 4.14779 1.08884 4.40737C0.564347 4.66622 0.350147 5.29913 0.611294 5.82048L2.69754 9.99419C2.75843 10.1152 2.83985 10.2188 2.93448 10.3048C2.48628 10.8094 2.21339 11.4715 2.21339 12.197V13.7457C2.21339 13.7968 2.21486 13.8471 2.21779 13.8966C2.21632 13.9229 2.21339 13.9499 2.21339 13.9761V21.2881C2.21339 21.9575 2.75916 22.5 3.43257 22.5C4.10598 22.5 4.65175 21.9575 4.65175 21.2881V16.5719C4.78599 16.5924 4.9239 16.6033 5.06401 16.604V21.2881C5.06401 21.9575 5.60978 22.5 6.28318 22.5C6.95659 22.5 7.50236 21.9575 7.50236 21.2881V16.6047H11.4548V21.2881C11.4548 21.9575 12.0006 22.5 12.674 22.5C13.3474 22.5 13.8931 21.9575 13.8931 21.2881V16.604C14.0332 16.6026 14.1712 16.5924 14.3054 16.5719V21.2881C14.3054 21.9575 14.8512 22.5 15.5246 22.5C16.198 22.5 16.7438 21.9575 16.7438 21.2881V13.4293V12.1962C16.7438 11.9943 16.7225 11.7967 16.6821 11.6064C16.7122 11.5342 16.7401 11.4605 16.7636 11.3847L17.3394 9.5545C17.3717 9.45169 17.3959 9.34815 17.415 9.24461C18.8227 9.18993 20.2098 9.00836 20.9456 8.55993C22.1772 7.80817 22.3027 6.15006 22.2469 5.11684C22.4039 4.92872 22.4985 4.68737 22.4985 4.42414H22.5ZM16.8758 5.63527C16.3366 5.63527 15.8994 5.20069 15.8994 4.66476C15.8994 4.12883 16.3366 3.69425 16.8758 3.69425C17.415 3.69425 17.8522 4.12883 17.8522 4.66476C17.8522 5.20069 17.415 5.63527 16.8758 5.63527Z" fill="#898989"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,3 @@
<svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2822 0.737514C21.4202 0.176452 22.2084 0.14664 22.3876 0.696498C23.4544 3.97515 23.918 9.65475 20.8557 9.64542C20.272 9.6436 19.754 9.64138 19.295 9.63995C19.4119 10.0672 19.4755 10.5109 19.4755 10.9668C19.4755 13.0251 18.2187 14.8433 16.2968 15.9447C16.7679 16.6195 17.0398 17.4134 17.0398 18.2635C17.0398 20.714 14.7825 22.6999 11.997 22.7C9.21134 22.7 6.95342 20.7141 6.95342 18.2635C6.95342 17.4135 7.22539 16.6194 7.69649 15.9447C5.77466 14.8432 4.51777 13.025 4.51777 10.9668C4.5178 10.5109 4.58142 10.0672 4.69824 9.63995C4.23937 9.64138 3.72113 9.6436 3.1376 9.64542C0.0765202 9.65438 0.538946 3.97505 1.60566 0.696498C1.78485 0.146663 2.57302 0.17652 2.71103 0.737514L3.58945 4.32296C3.7594 5.01597 4.38333 5.50267 5.09814 5.50079L8.73281 5.48986C9.71915 5.09984 10.8268 4.88077 11.997 4.88077C13.167 4.8808 14.2742 5.09993 15.2605 5.48986L18.8958 5.50079C19.6106 5.5026 20.2346 5.01597 20.4045 4.32296L21.2822 0.737514ZM10.8397 18.6429C10.5546 18.643 10.3242 18.8736 10.3242 19.1583C10.3243 19.4429 10.5546 19.6729 10.8397 19.6731C11.1248 19.6731 11.3556 19.443 11.3558 19.1583C11.3558 18.8735 11.1249 18.6429 10.8397 18.6429ZM13.1536 18.6429C12.8684 18.6429 12.6375 18.8735 12.6375 19.1583C12.6376 19.443 12.8685 19.673 13.1536 19.6731C13.4388 19.6731 13.6696 19.443 13.6697 19.1583C13.6697 18.8735 13.4388 18.6429 13.1536 18.6429ZM9.14707 8.78068C8.66154 8.78079 8.24337 9.06482 8.04785 9.47521L8.00957 9.63038C8.00957 9.63038 8.00184 9.63034 7.98565 9.63038C7.94915 9.74594 7.92959 9.86917 7.92959 9.99679C7.9297 10.6683 8.47455 11.2121 9.14707 11.2122C9.81972 11.2122 10.3651 10.6684 10.3652 9.99679C10.3652 9.32513 9.81979 8.78068 9.14707 8.78068ZM14.6069 8.78068C13.9342 8.78069 13.3895 9.32514 13.3895 9.99679C13.3896 10.6683 13.9343 11.2122 14.6069 11.2122C15.2796 11.2122 15.825 10.6684 15.8251 9.99679C15.8251 9.32513 15.2797 8.78068 14.6069 8.78068Z" fill="#121212" fill-opacity="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,5 @@
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5018 0.700005C4.14693 0.700005 4.53443 10.313 4.3402 14.6029C4.14693 18.8918 9.24347 20.3705 11.5018 20.2974C13.7602 20.3714 18.8567 18.8927 18.6625 14.6029C18.4683 10.313 18.8558 0.700005 11.5018 0.700005ZM7.38594 8.87895C7.38594 8.22459 7.91721 7.69465 8.5732 7.69465C9.22919 7.69465 9.76045 8.22459 9.76045 8.87895C9.76045 9.5333 9.22919 10.0632 8.5732 10.0632C7.91721 10.0632 7.38594 9.5333 7.38594 8.87895ZM14.9741 16.7065C14.5942 17.3039 13.7002 17.9858 12.8271 17.9858C12.6824 17.9858 12.5387 17.9668 12.3987 17.9259C12.1435 17.8519 11.8674 17.6989 11.6361 17.4007C11.4047 17.6999 11.1286 17.8528 10.8734 17.9259C10.7325 17.9668 10.5888 17.9858 10.445 17.9858C9.57194 17.9858 8.67698 17.3039 8.29804 16.7065C8.14285 16.4624 8.21617 16.1405 8.4599 15.9857C8.70459 15.8309 9.02735 15.904 9.18254 16.1471C9.46245 16.5868 10.1765 17.0408 10.5821 16.923C10.9144 16.8271 11.1124 16.2364 11.1124 15.3427C11.1124 15.3218 11.1143 15.3009 11.1162 15.28C10.2241 15.0901 9.57194 14.488 9.57194 13.7728C9.57194 12.9057 10.5307 12.2029 11.7132 12.2029C12.8957 12.2029 13.8544 12.9057 13.8544 13.7728C13.8544 14.5278 13.127 15.1585 12.1569 15.3085C12.1569 15.3199 12.1588 15.3313 12.1588 15.3427C12.1588 16.2364 12.3568 16.8271 12.6891 16.923C13.0947 17.0398 13.8087 16.5868 14.0887 16.1471C14.2439 15.903 14.5666 15.8309 14.8113 15.9857C15.056 16.1405 15.1283 16.4624 14.9732 16.7065H14.9741ZM14.5314 10.0632C13.8754 10.0632 13.3441 9.5333 13.3441 8.87895C13.3441 8.22459 13.8754 7.69465 14.5314 7.69465C15.1874 7.69465 15.7186 8.22459 15.7186 8.87895C15.7186 9.5333 15.1874 10.0632 14.5314 10.0632Z" fill="#898989"/>
<path d="M6.42909 2.40189C6.25486 2.43988 6.07586 2.48547 5.8902 2.5377C3.14533 3.30887 -3.74591 13.2419 3.8156 13.7662C3.81941 13.6437 3.82322 13.5193 3.82702 13.391C3.89938 11.031 3.99745 7.79912 4.94763 5.12093C5.33133 4.0392 5.82641 3.13317 6.42909 2.40189Z" fill="#898989"/>
<path d="M17.1135 2.53675C16.9278 2.48452 16.7488 2.43988 16.5746 2.40094C17.1772 3.13222 17.6723 4.03825 18.056 5.11998C19.0062 7.79817 19.1043 11.0301 19.1766 13.3901C19.1804 13.5174 19.1843 13.6418 19.1881 13.7652C26.7505 13.2419 19.8583 3.30792 17.1135 2.53675Z" fill="#898989"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,3 @@
<svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.25797 9.90178C4.25797 9.90178 6.23105 5.99078 9.63303 4.1477C8.47245 2.87237 5.19619 3.55349 5.19619 3.55349C5.19619 3.55349 6.35301 0.299988 10.2626 0.299988C13.2602 0.299988 14.4555 2.45387 14.8505 3.45808C19.5866 4.8496 23.1969 11.5767 23.1969 11.5767C23.1969 11.5767 18.9336 19.5215 13.5942 19.9287C13.2058 20.6731 12.4177 21.6745 10.8555 22.2715C8.1347 23.3107 8.3852 22.2082 8.63477 21.6102C8.79614 21.2248 9.3966 19.9542 9.80473 19.0964C6.29766 17.294 4.25797 13.2516 4.25797 13.2516L0.796875 16.6157V6.5387L4.25797 9.90273V9.90178ZM19.1137 11.4577C19.7874 11.4577 20.3334 10.9079 20.3334 10.2296C20.3334 9.5513 19.7874 9.0015 19.1137 9.0015C18.4401 9.0015 17.8941 9.5513 17.8941 10.2296C17.8941 10.9079 18.4401 11.4577 19.1137 11.4577ZM15.6189 16.781C15.6433 16.8622 15.7183 16.9151 15.7981 16.9151C15.8159 16.9151 15.8347 16.9123 15.8534 16.9066C15.9529 16.8764 16.0082 16.7706 15.9782 16.6705C14.9124 13.1695 14.9115 9.74308 15.9773 6.48769C16.0101 6.38849 15.9566 6.28174 15.8581 6.24868C15.7596 6.21562 15.6536 6.27041 15.6208 6.36865C14.5305 9.69962 14.5305 13.2025 15.6198 16.78L15.6189 16.781Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,5 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.9585 8.5556C12.3534 8.7365 12.6644 9.91991 13.4887 9.57789C14.0797 9.33197 13.7912 8.3078 12.9585 8.5556Z" fill="#121212" fill-opacity="0.5"/>
<path d="M9.45451 8.55842C9.0199 8.68185 8.96558 9.45069 9.47699 9.60616C10.4577 9.90484 10.5757 8.23807 9.45451 8.55842Z" fill="#121212" fill-opacity="0.5"/>
<path d="M22.6941 11.5019C22.6941 10.522 22.1667 9.58072 21.3144 8.92212C21.8726 8.36998 22.207 7.67558 22.207 6.91616C22.207 5.91082 21.6216 5.01102 20.6981 4.4146C20.9219 4.131 21.0568 3.80217 21.0568 3.44601C21.0568 2.83358 20.6737 2.2937 20.0874 1.9545C19.6518 1.49753 18.9615 1.19791 18.1766 1.19791C17.6708 1.19791 17.2044 1.32228 16.8213 1.53051C16.0607 0.780513 14.8861 0.299988 13.5673 0.299988C12.641 0.299988 11.7858 0.539308 11.0955 0.94163V0.954821C10.3996 0.546846 9.54068 0.299988 8.60216 0.299988C7.31426 0.299988 6.81596 0.758842 6.0554 1.47775C5.69386 1.30438 5.27049 1.19791 4.81341 1.19791C4.02849 1.19791 3.33818 1.49753 2.90264 1.9545C2.31723 2.29275 1.9332 2.8317 1.9332 3.44601C1.9332 3.80217 2.06808 4.13194 2.29194 4.4146C1.37215 5.01102 0.782997 5.908 0.782997 6.91616C0.782997 7.67275 1.11738 8.3681 1.67563 8.92212C0.824209 9.58072 0.296875 10.4928 0.296875 11.5019C0.296875 12.511 0.797046 13.3703 1.60631 14.0232C1.09396 14.5622 0.78487 15.2302 0.78487 15.9538C0.78487 16.9846 1.40119 17.9013 2.36125 18.4949C2.09431 18.7964 1.93508 19.1601 1.93508 19.554C1.93508 20.1664 2.31817 20.7063 2.90451 21.0455C3.34005 21.5024 4.03037 21.8021 4.81528 21.8021C5.27236 21.8021 5.69573 21.6956 6.05728 21.5222C6.82065 22.2411 7.31614 22.7 8.60403 22.7C9.53975 22.7 10.4015 22.455 11.0974 22.0452V22.0583C11.7905 22.4588 12.6429 22.7 13.5692 22.7C14.888 22.7 16.0626 22.2176 16.8231 21.4695C17.21 21.6777 17.6755 21.8021 18.1785 21.8021C18.9634 21.8021 19.6537 21.5024 20.0892 21.0455C20.6747 20.7053 21.0587 20.1683 21.0587 19.554C21.0587 19.1592 20.8994 18.7955 20.6325 18.4949C21.5926 17.9004 22.2089 16.9827 22.2089 15.9538C22.2089 15.2302 21.9026 14.5622 21.3874 14.0232C22.1967 13.3703 22.6969 12.4818 22.6969 11.5019H22.6941ZM18.4782 6.89731H18.4763C17.9509 7.44568 16.7098 7.64825 15.9652 7.6068C17.8141 11.6658 13.7116 15.7965 9.44795 14.0449C6.90869 13.0009 5.78565 10.033 6.93679 7.6068C5.9889 7.78205 3.44496 7.01697 4.26921 5.74311C5.03633 4.55405 7.93152 4.58137 8.9815 5.47176C10.5204 4.61623 12.3797 4.61435 13.9223 5.47176C14.9658 4.74626 16.4054 4.64167 17.6034 5.04494C18.4361 5.32571 19.2538 6.08702 18.4782 6.89731Z" fill="#121212" fill-opacity="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -0,0 +1,3 @@
<svg width="25" height="23" viewBox="0 0 25 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M24.9994 6.09482C24.9994 5.6801 24.6582 5.34355 24.2377 5.34355C24.0526 5.34355 23.8829 5.40891 23.751 5.51702C23.0191 5.28553 22.1671 4.90989 22.0011 4.38462C21.7002 3.43118 20.0537 3.16976 20.0537 3.16976L19.5595 0.5L17.5836 3.10624L15.9947 0.500611C15.9947 0.500611 15.0497 0.98802 15.0497 3.72069C15.0497 5.57932 15.3476 6.52604 15.5383 6.94199C15.5371 6.94932 15.5352 6.95604 15.5346 6.96276L15.1612 9.26482H7.89029C7.01966 9.26482 6.23696 9.63801 5.69824 10.2311C5.69453 10.2244 5.69143 10.2176 5.6871 10.2109C5.39111 9.74123 4.76569 9.59709 4.29013 9.88904L0.479443 12.2241C0.00326141 12.516 -0.142876 13.1329 0.153112 13.6026C0.4491 14.0723 1.07451 14.2165 1.55008 13.9245L4.96756 11.8301C4.95456 11.9407 4.94712 12.0531 4.94712 12.1679V13.5153C4.94712 13.5202 4.94712 13.5245 4.94712 13.5287C4.94712 13.5312 4.94712 13.533 4.94712 13.5355V21.1984C4.94712 21.9173 5.53786 22.5 6.26669 22.5C6.99551 22.5 7.58625 21.9173 7.58625 21.1984V16.4031C7.68594 16.4135 7.7875 16.4184 7.89029 16.4184H8.03271V21.1984C8.03271 21.9173 8.62344 22.5 9.35227 22.5C10.0811 22.5 10.6718 21.9173 10.6718 21.1984V16.4184H14.5618V21.1984C14.5618 21.9173 15.1525 22.5 15.8813 22.5C16.6102 22.5 17.2009 21.9173 17.2009 21.1984V16.4184H17.3433C17.4461 16.4184 17.547 16.4129 17.6474 16.4031V21.1984C17.6474 21.9173 18.2381 22.5 18.9669 22.5C19.6957 22.5 20.2865 21.9173 20.2865 21.1984V14.1432C20.2865 14.0565 20.2772 13.9722 20.2611 13.8903C20.2772 13.7676 20.2865 13.6423 20.2865 13.5147V12.1673C20.2865 12.0024 20.2716 11.8411 20.245 11.6835L20.6017 9.4847C21.7249 9.4847 23.042 9.36377 23.5554 8.84643C24.0978 8.29977 24.4439 7.40741 24.6433 6.72882C24.8576 6.59567 25 6.36113 25 6.0936L24.9994 6.09482ZM20.3781 5.89937C19.9793 5.89937 19.6561 5.58054 19.6561 5.18719C19.6561 4.79385 19.9793 4.47501 20.3781 4.47501C20.7769 4.47501 21.1001 4.79385 21.1001 5.18719C21.1001 5.58054 20.7769 5.89937 20.3781 5.89937Z" fill="#898989"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,3 @@
<svg width="21" height="23" viewBox="0 0 21 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.6759 6.68902L19.2777 6.68367C18.4787 2.8023 15.739 2.89153 15.739 2.89153V0.700121C15.739 0.536836 15.5351 0.469024 15.4423 0.602864L13.7723 3.01109L11.0361 0.601079C10.8053 0.398534 10.4487 0.515421 10.375 0.8179C10.0549 2.12507 9.52394 5.17841 10.7454 7.63125C10.7958 7.73297 10.8478 7.83112 10.9007 7.92749V10.5856H5.15499C5.03527 10.5856 4.91815 10.5945 4.80364 10.6114C4.83053 10.3723 4.79323 10.1225 4.68131 9.89137L2.87769 6.15812C2.56971 5.52015 1.81669 5.25961 1.19639 5.57725C0.576099 5.89401 0.322777 6.6685 0.631622 7.30647L2.43524 11.0397C2.58186 11.344 2.82998 11.5608 3.11627 11.6714C2.82737 12.0908 2.65647 12.603 2.65647 13.1562V14.5597C2.65647 14.6266 2.65994 14.6918 2.66428 14.7569C2.65907 14.8042 2.65647 14.8515 2.65647 14.8997V21.2098C2.65647 21.9218 3.21777 22.5 3.91094 22.5C4.6041 22.5 5.1654 21.9227 5.1654 21.2098V17.1303H5.66424V21.2098C5.66424 21.9218 6.22554 22.5 6.91871 22.5C7.61101 22.5 8.17318 21.9227 8.17318 21.2098V17.1303H9.82151V21.2098C9.82151 21.9218 10.3828 22.5 11.076 22.5C11.7691 22.5 12.3304 21.9227 12.3304 21.2098V17.1303H12.7547V21.2098C12.7547 21.9218 13.316 22.5 14.0091 22.5C14.7023 22.5 15.2636 21.9227 15.2636 21.2098V14.3741V13.1562C15.2636 13.0857 15.2601 13.0152 15.2549 12.9456C15.2601 12.8796 15.2636 12.8135 15.2636 12.7466V11.6081C15.4232 11.6839 15.6774 11.7428 16.0852 11.7482C19.7037 11.7928 20.1904 9.18648 20.4836 7.69996C20.586 7.17888 20.1956 6.6917 19.6785 6.68902H19.6759ZM16.9649 7.46262C16.3116 7.46262 15.7815 6.91744 15.7815 6.24556C15.7815 5.57369 16.3116 5.02851 16.9649 5.02851C17.6181 5.02851 18.1482 5.57369 18.1482 6.24556C18.1482 6.91744 17.6181 7.46262 16.9649 7.46262Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,3 @@
<svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.66439 1.55626L11.6061 6.12257C11.6061 6.12257 13.4197 5.88332 15.8384 7.09738C15.8384 7.09738 14.9415 3.72448 15.7549 2.16141C16.5693 0.597403 17.5075 0.299988 18.5705 0.299988C19.6335 0.299988 20.8635 0.638684 21.2079 2.12951C21.2079 2.12951 22.8845 2.18205 23.1875 3.75545C23.1875 3.75545 22.7475 4.90195 20.1739 5.12149C20.127 5.12524 20.0829 5.12993 20.0379 5.13463C19.976 5.76042 20.0323 6.7615 20.7988 7.58244C22.011 8.87999 21.9988 9.48045 21.252 9.958C20.5051 10.4356 19.3539 9.17459 19.1335 8.45216C18.9674 7.908 18.9477 6.32898 19.0734 5.30538C17.8031 5.67973 18.2393 6.48847 18.487 7.63404C18.7891 9.03104 19.4252 10.8137 19.4252 13.1067C19.4252 15.3997 17.7993 17.9854 14.7135 19.07C14.6319 19.0991 14.5493 19.1253 14.4677 19.1516V20.2221C14.4677 20.2221 15.0625 20.2634 15.6883 20.2634C16.5853 20.2634 16.543 21.5459 15.6883 21.5459H15.0841C15.5429 21.7336 15.647 22.6924 14.8758 22.6999C14.1046 22.7075 12.5931 21.7026 12.5931 21.2223C12.5931 20.7419 12.8952 21.0552 13.2912 20.3985C13.4826 20.0814 13.5032 19.7089 13.4741 19.4087C12.2329 19.6554 11.0432 19.6151 9.97551 19.3768V20.2212C9.97551 20.2212 10.5703 20.2625 11.1961 20.2625C12.0931 20.2625 12.0508 21.545 11.1961 21.545H10.5919C11.0507 21.7326 11.1548 22.6915 10.3836 22.699C9.61242 22.7065 8.10095 21.7017 8.10095 21.2213C8.10095 20.7409 8.40305 21.0543 8.79898 20.3976C9.07294 19.9425 8.99789 19.373 8.92564 19.0662C8.18164 18.7895 7.52207 18.416 6.98071 17.9845C6.98071 17.9845 0.829756 18.1308 0.809114 11.3963C0.788473 4.66176 3.77013 2.4729 5.66721 1.55532L5.66439 1.55626ZM19.2066 3.46929C19.7771 3.46929 20.2387 3.00769 20.2387 2.43725C20.2387 1.86681 19.7771 1.40521 19.2066 1.40521C18.6362 1.40521 18.1746 1.86681 18.1746 2.43725C18.1746 3.00769 18.6362 3.46929 19.2066 3.46929Z" fill="#121212" fill-opacity="0.5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,98 @@
document.addEventListener('DOMContentLoaded', function() {
var productSwiperThumbs = new Swiper(".product-gallery__thumbsSlider", {
loop: true,
spaceBetween: 10,
slidesPerView: 'auto',
freeMode: true,
watchSlidesProgress: true,
navigation: {
nextEl: '.product-gallery-next',
prevEl: '.product-gallery-prev',
},
});
var productSwiperGallery = new Swiper(".product-gallery__mainSlider", {
loop: true,
spaceBetween: 10,
thumbs: {
swiper: productSwiperThumbs,
},
pagination: {
el: '.product-gallery-bullets',
clickable: true,
bulletClass: 'product-gallery-bullets__item',
bulletActiveClass: '--active',
},
});
var reviewsSwiper = new Swiper(".product-reviews-slider", {
loop: false,
spaceBetween: 20,
slidesPerView: 1,
breakpoints: {
300: {
slidesPerView: 1,
spaceBetween: 20,
},
776: {
slidesPerView: 2,
spaceBetween: 40,
},
991: {
slidesPerView: 3,
spaceBetween: 40,
},
1440: {
slidesPerView: 4,
spaceBetween: 40,
},
},
navigation: {
nextEl: '.product-reviews-next',
prevEl: '.product-reviews-prev',
},
});
var productsRelatedSwiper = new Swiper(".product-similar-slider", {
loop: false,
spaceBetween: 10,
slidesPerView: 'auto',
breakpoints: {
1200: {
spaceBetween: 20,
},
},
navigation: {
nextEl: '.product-similar-next',
prevEl: '.product-similar-prev',
},
});
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
var $svg = jQuery(data).find('svg');
if(typeof imgID !== 'undefined') {
$svg = $svg.attr('id', imgID);
}
if(typeof imgClass !== 'undefined') {
$svg = $svg.attr('class', imgClass+' replaced-svg');
}
$svg = $svg.removeAttr('xmlns:a');
if(!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
$svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
}
$img.replaceWith($svg);
}, 'xml');
});
});

@ -0,0 +1,20 @@
<?php
use Timber\Timber;
global $post;
$context = Timber::get_context();
// Получаем текущий продукт
$product_id = get_the_ID();
$product = wc_get_product($product_id);
// Добавляем продукт в контекст
$context['product'] = $product;
$context['post'] = Timber::get_post();
include_module('shop');
include_component('shop', 'reviews');
?>
<?php
Timber::render('woocommerce/single-product.twig', $context);

@ -0,0 +1,49 @@
/* Стили для загрузки корзины на 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;
}

@ -0,0 +1,515 @@
/* 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;
}

@ -0,0 +1,336 @@
/* Стили для мобильных устройств */
@media only screen and (max-width: 720px) {
/* product */
.product__item{
width: calc(100% - 24px);
}
/* product */
/* modal */
.modal__basket{
width: 100%;
}
.modal__filter{
width: 100%;
}
.modal__to-know,
.modal__to-know-submit{
width: 100%;
}
.modal__button .to-know{
display: flex;
background: none;
}
.modal__basket .modal__header {
height: calc(100% - 156px);
margin-bottom: -36px;
}
.modal-basket-item__block-image{
position: absolute;
width: 80px;
}
.modal-basket-item__image{
width: 48px;
}
.modal-basket-item__content{
margin-left: 0;
padding-left: 96px;
}
.modal-basket-item__control{
margin-left: -80px;
}
.modal-basket-item__title{
min-height: 40px;
font-size: 16px;
}
.modal-basket__item--return{
flex-direction: column;
align-items: start;
}
.modal-basket__item--return .modal-basket-item__title{
margin-right: auto;
}
.notification--width-584{
width: 100%;
}
.notification__title{
font-size: 20px;
}
.notification__text--center-pc{
text-align: start;
}
.notification__img{
height: 360px;
}
.notification__title{
padding-right: 96px;
}
.modal-form__buttons--two{
flex-wrap: wrap;
}
.modal-form__buttons--two button, .modal-form__buttons--two input{
margin-top: 24px;
width: 100%;
}
.modal-form__buttons--two button:first-child, .modal-form__buttons--two input:first-child{
margin-top: 0;
}
.modal-map__control{
flex-wrap: wrap;
}
.modal-map-control__item{
width: calc(100% - 24px);
}
.form__full-mobile{
width: 100%;
border-radius: 0;
border: none;
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(1){
width: 69px;
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(2){
}
.modal-form-content__line--three .modal-form-content-line__element:nth-child(3){
width: 82px;
}
.form__input{
padding: 12px 14px;
}
.modal-form--height-100-phone{
min-height: 100%;
}
/* modal */
/* footer */
.footer__about{
display: none;
}
.footer__wrapper{
flex-direction: column;
}
.footer__content{
width: 100%;
}
.footer__form{
margin-top: 24px;
margin-left: 0;
width: 100%;
}
.footer__social-media{
display: block;
margin-top: 24px;
}
.footer-about__text{
padding-top: 35px;
display: block;
text-align: left;
}
.footer__list{
margin-top: 20px;
}
/* footer */
/* detail */
.toggle__table--two .toggle-table__block{
width: 100%;
}
.toggle__table--two .toggle-table__block:nth-child(even){
margin-top: 32px;
margin-left: 0;
}
.toggle__table--three .toggle-table__block:nth-child(1){
width: 31%;
}
/* detail */
/* cabinet */
.cabinet-card__title{
font-size: 20px;
}
.cabinet-card__no-orders{
margin-top: 16px;
}
.cabinet-card-order__header{
flex-direction: column;
}
.cabinet-card-order__payment{
margin-top: 16px;
}
.cabinet-card-order-detail__main{
flex-direction: column;
}
.cabinet-card-order-detail-main__links{
margin-top: 24px;
align-items: start;
}
.cabinet-card-order-detail-main-product__img{
width: 70px;
height: 70px;
}
.cabinet-card-order-detail-main__product{
margin-top: 16px;
align-items: start;
}
.cabinet-card-order-detail-main-product__content{
margin-left: 16px;
flex-wrap: wrap;
position: relative;
}
.cabinet-card-order-detail-main-product__description{
width: 100%;
}
.cabinet-card-order-detail-main-product__count{
position: absolute;
left: 116px;
bottom: 0;
}
.cabinet-card-order-detail-main-product__price{
position: absolute;
left: 153px;
bottom: 0;
}
.cabinet-card__content{
padding-right: 19px;
}
.cabinet-card-order-main__date{
font-size: 20px;
}
/* .cabinet-card__order.active */
/* .cabinet-card__order.active */
/* cabinet */
}
@media only screen and (max-width: 576px) {
/* header */
/* header */
/* product */
.product__header{
flex-direction: column;
align-items: start;
}
.product__header .button{
margin-top: 48px;
}
/* product */
/* modal */
.modal__aside{
left: 0;
}
.form-input-radio__title span{
display: block;
width: 100%;
color: var(--text-grey);
}
.modal-form__title{
font-size: 20px;
}
/* modal */
/* detail */
.detail-block-form__item,
.detail-block-form__submit{
min-width: 100%;
}
/* detail */
/* cabinet */
.cabinet-card-order-detail-main-product__img{
width: 40px;
height: 40px;
}
.cabinet-card-order-detail-main-product__count{
left: auto;
right: 71px;
}
.cabinet-card-order-detail-main-product__price{
left: auto;
right: 0;
}
.cabinet-card-order__detail-short{
transition-delay: 0;
transition-duration: 0;
}
/* cabinet */
}
@media only screen and (max-width: 720px) {
.subscription__item{
flex-direction: column;
}
.subscription__item > p:first-child{
font-size: 16px;
color: var(--text-6);
}
.subscription__item > p:last-child{
margin-top: 6px;
}
.subscription__add-title {
font-size: 20px;
}
.subscription__add-product{
flex-wrap: wrap;
}
.subscription__add-product > *:not(:first-child){
padding-top: 0;
}
.subscription__add-product .cabinet-card-order-detail-main-product__img{
width: 73px;
height: 66px;
}
.subscription__add-product .cabinet-card-order-detail-main-product-description__what{
font-size: 12px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.subscription__add-product .cabinet-card-order-detail-main-product-description__with-what{
margin-top: 8px;
font-size: 12px;
}
.subscription__add-product .cabinet-card-order-detail-main-product__description {
width: calc(100% - 73px);
}
.subscription__add-product .cabinet-card-order-detail-main-product__content{
position: static;
margin-top: -10px;
margin-left: auto;
width: calc(100% - 73px);
display: flex;
justify-content: space-between;
align-items: center;
}
.subscription__add-product .cabinet-card-order-detail-main-product__count{
position: static;
font-size: 12px;
}
.subscription__add-product .cabinet-card-order-detail-main-product__price{
position: static;
font-size: 16px;
}
}

@ -0,0 +1,241 @@
.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;
}
.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-products__price::after{
content: 'Р';
}
.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--price::after{
content: ' ₽';
}
.order-your-calculation__value--discount{
background: var(--gradient-red);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.order-your-calculation__value--discount::before{
content: '- ';
}
.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;
}
}

@ -0,0 +1,352 @@
/* Стили для планшетов */
@media only screen and (max-width: 1200px) {
.product__main{
margin: 36px 0 0;
}
/* header */
main{
padding-top: 64px;
}
.main-menu{
display: none;
}
.header__open-menu{
display: block;
}
.lang{
display: none;
}
.header__logo{
width: 136px;
height: 29px;
}
.header__content{
height: auto;
padding: 8px 16px;
}
.mini-profile__item:nth-child(2){
margin-left: 0;
}
.header::after{
left: 0;
width: 100%;
}
.header__pc-menu{
display: none;
}
.header__phone-menu{
display: block;
}
.header__menu-block{
top: 56px;
}
.header__content::after{
left: 0;
right: 0;
width: 100%;
}
/* header */
/* footer */
.footer{
margin-top: 0;
padding: 24px 16px;
}
/* footer */
/* breadcrumbs */
.breadcrumbs{
display: none;
}
/* breadcrumbs */
/* product */
.product{
padding: 12px;
padding-top: 20px;
}
.product__title{
font-weight: 700;
font-size: 26px;
line-height: 123%;
text-transform: uppercase;
}
.to-know p {
font-size: 18px;
}
.toggle-table__title{
font-weight: 700;
font-size: 12px;
line-height: 133%;
}
.toggle-table__item p{
font-weight: 500;
font-size: 12px;
line-height: 133%;
}
.toggle-table-item__line{
margin-top: 12px;
}
.detail{
margin: 24px 16px;
}
.back-detail{
display: inline;
}
.detail-catalot__title{
font-size: 22px;
}
.product__footer--error{
margin: 48px 0px 24px;
}
/* product */
/* modal */
.modal{
padding: 0;
}
.modal__text{
padding-right: 0;
}
.form__button-pc{
display: none;
}
.form__button-mobile{
display: block;
}
.modal-form{
/* min-height: 100%;
width: 100%;
border-radius: 0;
border: none; */
}
.modal__notification{
margin: 24px;
}
.form-input-phone__list{
left: 0;
}
.modal-form-content__line--two{
flex-wrap: wrap;
}
.modal-form-content__line--two .modal-form-content-line__element{
margin-top: 24px;
width: 100%;
}
.modal-form-content__line--two .modal-form-content-line__element:first-child{
margin-top: 0;
}
.modal-map{
width: 100%;
flex-direction: column;
border-radius: 0;
}
.modal-map__left, .modal-map__right{
width: 100%;
}
.modal-map__map iframe {
width: 100%;
height: 528px;
}
.modal-map-form__button{
display: none;
}
.modal-map-form__sub-button{
margin-top: 64px;
padding: 0 24px;
display: flex;
}
/* modal */
/* cabinet */
.cabinet{
flex-direction: column;
position: relative;
}
.cabinet__control{
display: flex;
position: relative;
}
.cabinet__orders, .cabinet__profile{
width: calc(100% - 48px);
}
.cabinet__orders, .cabinet__profile{
position: absolute;
opacity: 0;
transition: opacity .2s ease-out;
}
.cabinet-content{
pointer-events:none;
}
.cabinet__orders.active, .cabinet__profile.active{
opacity: 1;
}
.cabinet__orders.hide, .cabinet__profile.hide{
position: static;
display: block;
pointer-events:auto;
width: 100%;
}
.cabinet__subscription-pc{
display: none;
}
.cabinet__subscription-mobile{
display: block;
margin: 24px 24px 0 24px;
}
.cabinet__orders .cabinet-card:nth-child(2){
margin-top: 0;
}
.cabinet__orders--no-cab .cabinet-card:nth-child(2){
margin-top: 32px;
}
/* cabinet */
}
@media only screen and (max-width: 980px) {
/* product */
.product__item{
width: calc(50% - 24px);
}
/* product */
/* detail */
.detail{
flex-direction: column;
}
.detail__images{
display: none;
}
.detail__content{
width: 100%;
}
.detail__content{
margin-left: 0;
}
.detail__images-phone{
display: block;
margin-top: 48px;
margin-bottom: 48px;
position: relative;
overflow: hidden;
}
.detail__images-phone .swiper-slide{
display: flex;
justify-content: center;
}
.detail-images-phone__image-block{
width: 100%;
aspect-ratio: 1;
max-width: 500px;
display: flex;
justify-content: center;
align-items: center;
background: var(--background-grey);
border-radius: 16px;
}
.detail__images-phone .swiper-pagination-bullet{
width: 8px;
height: 8px;
border-radius: 50%;
border: 1px solid #666;
background-color: #666;
opacity: 1;
}
.detail__images-phone .swiper-pagination-bullet.swiper-pagination-bullet-active{
background-color: var(--background-white);
}
.detail__images-phone .swiper-pagination{
margin-bottom: 19px;
}
.detail__title{
font-size: 26px;
line-height: 123%;
}
.gallery__slider .swiper-pagination {
display: block;
}
.gallery__pagination{
display: none;
}
.gallery__slider .swiper-pagination-bullet{
width: 8px;
height: 8px;
border-radius: 50%;
border: 1px solid #666;
background-color: #666;
opacity: 1;
}
.gallery__wrapper .gallery-button{
display: none;
}
.gallery__slider .swiper-pagination-bullet.swiper-pagination-bullet-active{
background-color: var(--background-white);
}
.gallery__slider{
margin-left:0;
padding: 0px 0px 50px 0px;
/* padding: 40px; */
}
.gallery__block {
width: 100%;
aspect-ratio: 1;
height: auto;
}
/* detail */
}
@media only screen and (max-width: 750px) {
/* cabinet */
.cabinet-card-order__open-detail{
margin-top: 144px;
}
.cabinet-card-order__detail-short{
right: auto;
left: 0;
bottom: 48px;
}
.cabinet-card-order-detail-short__item{
margin-left: -27px;
}
.cabinet-card-order-detail-short__item:first-child{
margin-left: 0;
}
.cabinet-card__order.active .cabinet-card-order__open-detail{
margin-top: 24px;
}
.cabinet-card-order__link{
margin-top: 144px;
}
/* cabinet */
}

@ -0,0 +1,4 @@
/* Стили для ультрашироких экранов */
@media only screen and (min-width: 1400px) {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

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

After

Width:  |  Height:  |  Size: 459 B

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7369 3.29777C11.1247 3.15233 11.557 3.34884 11.7025 3.73668L14.7025 11.7367C14.7661 11.9065 14.7661 12.0936 14.7025 12.2634L11.7025 20.2634C11.557 20.6512 11.1247 20.8477 10.7369 20.7023C10.349 20.5568 10.1525 20.1245 10.298 19.7367L13.1992 12L10.298 4.26336C10.1525 3.87552 10.349 3.44321 10.7369 3.29777Z" fill="#666666"/>
</svg>

After

Width:  |  Height:  |  Size: 481 B

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 16.4854H28" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 16.4854L14.4853 24.9706" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 16.4854L14.4853 8.00007" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 456 B

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26 16.4854H4" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M26 16.4854L17.5147 24.9706" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M26 16.4854L17.5147 8.00007" stroke="#666666" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 458 B

@ -0,0 +1,11 @@
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.7071 0.292893C16.0976 0.683417 16.0976 1.31658 15.7071 1.70711L5.70711 11.7071C5.31658 12.0976 4.68342 12.0976 4.29289 11.7071L0.292893 7.70711C-0.0976311 7.31658 -0.0976311 6.68342 0.292893 6.29289C0.683417 5.90237 1.31658 5.90237 1.70711 6.29289L5 9.58579L14.2929 0.292893C14.6834 -0.0976311 15.3166 -0.0976311 15.7071 0.292893Z" fill="url(#paint0_radial_79_10214)" />
<defs>
<radialGradient id="paint0_radial_79_10214" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(23.9562 -7.00625) rotate(143.344) scale(34.5677 45.2811)">
<stop stop-color="#0F5881" />
<stop offset="0.512169" stop-color="#1EA49C" />
<stop offset="0.807073" stop-color="#76CE75" />
<stop offset="0.911458" stop-color="#ECF39F" />
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 954 B

@ -0,0 +1,11 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1_2483)">
<path d="M18 6L6 18" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 6L18 18" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_1_2483">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 455 B

@ -0,0 +1,156 @@
<?php
$product;
$product_type;
$context_for_twig;
// Получаем данные продукта
$product_id = get_the_ID();
$product = wc_get_product($product_id);
// Проверяем, что продукт существует
if (!$product) {
return; // Просто выходим, если продукт не найден
}
$attributes = [];
$product_attributes = $product->get_attributes();
/* Получение категорий */
$tags = get_the_terms($product_id, 'product_cat');
if (!empty($tags) && !is_wp_error($tags)) {
foreach ($tags as $tag) {
$context_for_twig['product_tags'][] = $tag->name;
}
}
/* Получение атрибутов */
if (!empty($product_attributes)) {
foreach ($product_attributes as $taxonomy => $attribute) {
if ($attribute->is_taxonomy()) {
$terms = wc_get_product_terms($product_id, $taxonomy, ['fields' => 'all']);
// $tags = wc_get_product_terms( $product_id, 'pa_catalog_tags' );
if (!empty($terms)) {
$attr_values = [];
foreach ($terms as $term) {
$attr_values[] = [
'name' => $term->name,
'slug' => $term->slug,
'term_id' => $term->term_id,
'link' => get_term_link($term->term_id, $taxonomy),
];
}
$attributes[wc_attribute_label($taxonomy)] = $attr_values;
}
} else {
$attributes[wc_attribute_label($taxonomy)] = $attribute->get_options();
}
}
}
$context_for_twig['product_attributes'] = $attributes;
/* Получение вариаций товара */
if ($product->is_type('variable')) {
$available_variations = $product->get_available_variations();
$variations_data = [];
foreach ($available_variations as $variation) {
$variation_id = $variation['variation_id'];
$variation_obj = wc_get_product($variation_id);
$variations_data[] = [
'variation_id' => $variation_id,
'price' => $variation_obj->get_price(),
'regular_price' => $variation_obj->get_regular_price(),
'sale_price' => $variation_obj->get_sale_price(),
'attributes' => $variation['attributes']
];
}
$context_for_twig['variations'] = $variations_data;
}
/* ACF-поля и мета-данные продукта */
$meta_fields = [
'composition' => get_post_meta($product_id, '_composition', true),
'feeding_recommendations' => get_post_meta($product_id, '_feeding_recommendations', true), // Ранее выводились HTML-полем «Рекомендации по кормлению»
'feeding_recommendations_table' => get_field('feeding_recommendations_table', get_post(get_field('p_tables_field', $product_id))) , // Таблица «Рекомендации по кормлению»
'nutritional_value' => get_post_meta($product_id, '_nutritional_value', true),
'vitamins' => get_post_meta($product_id, '_vitamins', true),
'additives' => get_post_meta($product_id, '_additives', true),
'energy_value' => get_post_meta($product_id, '_energy_value', true),
'important' => get_post_meta($product_id, '_important', true),
];
$context_for_twig['product_meta'] = $meta_fields;
/* Товар оформляется по подписке? */
$context_for_twig['is_subscription'] = $product->is_type( array( 'subscription', 'subscription_variation', 'variable-subscription' )) ? true : false;
$context = Timber::get_context();
$post = Timber::get_post();
$context['post'] = $post;
$context['wc_breadcrumbs'] = array();
if (function_exists('woocommerce_breadcrumb')) {
$args = array(
'delimiter' => '',
'wrap_before' => '',
'wrap_after' => '',
'before' => '',
'after' => '',
'home' => _x('Home', 'breadcrumb', 'woocommerce'),
);
$breadcrumbs = new WC_Breadcrumb();
$breadcrumbs->generate();
$formatted_breadcrumbs = array();
foreach ($breadcrumbs->get_breadcrumb() as $crumb) {
$formatted_breadcrumbs[] = array(
'text' => $crumb[0],
'url' => $crumb[1]
);
}
$context['wc_breadcrumbs'] = $formatted_breadcrumbs;
}
$context['product'] = $product;
$context['related_products'] = array();
$related_products_ids = $product->get_upsell_ids();
if ($related_products_ids) {
foreach ($related_products_ids as $related_id) {
$related_product = wc_get_product($related_id);
if ($related_product) {
$context['related_products'][] = $related_product;
}
}
}
if (class_exists('WCS_ATT_Product_Schemes')) {
$schemes = WCS_ATT_Product_Schemes::get_subscription_schemes($product);
$context['has_subscription_options'] = !empty($schemes);
} else {
$context['has_subscription_options'] = false;
}
Timber::render('_pages/shop/product-single.twig', $context);
// Подключение стилей для загрузки корзины
add_action('wp_enqueue_scripts', 'single_product_cart_styles');
function single_product_cart_styles() {
if (is_product()) {
wp_enqueue_style(
'single-product-cart-loading',
get_template_directory_uri() . '/modules/shop/components/single-product/assets/css/cart-loading.css',
array(),
'1.0.0'
);
}
}

@ -0,0 +1,331 @@
.main-food_reviews {
border-radius: 40px;
padding: 24px;
max-width: 395px;
height: 672px;
flex-grow: 1;
position: relative;
box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.12);
background: #fff;
}
.main-food_reviews-title {
font-weight: 700;
font-size: 32px;
text-transform: uppercase;
color: #121212;
}
.main-food_reviews-slider {
position: relative;
}
.main-food_reviews-slide {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border-radius: 8px;
min-height: 580px;
}
.main-food_reviews-slide-img {
border: 2px solid #fff;
border-radius: 32px;
object-fit: cover;
margin-bottom: 10px;
}
.main-food_reviews-slide-name {
font-weight: 700;
font-size: 16px;
text-transform: uppercase;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-position {
font-weight: 500;
font-size: 14px;
line-height: 140%;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-position:not(.--no-min-height){
min-height: 60px;
}
.main-food_reviews-slide-text {
font-weight: 500;
font-size: 16px;
line-height: 140%;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-text a{
color: #569ef0;
font-weight: 600;
text-decoration: underline;
}
.main-food_reviews-slide-head, .main-food_reviews-slide-position{
width: 100%;
}
.main-food_reviews-slide-text p {
margin-bottom: .5em;
}
.main-food_reviews-slider {
position: relative;
height: 97%;
}
.main-food_reviews-slider-index {
position: absolute;
left: 40%;
transform: translateX(-50%);
bottom: 30px;
z-index: 100;
font-weight: 500;
font-size: 16px;
line-height: 140%;
color: #121212;
}
.main-food_arrows .swiper-button-next{
right: var(--swiper-navigation-sides-offset, -65px)!important;
left: auto;
}
.main-food_arrows .swiper-button-prev{
left: var(--swiper-navigation-sides-offset, -65px)!important;
right: auto;
}
.main-food_reviews-star {
position: absolute;
top: 0%;
right: 0%;
z-index: 100;
}
.main-food_reviews-slide-top {
display: flex;
justify-content: flex-start;
gap: 20px;
align-items: center;
width: 100%;
}
.main-food_reviews-slide-top img {
width: 48px;
height: 48px;
border-radius: 100%;
}
@media(max-width: 940px){
.main-food_reviews-title{
font-size: 24px;
}
.main-food_reviews-star{
width: 82px;
top: -20px;
}
.main-reviews_title{
font-size: 32px;
}
}
@media (max-width: 767px) {
.main-food_reviews {
padding: 16px 24px;
border-radius: 30px;
}
.main-food_reviews-slide-img {
width: 100%;
}
.main-food_reviews-slide-name {
font-size: 18px;
}
.main-food_reviews-slide-position{
font-weight: 500;
font-size: 14px;
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, rgb(238, 104, 104) 0%, rgb(86, 158, 240) 57.692307233810425%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.main-food_reviews-slide-text {
font-size: 14px;
}
.main-food_reviews-slider-index {
font-size: 14px;
}
.main-food_reviews-slide{
padding-left: 0;
padding-right: 0;
}
.main-reviews_title{
font-size: 32px;
}
}
/* Main Reviews */
.main-food_reviews-slide-head{
position: relative;
}
.main-food_reviews-slide-photo{
height: 48px;
width: 48px;
flex-shrink: 0;
position: absolute;
top: 0;
left: 0;
border-radius: 50%;
object-fit: cover;
}
.main-food_reviews-slide-name, .main-food_reviews-slide-position{
padding-left: 64px;
}
.main-food_reviews-slide-name.--no-padding-left, .main-food_reviews-slide-position.--no-padding-left{
padding-left: 0;
}
.main-food_reviews-slide-name, .main-food_reviews-slide-position, .main-food_reviews-slide-head{
width: 100%;
}
.main-food_reviews-slide-media_file{
height: 220px;
width: 100%;
border-radius: 32px;
margin-bottom: 1rem;
object-fit: cover;
}
.main-food_reviews-slide-media_file-wrap{
width: 100%;
display: block;
}
@media (max-width: 640px) {
.main-food_reviews-slide-name{
min-height: 48px;
display: flex;
align-items: center;
}
.main-food_reviews-slide-position{
padding-left: 0;
}
}
.main-food_reviews-slide-media_main{
border-radius: 25px;
width: 168px;
height: 115px;
overflow: hidden;
}
.main-food_reviews-slide-media_main img{
width: 168px;
height: 115px;
}
.main-food_reviews-slide-media_mini{
width: 56px;
height: 70px;
border-radius: 16px;
overflow: hidden;
}
.main-food_reviews-slide-media_wrap{
display: flex;
gap: 6px;
align-items: center;
margin-bottom: 20px;
}
.main-food_reviews-slide-media_wrap img{
object-fit: cover;
}
.main-food_reviews-slide-media_mini img{
width: 56px;
height: 70px;
}
.mform__review{
max-height: 90vh;
overflow: auto;
}
.mform__review-wrap{
background-color: #fff;
max-width: 1200px;
width: calc(100% - 20px);
border-radius: 32px;
padding: 40px;
margin: auto;
max-width: 1200px;
width: calc(100% - 20px); position: relative;
}
.read-more{
font-weight: 500;
font-size: 16px;
line-height: 140%;
text-decoration: underline;
text-decoration-skip-ink: none;
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, rgb(238, 104, 104) 0%, rgb(86, 158, 240) 57.692307233810425%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-top: 2rem;
border-bottom: 1px rgb(86, 158, 240) solid;
display: block;
width: max-content;
}
@media (max-width: 640px) {
.mform__review-wrap{
padding: 24px;
padding-top: 60px;
padding-right: 10px;
}
.mform__review{
padding-right: 16px;
}
}
/* Для Chrome, Edge и Safari */
.mform__review::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.mform__review::-webkit-scrollbar-track {
background: #f5f5f5;
border-radius: 10px;
}
.mform__review::-webkit-scrollbar-thumb {
background-color: #81bafc;
border-radius: 10px;
border: 2px solid #f5f5f5;
}
.mform__review::-webkit-scrollbar-thumb:hover {
background-color: #63acff;
}
@media (max-width: 576px) {
.main-food_reviews {
min-height: 720px;
height: 80vh;
max-height: 850px;
}
.main-food_reviews-slide {
min-height: 640px;
height: calc(80vh - 80px);
max-height: 770px;
}
}
.mform__review__media{
display: block;
width: 100%;
max-width: 350px;
}

@ -0,0 +1,13 @@
jQuery('.main-food_reviews-slide-media_mini').on('click', function(){
var main = jQuery(this).closest('.main-food_reviews-slide-media_wrap').find('.main-food_reviews-slide-media_main')
var src = jQuery(this).attr('src')
var href = jQuery(this).data('video')
if (!href){
href = src
}
jQuery(main).attr('href', href)
jQuery(main).attr('src', src)
})
jQuery('.main-food_reviews-slide-media_wrap').each(function(){
jQuery(this).find('.main-food_reviews-slide-media_mini')[0].click()
})

@ -1,152 +0,0 @@
<?php
$product;
$product_type;
$context_for_twig;
if (function_exists('is_product') && is_product()) {
$product_id = get_the_ID();
$product = wc_get_product($product_id);
$attributes = [];
$product_attributes = $product->get_attributes();
/* Получение категорий */
$tags = get_the_terms($product_id, 'product_cat');
if (!empty($tags) && !is_wp_error($tags)) {
foreach ($tags as $tag) {
$context_for_twig['product_tags'][] = $tag->name;
}
}
/* Получение атрибутов */
if (!empty($product_attributes)) {
foreach ($product_attributes as $taxonomy => $attribute) {
if ($attribute->is_taxonomy()) {
$terms = wc_get_product_terms($product_id, $taxonomy, ['fields' => 'all']);
// $tags = wc_get_product_terms( $product_id, 'pa_catalog_tags' );
if (!empty($terms)) {
$attr_values = [];
foreach ($terms as $term) {
$attr_values[] = [
'name' => $term->name,
'slug' => $term->slug,
'term_id' => $term->term_id,
'link' => get_term_link($term->term_id, $taxonomy),
];
}
$attributes[wc_attribute_label($taxonomy)] = $attr_values;
}
} else {
$attributes[wc_attribute_label($taxonomy)] = $attribute->get_options();
}
}
}
$context_for_twig['product_attributes'] = $attributes;
/* Получение вариаций товара */
if ($product->is_type('variable')) {
$available_variations = $product->get_available_variations();
$variations_data = [];
foreach ($available_variations as $variation) {
$variation_id = $variation['variation_id'];
$variation_obj = wc_get_product($variation_id);
$variations_data[] = [
'variation_id' => $variation_id,
'price' => $variation_obj->get_price(),
'regular_price' => $variation_obj->get_regular_price(),
'sale_price' => $variation_obj->get_sale_price(),
'attributes' => $variation['attributes']
];
}
$context_for_twig['variations'] = $variations_data;
}
/* ACF-поля и мета-данные продукта */
$meta_fields = [
'composition' => get_post_meta($product_id, '_composition', true),
'feeding_recommendations' => get_post_meta($product_id, '_feeding_recommendations', true), // Ранее выводились HTML-полем «Рекомендации по кормлению»
'feeding_recommendations_table' => get_field('feeding_recommendations_table', get_post(get_field('p_tables_field', $product_id))) , // Таблица «Рекомендации по кормлению»
'nutritional_value' => get_post_meta($product_id, '_nutritional_value', true),
'vitamins' => get_post_meta($product_id, '_vitamins', true),
'additives' => get_post_meta($product_id, '_additives', true),
'energy_value' => get_post_meta($product_id, '_energy_value', true),
'important' => get_post_meta($product_id, '_important', true),
];
$context_for_twig['product_meta'] = $meta_fields;
/* Товар оформляется по подписке? */
$context_for_twig['is_subscription'] = $product->is_type( array( 'subscription', 'subscription_variation', 'variable-subscription' )) ? true : false;
}
add_filter('timber/context', function ($context) use ($context_for_twig) {
return array_merge($context, $context_for_twig);
});
$context = Timber::get_context();
$post = Timber::get_post();
$context['post'] = $post;
$context['wc_breadcrumbs'] = array();
if (function_exists('woocommerce_breadcrumb')) {
$args = array(
'delimiter' => '',
'wrap_before' => '',
'wrap_after' => '',
'before' => '',
'after' => '',
'home' => _x('Home', 'breadcrumb', 'woocommerce'),
);
$breadcrumbs = new WC_Breadcrumb();
$breadcrumbs->generate();
$formatted_breadcrumbs = array();
foreach ($breadcrumbs->get_breadcrumb() as $crumb) {
$formatted_breadcrumbs[] = array(
'text' => $crumb[0],
'url' => $crumb[1]
);
}
$context['wc_breadcrumbs'] = $formatted_breadcrumbs;
}
$product_id = get_the_ID();
$product = wc_get_product($product_id);
$context['product'] = $product;
$context['related_products'] = array();
$related_products_ids = $product->get_upsell_ids();
if ($related_products_ids) {
foreach ($related_products_ids as $related_id) {
$related_product = wc_get_product($related_id);
if ($related_product) {
$context['related_products'][] = $related_product;
}
}
}
if (class_exists('WCS_ATT_Product_Schemes')) {
$schemes = WCS_ATT_Product_Schemes::get_subscription_schemes($product);
$context['has_subscription_options'] = !empty($schemes);
} else {
$context['has_subscription_options'] = false;
}
Timber::render('_pages/shop/product-single.twig', $context);

@ -1,5 +1,8 @@
<?php
// Импортируем класс CosmopetProduct
require_once __DIR__ . '/CosmopetProduct.php';
/* Страница Checkout */
add_action( 'wp_ajax_apply_coupon', 'custom_apply_coupon' );
add_action( 'wp_ajax_nopriv_apply_coupon', 'custom_apply_coupon' );
@ -171,3 +174,58 @@ function woocommerce_ajax_add_to_cart() {
wp_die();
}
/**
* Обработчик AJAX для обновления блока с кнопкой покупки
*/
add_action('wp_ajax_update_product_buy_block', 'update_product_buy_block_handler');
add_action('wp_ajax_nopriv_update_product_buy_block', 'update_product_buy_block_handler');
function update_product_buy_block_handler() {
error_log('update_product_buy_block_handler called');
if (!isset($_POST['product_id'])) {
error_log('No product_id provided');
wp_send_json_error('Не указан ID товара');
return;
}
$product_id = intval($_POST['product_id']);
error_log('Product ID: ' . $product_id);
$product = Timber::get_post($product_id);
if (!$product) {
error_log('Product not found');
wp_send_json_error('Товар не найден');
return;
}
// Получаем количество товара в корзине через метод класса
$cart_quantity = $product->getCartQuantity();
error_log('Cart quantity: ' . $cart_quantity);
// Подготавливаем контекст для Twig
$context = Timber::context();
$context['post'] = $product;
$context['product'] = $product->product;
$context['cart_quantity'] = $cart_quantity;
$context['in_cart'] = $cart_quantity > 0;
if($cart_quantity > 0){
$html = Timber::compile('blocks/modules/shop/product-single-add_to_cart.twig', $context);
}
else{
$GLOBALS['product'] = $product->product;
ob_start();
do_action( 'woocommerce_' . $product->product->get_type() . '_add_to_cart' );
$html = ob_get_clean();
}
// Рендерим Twig шаблон
error_log('HTML length: ' . strlen($html));
wp_send_json_success(array(
'html' => $html,
'quantity' => $cart_quantity,
'in_cart' => $cart_quantity > 0
));
}

@ -386,6 +386,7 @@ function conditional_dequeue_woocommerce_styles() {
}
add_action('wp_enqueue_scripts', 'conditional_dequeue_woocommerce_styles', 999);
include_component('shop', 'product-card');
//Функция для получения названия класса по аттрибуту
function map_attr_slugs_to_class($slug) {

@ -59,7 +59,7 @@ add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
include_component('blog', 'main-page-block');
include_component('shop', 'product-card');
include_component('shop', 'reviews');
$reviews_food_query = get_posts(array(
'post_type' => 'p_reviews',
@ -115,9 +115,16 @@ if (function_exists('get_field')) {
$context['q_5'] = get_field('q_5', 383);
//
$context['food_list'] = get_field('featured_food');
$context['treats_list'] = get_field('featured_treats');
$array_food = array();
foreach (get_field('featured_food') as $item) {
$array_food[] = Timber::get_post($item['product']);
}
$array_treats = array();
foreach (get_field('featured_treats') as $item) {
$array_treats[] = Timber::get_post($item['product']);
}
$context['food_list'] = $array_food;
$context['treats_list'] = $array_treats;
}
try {

@ -5,6 +5,10 @@
* This is the template that renders pages using Timber (Twig).
*/
/* TO_DO сюда перенести логику home.php */
$context = Timber::context();
$context['post'] = Timber::get_post();
if (is_account_page() && !is_wc_endpoint_url()){
include_module('profile');
@ -27,8 +31,5 @@ elseif (is_account_page() && isset($wp->query_vars['view-subscription'])){
}
else{
$context = Timber::context();
$context['post'] = Timber::get_post();
Timber::render('page.twig', $context);
}

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

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

@ -1,12 +0,0 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if (is_product()) {
include_module('shop');
include_component('shop', 'single-product');
}

@ -0,0 +1,26 @@
<?php
/**
* The Template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*/
namespace App;
use Timber\Timber;
$context = Timber::context();
$post = $context['post'];
if ( is_singular('post') ) {
include_module('blog');
include_component('blog', 'single');
} elseif ( is_singular('blog_author') ) {
include_module('author');
include_component('author', 'author-single');
} else {
// Для других типов записей
$templates = [ 'views/single-' . get_post_type() . '.twig', 'views/single.twig' ];
}
Timber::render( $templates, $context );

@ -794,227 +794,8 @@ background: radial-gradient(161.08% 232.33% at 133.99% -48.29%, #EE6868 0%, #569
flex-wrap: wrap;
gap: 10px;
}
.main-food_products-card {
--accent-color: #121212;
border-radius: 30px;
padding: 8px;
width: 265px;
min-width: 194px;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: var(--accent-color);
background-image: linear-gradient(
rgba(255, 255, 255, 0.6),
rgba(255, 255, 255, 0.6)
);
}
.main-food_products-card-img {
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 8px 0px 32px;
padding-bottom: 42px;
/* filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.1)); */
}
/* .shadow-svg {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-65%);
width: 80%;
height: auto;
z-index: 0;
pointer-events: none;
} */
.main-food_products-card-img img {
position: relative;
z-index: 1;
display: block;
max-width: 100%;
height: auto;
aspect-ratio: 1/1;
object-fit: contain;
}
.main-food_products-card-title{
padding: 8px 16px 8px 16px;
border-radius: 36px;
background: #fff;
font-weight: 500;
font-size: 12px;
text-transform: uppercase;
color: var(--accent-color);
}
.food.lamb.main-food_products-card {
--accent-color: #863300;
}
.food.turkey.main-food_products-card {
--accent-color: #CD0003;
}
.food.beef.main-food_products-card{
--accent-color: #7e0092;
}
.food.fish.main-food_products-card{
--accent-color: #48c1ed;
}
.treats.lamb.main-food_products-card {
--accent-color: #44006c;
}
.treats.rabbit.main-food_products-card {
--accent-color: #601094;
}
.treats.beef.main-food_products-card{
--accent-color: #004c31;
}
.treats.salmon.main-food_products-card{
--accent-color: #7c007a;
}
.treats.duck.main-food_products-card{
--accent-color: #326e70;
}
.main-food_products-card-bottom {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 8px;
}
.main-food_products-card-bottom-price{
border-radius: 36px;
padding: 10px;
background: #fff;
font-weight: 600;
font-size: 18px;
text-transform: uppercase;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
color: var(--accent-color);
}
.main-food_products-cardbottom-btn{
border: 2px solid #fff;
border-radius: 36px;
padding: 0px 32px;
height: 42px;
font-weight: 900;
font-size: 12px;
text-align: center;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
transition: all .3s;
background-color: var(--accent-color);
}
.main-food_reviews {
border-radius: 40px;
padding: 24px;
max-width: 395px;
height: 672px;
flex-grow: 1;
position: relative;
box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.12);
background: #fff;
}
.main-food_reviews-title {
font-weight: 700;
font-size: 32px;
text-transform: uppercase;
color: #121212;
}
.main-food_reviews-slider {
position: relative;
}
.main-food_reviews-slide {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border-radius: 8px;
min-height: 580px;
}
.main-food_reviews-slide-img {
border: 2px solid #fff;
border-radius: 32px;
object-fit: cover;
margin-bottom: 10px;
}
.main-food_reviews-slide-name {
font-weight: 700;
font-size: 16px;
text-transform: uppercase;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-position {
font-weight: 500;
font-size: 14px;
line-height: 140%;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-position:not(.--no-min-height){
min-height: 60px;
}
.main-food_reviews-slide-text {
font-weight: 500;
font-size: 16px;
line-height: 140%;
color: #121212;
margin-bottom: 10px;
}
.main-food_reviews-slide-text a{
color: #569ef0;
font-weight: 600;
text-decoration: underline;
}
.main-food_reviews-slide-head, .main-food_reviews-slide-position{
width: 100%;
}
.main-food_reviews-slide-text p {
margin-bottom: .5em;
}
.main-food_reviews-slider {
position: relative;
height: 97%;
}
.main-food_reviews-slider-index {
position: absolute;
left: 40%;
transform: translateX(-50%);
bottom: 30px;
z-index: 100;
font-weight: 500;
font-size: 16px;
line-height: 140%;
color: #121212;
}
.main-food_arrows {
position: absolute;
right: 20%;
@ -1039,84 +820,14 @@ background: radial-gradient(161.08% 232.33% at 133.99% -48.29%, #EE6868 0%, #569
content: none;
}
.main-food_products-card-slider .swiper-pagination-bullet {
background: #fff;
height: 10px;
width: 10px;
border-radius: 50%;
opacity: 1;
}
.main-food_products-card-slider .swiper-pagination-bullet.swiper-pagination-bullet-active{
background-color: var(--accent-color);
}
.swiper-dots{
position: absolute;
bottom: 16px !important;
display: flex;
justify-content: center;
z-index: 5;
}
.main-food_products-card-img{
padding-bottom: 20px;
}
.main-food_arrows .swiper-button-next{
right: var(--swiper-navigation-sides-offset, -65px)!important;
left: auto;
}
.main-food_arrows .swiper-button-prev{
left: var(--swiper-navigation-sides-offset, -65px)!important;
right: auto;
}
.main-food_reviews-star {
position: absolute;
top: 0%;
right: 0%;
z-index: 100;
}
.main-food_link {
max-width: 240px;
justify-content: space-between;
padding: 0 8px;
}
@media (max-width: 767px) {
.main-food_reviews {
padding: 16px 24px;
border-radius: 30px;
}
.main-food_reviews-slide-img {
width: 100%;
}
.main-food_reviews-slide-name {
font-size: 18px;
}
.main-food_reviews-slide-position{
font-weight: 500;
font-size: 14px;
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, rgb(238, 104, 104) 0%, rgb(86, 158, 240) 57.692307233810425%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.main-food_reviews-slide-text {
font-size: 14px;
}
.main-food_reviews-slider-index {
font-size: 14px;
}
.main-food_reviews-slide{
padding-left: 0;
padding-right: 0;
}
.main-reviews_title{
font-size: 32px;
}
}
/* Main Reviews */
.main-reviews {
background: #f4f1f0;
@ -1177,21 +888,6 @@ background: radial-gradient(161.08% 232.33% at 133.99% -48.29%, #EE6868 0%, #569
border-radius: 0px 0px 60px 60px;
}
.main-food_products-card-title{
padding: 8px 16px 8px 16px;
border-radius: 36px;
background: #fff;
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
}
.main-food_products-card-bottom {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-top: 10px;
}
.main-treats_products-card-bottom-price{
border-radius: 100px;
@ -1281,18 +977,7 @@ background: radial-gradient(161.08% 232.33% at 133.99% -48.29%, #EE6868 0%, #569
right: auto;
}
.main-food_reviews-slide-top {
display: flex;
justify-content: flex-start;
gap: 20px;
align-items: center;
width: 100%;
}
.main-food_reviews-slide-top img {
width: 48px;
height: 48px;
border-radius: 100%;
}
/* Main Smi */
@ -2840,48 +2525,7 @@ font-size: 32px;
width: calc(50% - 5px);
min-width: 0;
}
.main-food_products-card-img img{
height: 50vw;
}
.main-food_products-card-title{
font-size: 10px;
}
.main-food_products-card-bottom-price{
font-size: 12px;
height: 44px;
padding-left: 10px;
padding-right: 10px;
}
.main-food_products-cardbottom-btn{
font-size: 0;
height: 44px;
width: 44px;
position: relative;
padding: 0;
flex-grow: 0;
}
.main-food_products-cardbottom-btn::after{
background-image: url("data:image/svg+xml,%3Csvg width='18' height='20' viewBox='0 0 18 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.99891 0C10.0882 1.85362e-05 11.1353 0.416463 11.908 1.15941L12.0484 1.30206C12.7329 2.02913 13.1164 2.97793 13.1165 3.96649V5.03207L14.9288 5.02729L15.0941 5.03207C15.4787 5.05208 15.8566 5.14206 16.208 5.29727L16.357 5.36716C16.6986 5.54015 17.0042 5.7742 17.257 6.05744L17.3621 6.18191C17.5979 6.47719 17.7739 6.81389 17.8808 7.17377L17.9228 7.32887C17.9969 7.64101 18.0178 7.96276 17.9849 8.28147L17.9639 8.4404L16.6522 16.6376C16.5114 17.5178 16.0674 18.3238 15.3969 18.9287L15.2603 19.0464C14.5603 19.6238 13.6814 19.9569 12.7659 19.9962L12.5815 20H5.41634C4.49677 19.9999 3.60472 19.7028 2.88179 19.1584L2.73944 19.0464C2.03929 18.4688 1.56066 17.6815 1.37998 16.8119L1.3475 16.6376L0.0357986 8.4404C-0.03187 8.0173 -0.00329994 7.58521 0.118914 7.17377L0.168592 7.02058C0.295244 6.6677 0.489965 6.34073 0.742759 6.05744L0.854535 5.93968C1.12207 5.67071 1.44011 5.45265 1.79174 5.29727L1.94364 5.23408C2.25097 5.11719 2.57599 5.04922 2.90568 5.03207L3.07095 5.02729H4.60525L4.87155 5.03207L4.8823 3.96649C4.88242 2.91203 5.31814 1.90251 6.09082 1.15941L6.2389 1.02346C6.99437 0.365708 7.97783 0.000101636 8.99891 0ZM3.07095 6.92772C2.95004 6.92773 2.83041 6.94761 2.71652 6.9842L2.60378 7.02633C2.49444 7.07468 2.39447 7.13951 2.30763 7.21781L2.22451 7.3011C2.14669 7.38833 2.08465 7.48682 2.04013 7.59215L2.00191 7.69938C1.95855 7.84531 1.94843 7.99859 1.9723 8.1484L3.28495 16.3456L3.32221 16.5256C3.42862 16.9407 3.66723 17.3168 4.00911 17.5989L4.16101 17.7128C4.47324 17.927 4.83998 18.0579 5.22336 18.091L5.41634 18.0996H12.5824L12.7754 18.091C13.223 18.0525 13.6486 17.8809 13.9906 17.5989L14.1301 17.4725C14.4421 17.1647 14.6468 16.7708 14.7148 16.3456L16.0274 8.14935L16.0389 8.03638C16.0424 7.96081 16.0379 7.88502 16.0246 7.81044L15.9978 7.69938C15.9653 7.58999 15.9149 7.48606 15.8478 7.39205L15.7752 7.3011C15.6974 7.21384 15.6049 7.13906 15.502 7.07994L15.3959 7.02633C15.2863 6.9779 15.1689 6.94689 15.0492 6.93442L14.9288 6.92772H13.1165V8.99473C13.1163 9.52694 12.6697 9.94443 12.1363 9.94447C11.6029 9.94439 11.1562 9.52691 11.1561 8.99473V6.92772H6.84172V8.99473C6.84159 9.52685 6.39576 9.9443 5.86249 9.94447C5.32907 9.94447 4.88244 9.52696 4.8823 8.99473V6.92772H3.07095ZM8.99891 1.90043C8.49608 1.90053 8.01257 2.06912 7.62893 2.37147L7.4713 2.50838C7.0677 2.89647 6.84185 3.4213 6.84172 3.96649V4.74102H11.1561V3.96649C11.156 3.48959 10.9841 3.0284 10.6708 2.6606L10.5275 2.50838C10.1235 2.12005 9.57346 1.90045 8.99891 1.90043Z' fill='white' /%3E%3C/svg%3E");
height: 20px;
width: 18px;
background-size: contain;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
content: '';
background-repeat: no-repeat;
}
.main-food_reviews-title{
font-size: 24px;
}
.main-food_reviews-star{
width: 82px;
top: -20px;
}
.main-reviews_title{
font-size: 32px;
}
.marketplace__swiper{
overflow: visible;
}
@ -3812,88 +3456,6 @@ background-color: #fff;
}
.main-food_reviews-slide-head{
position: relative;
}
.main-food_reviews-slide-photo{
height: 48px;
width: 48px;
flex-shrink: 0;
position: absolute;
top: 0;
left: 0;
border-radius: 50%;
object-fit: cover;
}
.main-food_reviews-slide-name, .main-food_reviews-slide-position{
padding-left: 64px;
}
.main-food_reviews-slide-name.--no-padding-left, .main-food_reviews-slide-position.--no-padding-left{
padding-left: 0;
}
.main-food_reviews-slide-name, .main-food_reviews-slide-position, .main-food_reviews-slide-head{
width: 100%;
}
.main-food_reviews-slide-media_file{
height: 220px;
width: 100%;
border-radius: 32px;
margin-bottom: 1rem;
object-fit: cover;
}
.main-food_reviews-slide-media_file-wrap{
width: 100%;
display: block;
}
@media (max-width: 640px) {
.main-food_reviews-slide-name{
min-height: 48px;
display: flex;
align-items: center;
}
.main-food_reviews-slide-position{
padding-left: 0;
}
}
.main-food_reviews-slide-media_main{
border-radius: 25px;
width: 168px;
height: 115px;
overflow: hidden;
}
.main-food_reviews-slide-media_main img{
width: 168px;
height: 115px;
}
.main-food_reviews-slide-media_mini{
width: 56px;
height: 70px;
border-radius: 16px;
overflow: hidden;
}
.main-food_reviews-slide-media_wrap{
display: flex;
gap: 6px;
align-items: center;
margin-bottom: 20px;
}
.main-food_reviews-slide-media_wrap img{
object-fit: cover;
}
.main-food_reviews-slide-media_mini img{
width: 56px;
height: 70px;
}
@media (max-width: 576px) {
.about_slider .slide {
@ -3955,81 +3517,9 @@ background-color: #fff;
position: relative;
}
.mform__review{
max-height: 90vh;
overflow: auto;
}
.mform__review-wrap{
background-color: #fff;
max-width: 1200px;
width: calc(100% - 20px);
border-radius: 32px;
padding: 40px;
margin: auto;
max-width: 1200px;
width: calc(100% - 20px); position: relative;
}
.read-more{
font-weight: 500;
font-size: 16px;
line-height: 140%;
text-decoration: underline;
text-decoration-skip-ink: none;
background: radial-gradient(278.91% 196.13% at 128.36% -48.29%, rgb(238, 104, 104) 0%, rgb(86, 158, 240) 57.692307233810425%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-top: 2rem;
border-bottom: 1px rgb(86, 158, 240) solid;
display: block;
width: max-content;
}
@media (max-width: 640px) {
.mform__review-wrap{
padding: 24px;
padding-top: 60px;
padding-right: 10px;
}
.mform__review{
padding-right: 16px;
}
}
/* Для Chrome, Edge и Safari */
.mform__review::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.mform__review::-webkit-scrollbar-track {
background: #f5f5f5;
border-radius: 10px;
}
.mform__review::-webkit-scrollbar-thumb {
background-color: #81bafc;
border-radius: 10px;
border: 2px solid #f5f5f5;
}
.mform__review::-webkit-scrollbar-thumb:hover {
background-color: #63acff;
}
@media (max-width: 576px) {
.main-food_reviews {
min-height: 720px;
height: 80vh;
max-height: 850px;
}
.main-food_reviews-slide {
min-height: 640px;
height: calc(80vh - 80px);
max-height: 770px;
}
.main-bot .swiper-pagination-bullet{
width: 91px;
}

@ -415,19 +415,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
})
jQuery('.main-food_reviews-slide-media_mini').on('click', function(){
var main = jQuery(this).closest('.main-food_reviews-slide-media_wrap').find('.main-food_reviews-slide-media_main')
var src = jQuery(this).attr('src')
var href = jQuery(this).data('video')
if (!href){
href = src
}
jQuery(main).attr('href', href)
jQuery(main).attr('src', src)
})
jQuery('.main-food_reviews-slide-media_wrap').each(function(){
jQuery(this).find('.main-food_reviews-slide-media_mini')[0].click()
})
});

@ -1,5 +1,8 @@
<?
/* TO_DO удалить файл, перенеся логику подключения файлов ajax-controller
в логику связанную с модулями ( что сейчас в temp-functions/modules-logic.php) */
// Функция для рекурсивного подключения файлов
function requireAjaxControllers($baseDir) {
$modules = glob($baseDir . '/*', GLOB_ONLYDIR);
@ -14,16 +17,16 @@ die();
require_once $moduleController;
}
$componentsDir = $module . '/components';
if (is_dir($componentsDir)) {
$components = glob($componentsDir . '/*', GLOB_ONLYDIR);
foreach ($components as $component) {
$componentController = $component . '/component-ajax-controller.php';
if (file_exists($componentController)) {
require_once $componentController;
}
}
}
// $componentsDir = $module . '/components';
// if (is_dir($componentsDir)) {
// $components = glob($componentsDir . '/*', GLOB_ONLYDIR);
// foreach ($components as $component) {
// $componentController = $component . '/component-ajax-controller.php';
// if (file_exists($componentController)) {
// require_once $componentController;
// }
// }
// }
}
}

@ -1,71 +1,57 @@
<?
use Timber;
use Timber\PostCollection;
use Timber\Integrations\WooCommerce\Product as TimberProduct;
Timber::$dirname = [
[
'modules',
'templates'
],
];
add_filter( 'timber/integrations', function ( array $integrations ): array {
$integrations[] = new \Timber\Integrations\WooCommerce\WooCommerceIntegration();
return $integrations;
} );
add_action('timber/init', function() {
// Инициализируем WooCommerce интеграцию
if (class_exists('Timber\Integrations\WooCommerce\WooCommerce')) {
Timber\Integrations\WooCommerce\WooCommerce::init();
}
});
// Add the function to the Timber context
add_filter('timber/context', function($context) {
$context['template_path'] = get_template_directory_uri();
$current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$context['current_url'] = htmlspecialchars($current_url);
return $context;
});
add_action('init', function() {
add_filter('timber/context', function($context) {
$context['current_lang'] = pll_current_language();
return $context;
});
}, 1);
class WooProduct extends Timber\Post {
protected $wc_product;
public function __construct ($pid = null) {
parent::__construct($pid);
$this->wc_product = wc_get_product($this->ID);
}
public function price() {
return $this->wc_product->get_price();
}
public function get_price_html() {
return $this->wc_product->get_price_html();
}
public function get_attr() {
return $this->wc_product->get_attribute('pa_compound');
}
};
add_filter('timber/post/classmap', function ($classmap) {
$custom_classmap = [
'product' => WooProduct::class,
];
return array_merge($classmap, $custom_classmap);
});
<?
use Timber;
use Timber\PostCollection;
use Timber\Integrations\WooCommerce\Product as TimberProduct;
Timber::$dirname = [
'views',
'modules'
];
// Настройка путей для WooCommerce шаблонов
add_filter('timber/loader/paths', function($paths) {
$paths[] = get_template_directory() . '/views/woocommerce';
return $paths;
});
add_filter( 'timber/integrations', function ( array $integrations ): array {
$integrations[] = new \Timber\Integrations\WooCommerce\WooCommerceIntegration();
return $integrations;
} );
// Add the function to the Timber context
add_filter('timber/context', function($context) {
$context['template_path'] = get_template_directory_uri();
$current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$context['current_url'] = htmlspecialchars($current_url);
// Добавляем WooCommerce контекст если WooCommerce активен
if (class_exists('WooCommerce')) {
// WooCommerce автоматически добавляет свой контекст через интеграцию
// Но мы можем его расширить
if (is_woocommerce()) {
$context['is_woocommerce'] = true;
}
}
return $context;
});
add_action('init', function() {
add_filter('timber/context', function($context) {
$context['current_lang'] = pll_current_language();
// Добавляем функцию для получения иконки термина
$context['get_term_icon'] = function($term_id, $taxonomy) {
$product = new CosmopetProduct();
return $product->getTermIcon($term_id, $taxonomy);
};
return $context;
});
}, 1);

@ -16,6 +16,9 @@ add_action('after_setup_theme', function() {
/* TO_DO | убюрать в ajax-контроллер модуля shop + переименовать в что-то связанное с ajax и "листинг" */
//Ajax подгрузка товаров в архиве
add_action( 'wp_ajax_nopriv_get_products', 'get_products' );
add_action( 'wp_ajax_get_products', 'get_products' );

@ -1,38 +0,0 @@
{% set bodyClass = 'main-np new-grad' %}
{% set headerClass = 'white' %}
{% extends 'layout.twig' %}
{% block content %}
{% include '/templates/_pages/new-front-page/main-slider.twig' %}
{% include '/templates/_pages/new-front-page/main-about.twig' %}
{% include '/templates/_pages/new-front-page/main-why.twig' %}
{% include '/templates/_pages/new-front-page/main-food.twig' %}
{% include '/templates/_pages/new-front-page/main-reviews.twig' %}
{% include '/templates/_pages/new-front-page/main-ingredients.twig' %}
{% include '/templates/_pages/new-front-page/main-specialists.twig' %}
<div class="grad-bg">
{% include '/templates/_pages/new-front-page/main-treats.twig' %}
{% include '/templates/_pages/new-front-page/main-bot.twig' %}
{% include '/templates/blog/blog-front-page_block.twig' %}
</div>
{% include '/templates/_pages/new-front-page/main-quiz.twig' %}
{% include '/templates/_pages/new-front-page/main-media.twig' %}
{% include '/templates/_pages/new-front-page/main-cosmopetx.twig' %}
{% include '/templates/_pages/new-front-page/main-gallery.twig' %}
<a href="/o-kompanii/" class="btn-rocket">
<span class="btn-rocket__img"></span>
<span class="btn-rocket__link">
<span class="btn-rocket__text">узнать больше о e-protein</span>
</span>
</a>
<a href="/shop/" class="btn-ufo">
<span class="btn-ufo__img"></span>
<span class="btn-ufo__link">
<span class="btn-ufo__text">в магазин</span>
</span>
</a>
{% endblock %}

@ -1,9 +0,0 @@
<div class="main-food">
<div class="new-container">
<h2 class="main-food_title">сухой гипоаллергенный корм</h2>
<div class="main-food_wrapper">
{% include 'shop/products-section_block.twig' with {product_list: food_list, section: 'food'} %}
{% include 'shop/reviews-section_block.twig' with { section: 'food', rev_list: reviews_food_query } only %}
</div>
</div>
</div>

@ -1,19 +0,0 @@
{% extends 'profile/profile-base.twig' %}
{% block profile_content%}
<div class="cabinet__orders cabinet-content {% if fn('is_wc_endpoint_url') %}active hide{% endif %}">
<!-- <div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc">
<div class="cabinet-card__content">
<p class="cabinet-card__title">{{ function('pll_e', 'Feed subscription') }}</p>
<div class="cabinet-card__element">
<p class="cabinet-card__text">{{ function('pll_e', 'Weekly food delivery for your pet') }}</p>
</div>
<div class="cabinet-card__element">
<button class="button button--gradient button--high-46 form-sub__btn">{{ function('pll_e', 'Get details') }}</button>
</div>
</div>
</div> -->
{% include 'profile/order-list.twig' %}
</div>
</div>
{% endblock %}

@ -1,27 +0,0 @@
{% set profile_pg = 1 %}
{% extends 'profile/profile-base.twig' %}
{% block profile_content%}
<div class="cabinet__orders cabinet-content {% if fn('is_wc_endpoint_url') %}active hide{% endif %}">
<!-- <div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc">
<div class="cabinet-card__content">
<p class="cabinet-card__title">{{ function('pll_e', 'Feed subscription') }}</p>
<div class="cabinet-card__element">
<p class="cabinet-card__text">{{ function('pll_e', 'Weekly food delivery for your pet') }}</p>
</div>
<div class="cabinet-card__element">
<button class="button button--gradient button--high-46 form-sub__btn">{{ function('pll_e', 'Get details') }}</button>
</div>
</div>
</div> -->
{% include 'profile/order-list.twig' %}
</div>
</div>
</main>
{% endblock %}

@ -1,66 +0,0 @@
{% set thumbnail = product.get_image_id() ? function('wp_get_attachment_image_url', product.get_image_id(), 'medium') : function('wc_placeholder_img_src') %}
{% set images = product.get_gallery_image_ids() %}
{% set compound = fn('wc_get_product_terms', product.get_id(), 'pa_compound') %}
<div class="main-food_products-card {{section}} {% for item in compound %}{% set term = get_term(item) %}{{ fn('map_attr_slugs_to_class', term.slug) }} {% endfor %}">
<a href="{{product.get_permalink()}}" class="main-food_products-card-slider">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="main-food_products-card-img">
<img src="{{ thumbnail }}" alt="{{product.get_name()}}">
</div>
</div>
{% if images %}
{% for image in images %}
<div class="swiper-slide">
<div class="main-food_products-card-img">
<img src="{{ function('wp_get_attachment_image_url', image, 'medium') }}" alt="{{ product.get_title() }}">
</div>
</div>
{% endfor %}
{% endif %}
<div class="swiper-dots"></div>
</div>
</a>
<div class="">{% set collection = fn('wc_get_product_terms', product.id, 'pa_collection') %}{% if collection %}
{% set cur_weight = function('get_product_info', product.id, 'weight') %}
<div class="main-food_products-card__weight">
{% for option in collection %}
{% set term = get_term(option) %}
{% set siblings = function('get_collection_siblings' , term.id) %}
{% for sibling in siblings %}
{% set weight = function('get_product_info', sibling.ID, 'weight') %}
{% set s_product = TimberPost(sibling.ID) %}
{% set wc_product = fn('wc_get_product', sibling.ID) %}
{% set s_in_stock = s_product.meta('_stock_status') == 'instock' %}
{% set s_thumbnail = wc_product.get_image_id() ? function('wp_get_attachment_image_url', wc_product.get_image_id(), 'medium') : function('wc_placeholder_img_src') %}
{% set s_images = wc_product.get_gallery_image_ids() %}
{% set s_title = wc_product.get_title() %}
{% set all_images = [s_thumbnail]|merge(s_images|map(image => function('wp_get_attachment_image_url', image, 'medium'))) %}
{% if s_in_stock %}
{% set class = '' %}
{% if weight == cur_weight %}
{% set class = 'active' %}
{% endif %}
{% if weight %}
<button class="main-food_products-card__weight-item {{ class }}" data-image-set='{{ all_images|json_encode() }}' data-product_id="{{sibling.ID}}" data-product_price="{{ function('get_product_info', sibling.ID, 'price') }} {{ fn('get_woocommerce_currency_symbol') }}" data-title="{{s_title}}">
{{ weight }}
</button>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</div>{% endif %}
<a href="{{product.get_permalink()}}" class="main-food_products-card-title">
{{product.get_name()}}
</a>
<div class="main-food_products-card-bottom">
<div class="main-food_products-card-bottom-price">{{ product.get_price() }} {{ fn('get_woocommerce_currency_symbol') }}</div>
<a href="{{ product.add_to_cart_url }}" class="main-food_products-cardbottom-btn ajax_add_to_cart add_to_cart_button" data-product_id="{{ product.id }}"
data-product_sku="{{ product.sku|e('html_attr') }}">{{ fn('pll_e', 'В корзину') }}</a>
</div>
</div>
</div>

@ -1,5 +1,7 @@
{% for post in posts %}
{% include '_blocks/shop/archive-product-tease.twig' with {post: post} %}
{% include 'woocommerce/product-card.twig' with {item : post, addClass: 'product-archive-card'} %}
{% endfor %}
{% if not ended %}

@ -0,0 +1,37 @@
{% set bodyClass = 'main-np new-grad' %}
{% set headerClass = 'white' %}
{% extends 'layout.twig' %}
{% block content %}
{% include '_pages/new-front-page/main-slider.twig' %}
{% include '_pages/new-front-page/main-about.twig' %}
{% include '_pages/new-front-page/main-why.twig' %}
{% include '_pages/new-front-page/main-food.twig' %}
{% include '_pages/new-front-page/main-reviews.twig' %}
{% include '_pages/new-front-page/main-ingredients.twig' %}
{% include '_pages/new-front-page/main-specialists.twig' %}
<div class="grad-bg">
{% include '_pages/new-front-page/main-treats.twig' %}
{% include '_pages/new-front-page/main-bot.twig' %}
{% include 'blog/blog-front-page_block.twig' %}
</div>
{% include '_pages/new-front-page/main-quiz.twig' %}
{% include '_pages/new-front-page/main-media.twig' %}
{% include '_pages/new-front-page/main-cosmopetx.twig' %}
{% include '_pages/new-front-page/main-gallery.twig' %}
<a href="/o-kompanii/" class="btn-rocket">
<span class="btn-rocket__img"></span>
<span class="btn-rocket__link">
<span class="btn-rocket__text">узнать больше о e-protein</span>
</span>
</a>
<a href="/shop/" class="btn-ufo">
<span class="btn-ufo__img"></span>
<span class="btn-ufo__link">
<span class="btn-ufo__text">в магазин</span>
</span>
</a>
{% endblock %}

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

Loading…
Cancel
Save