@ -1,4 +1,5 @@ |
||||
<?php |
||||
|
||||
include_module('blog'); |
||||
include_component('blog', 'archive'); |
||||
|
||||
|
@ -0,0 +1,852 @@ |
||||
/* cabinet */ |
||||
.cabinet{ |
||||
padding: 24px; |
||||
|
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.cabinet__control{ |
||||
margin: 24px; |
||||
margin-bottom: 0; |
||||
|
||||
display: none; |
||||
} |
||||
.cabinet-control__button{ |
||||
margin-left: 8px; |
||||
|
||||
padding: 12px 16px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
|
||||
background: var(--background-white); |
||||
border: 2px solid var(--text-black); |
||||
border-radius: 48px; |
||||
|
||||
transition: opacity .2s ease-out; |
||||
} |
||||
.cabinet-control__button:first-child{ |
||||
margin-left: 0; |
||||
} |
||||
.cabinet-control__button.active{ |
||||
background: var(--background-black); |
||||
color: #fff; |
||||
} |
||||
.cabinet-control__button:hover{ |
||||
opacity: .8; |
||||
} |
||||
.cabinet__orders{ |
||||
width: calc(((100% - 48px) / 3) * 2); |
||||
} |
||||
.cabinet__profile{ |
||||
width: calc((100% - 48px) / 3); |
||||
} |
||||
|
||||
.cabinet-card{ |
||||
margin-top: 32px; |
||||
|
||||
padding: 1px; |
||||
|
||||
border-radius: 20px; |
||||
} |
||||
.cabinet-card:first-child{ |
||||
margin-top: 0; |
||||
} |
||||
.cabinet-card--green{ |
||||
background: var(--background-green); |
||||
} |
||||
.cabinet-card--green-white{ |
||||
background: var(--background-green-white); |
||||
} |
||||
.cabinet-card--green-white .cabinet-card__content{ |
||||
background: none; |
||||
} |
||||
.cabinet-card--red-blue{ |
||||
background: var(--gradient-red); |
||||
} |
||||
.cabinet-card--grey{ |
||||
background: var(--background-9); |
||||
} |
||||
.cabinet-card__content{ |
||||
padding: 23px; |
||||
|
||||
border-radius: 19px; |
||||
|
||||
background-color: var(--background-white); |
||||
} |
||||
.cabinet-card__element{ |
||||
margin-top: 24px; |
||||
|
||||
position: relative; |
||||
} |
||||
.cabinet-card__element--margin-top-32{ |
||||
margin-top: 32px; |
||||
} |
||||
.cabinet-card__element:first-child, |
||||
.cabinet-card__element--margin-top-32:first-child{ |
||||
margin-top: 0 |
||||
} |
||||
.cabinet-card__element-change{ |
||||
position: absolute; |
||||
top: 14px; |
||||
right: 0; |
||||
|
||||
width: 24px; |
||||
aspect-ratio: 1; |
||||
|
||||
background-image: url(../img/svg/main/change-dot.svg); |
||||
border: none; |
||||
background-color: var(--background-white); |
||||
|
||||
transition: opacity .2s ease-out; |
||||
} |
||||
.cabinet-card__element-change:hover{ |
||||
opacity: .8; |
||||
} |
||||
.cabinet-card__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 26px; |
||||
line-height: 123%; |
||||
text-transform: uppercase; |
||||
background: var(--gradient-blue); |
||||
background-clip: text; |
||||
-webkit-background-clip: text; |
||||
-webkit-text-fill-color: transparent; |
||||
} |
||||
.cabinet-card__text{ |
||||
font-family: var(--font-family); |
||||
font-weight: 400; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
|
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card__text--grey{ |
||||
color: var(--text-grey); |
||||
} |
||||
.cabinet-card__label{ |
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 16px; |
||||
line-height: 125%; |
||||
|
||||
color: var(--text-3); |
||||
} |
||||
.cabinet-card__status{ |
||||
padding-left: 20px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
|
||||
position: relative; |
||||
color: #121212; |
||||
} |
||||
.cabinet-card__status--chek{ |
||||
color: var(--text-green); |
||||
} |
||||
.cabinet-card__status--chek::before{ |
||||
content: ''; |
||||
|
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
|
||||
width: 16px; |
||||
height: 16px; |
||||
|
||||
background-image: url(../img/svg/main/status-chek.svg); |
||||
object-fit: contain; |
||||
} |
||||
.cabinet-card__status--cancelled{ |
||||
color: var(--text-red); |
||||
} |
||||
.cabinet-card__status--cancelled::before{ |
||||
content: ''; |
||||
|
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
|
||||
width: 16px; |
||||
height: 16px; |
||||
|
||||
background-image: url(../img/svg/main/status-cancelled.svg); |
||||
object-fit: contain; |
||||
} |
||||
.cabinet-card__block-accounts{ |
||||
display: flex; |
||||
} |
||||
.cabinet-card__account{ |
||||
margin-left: 16px; |
||||
|
||||
width: 40px; |
||||
aspect-ratio: 1; |
||||
|
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
background: var(--background-9); |
||||
border-radius: 50%; |
||||
} |
||||
.cabinet-card__account:first-child{ |
||||
margin-left: 0; |
||||
} |
||||
.cabinet-card__block-buttons{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
} |
||||
.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; |
||||
} |
||||
.cabinet-card__confirm{ |
||||
margin-top: 16px; |
||||
|
||||
border-radius: 20px; |
||||
padding: 4px 24px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 600; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
|
||||
|
||||
background: var(--background-black); |
||||
color: #fff; |
||||
border: none; |
||||
|
||||
transition: opacity .2s ease-out; |
||||
} |
||||
.cabinet-card__confirm:hover{ |
||||
opacity: .8; |
||||
} |
||||
.cabinet-card__text, .cabinet-card__label, .cabinet-card__status, .cabinet-card__block-accounts, .cabinet-card__block-buttons{ |
||||
margin-top: 8px; |
||||
} |
||||
.cabinet-card__text:first-child, .cabinet-card__label:first-child, .cabinet-card__status:first-child, .cabinet-card__block-accounts:first-child, .cabinet-card__block-buttons:first-child{ |
||||
margin-top: 0px; |
||||
} |
||||
.cabinet-card__block-add-pets{ |
||||
width: 100%; |
||||
|
||||
display: flex; |
||||
align-items: center; |
||||
|
||||
background: none; |
||||
border: none; |
||||
} |
||||
.cabinet-card-add-pets__circle{ |
||||
width: 48px; |
||||
aspect-ratio: 1; |
||||
|
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
border: 1px solid var(--text-6); |
||||
border-radius: 50%; |
||||
} |
||||
.cabinet-card-add-pets__text{ |
||||
margin-left: 16px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 600; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
|
||||
color: var(--text-6); |
||||
|
||||
position: relative; |
||||
} |
||||
.cabinet-card-add-pets__text::after{ |
||||
content: ''; |
||||
|
||||
position: absolute; |
||||
left: 0; |
||||
bottom: -4px; |
||||
|
||||
width: 100%; |
||||
height: 1px; |
||||
|
||||
background: var(--text-6); |
||||
} |
||||
.cabinet-card__discount{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.cabinet-card-discount__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 16px; |
||||
line-height: 125%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-discount__percent{ |
||||
margin-left: 16px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 16px; |
||||
line-height: 125%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-discount__percent::after{ |
||||
content: '%'; |
||||
} |
||||
.cabinet-card-discount__arrow{ |
||||
display: inline-block; |
||||
|
||||
margin-left: 6px; |
||||
|
||||
width: 20px; |
||||
aspect-ratio: 1; |
||||
|
||||
background-image: url(../img/svg/main/arrow-breadcrumbs-black.svg); |
||||
background-position: center; |
||||
} |
||||
.cabinet-card__no-orders{ |
||||
margin-top: 32px; |
||||
|
||||
padding: 48px 24px; |
||||
} |
||||
.cabinet-card-no-orders__element{ |
||||
margin-top: 26px; |
||||
} |
||||
.cabinet-card-no-orders__element:first-child{ |
||||
margin-top: 0; |
||||
} |
||||
.cabinet-card-no-orders__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 24px; |
||||
line-height: 133%; |
||||
text-align: center; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card__pet{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.cabinet-card-pet__icon{ |
||||
width: 48px; |
||||
aspect-ratio: 1; |
||||
|
||||
border-radius: 50%; |
||||
background: var(--gradient-blue); |
||||
} |
||||
.cabinet-card-pet-icon__content{ |
||||
margin: 1px; |
||||
|
||||
width: calc(100% - 2px); |
||||
aspect-ratio: 1; |
||||
|
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
border-radius: 50%; |
||||
background: var(--background-white); |
||||
} |
||||
.cabinet-card-pet-icon__content img{ |
||||
width: 32px; |
||||
aspect-ratio: 1; |
||||
|
||||
object-fit: contain; |
||||
} |
||||
.cabinet-card-pet__name{ |
||||
margin-left: 24px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 16px; |
||||
line-height: 125%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card__order{ |
||||
position: relative; |
||||
} |
||||
.cabinet-card-order__header{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: flex-start; |
||||
} |
||||
.cabinet-card-order__main{} |
||||
.cabinet-card-order-main__date{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 24px; |
||||
line-height: 133%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-main__number{ |
||||
margin-top: 8px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-main__number::before{ |
||||
content: '№'; |
||||
} |
||||
.cabinet-card-order__payment{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
|
||||
transition: margin .2s ease-out; |
||||
} |
||||
.cabinet-card-order-payment__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-payment__price{ |
||||
margin-left: 8px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 16px; |
||||
line-height: 125%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-payment__price::after{ |
||||
margin-left: 5px; |
||||
content: '₽'; |
||||
} |
||||
.cabinet-card-order__content{ |
||||
margin-top: 24px; |
||||
} |
||||
.cabinet-card-order__content |
||||
.cabinet-card-order__status{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.cabinet-card-order-status__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-status__pointer{ |
||||
margin-left: 12px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-status__pointer--grey{ |
||||
color: var(--text-6); |
||||
} |
||||
.cabinet-card-order-status__pointer--green{ |
||||
color: var(--text-green); |
||||
} |
||||
.cabinet-card-order-status__pointer--red{ |
||||
color: var(--text-red); |
||||
} |
||||
.cabinet-card-order__block-detail{ |
||||
height: 0; |
||||
overflow: hidden; |
||||
|
||||
transition: height .2s ease-out; |
||||
} |
||||
.cabinet-card-order__detail{ |
||||
padding-top: 24px; |
||||
} |
||||
.cabinet-card-order-detail__address{} |
||||
.cabinet-card-order-detail-address__title{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-detail-address__text{ |
||||
margin-top: 16px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 400; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-detail__main{ |
||||
margin-top: 24px; |
||||
|
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.cabinet-card-order-detail-main__products{} |
||||
.cabinet-card-order-detail-main__product{ |
||||
margin-top: 4px; |
||||
|
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.cabinet-card-order-detail-main__product:first-child{ |
||||
margin-top: 0; |
||||
} |
||||
.cabinet-card-order-detail-main-product__img{ |
||||
width: 106px; |
||||
height: 96px; |
||||
} |
||||
.cabinet-card-order-detail-main-product__content{ |
||||
display: flex; |
||||
} |
||||
.cabinet-card-order-detail-main-product__description{ |
||||
width: 212px; |
||||
} |
||||
.cabinet-card-order-detail-main-product-description__what{ |
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
color: var(--text-black); |
||||
} |
||||
.cabinet-card-order-detail-main-product-description__with-what{ |
||||
margin-top: 8px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
color: var(--text-6); |
||||
} |
||||
.cabinet-card-order-detail-main-product__count{ |
||||
margin-left: 8px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 700; |
||||
font-size: 12px; |
||||
line-height: 133%; |
||||
text-align: right; |
||||
color: var(--text-6); |
||||
} |
||||
.cabinet-card-order-detail-main-product__count::before{ |
||||
margin-right: 4px; |
||||
|
||||
content: 'x'; |
||||
} |
||||
.cabinet-card-order-detail-main-product__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); |
||||
} |
||||
.cabinet-card-order-detail-main-product__price::after{ |
||||
content: ' Р'; |
||||
} |
||||
.cabinet-card-order-detail-main__links{ |
||||
display: flex; |
||||
flex-direction: column; |
||||
} |
||||
.cabinet-card-order-detail-main__link{ |
||||
margin-top: 16px; |
||||
} |
||||
.cabinet-card-order-detail-main__link:first-child{ |
||||
margin-top: 0; |
||||
} |
||||
.cabinet-card-order__open-detail{ |
||||
margin-top: 24px; |
||||
|
||||
padding-right: 24px; |
||||
|
||||
font-family: var(--font-family); |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 120%; |
||||
color: var(--text-black); |
||||
|
||||
border: none; |
||||
background: none; |
||||
|
||||
position: relative; |
||||
} |
||||
.cabinet-card-order__open-detail::after{ |
||||
content: ''; |
||||
|
||||
position: absolute; |
||||
top: 6.75px; |
||||
right: 0; |
||||
|
||||
width: 12.5px; |
||||
height: 10.5px; |
||||
|
||||
background-image: url(../../core/img/svg/main/arrow-black.svg); |
||||
background-size: contain; |
||||
background-position: center; |
||||
background-repeat: no-repeat; |
||||
|
||||
transition: transform .2s; |
||||
/* transform: rotate(180deg); */ |
||||
} |
||||
.cabinet-card-order-detail-short__item{ |
||||
object-fit: contain; |
||||
} |
||||
.cabinet-card-order__detail-short{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: flex-end; |
||||
max-width: calc(100% - 250px); |
||||
margin-left: auto; |
||||
overflow: auto; |
||||
/* flex-wrap: wrap; */ |
||||
transition: all .2s .1s ease-out; |
||||
} |
||||
.cabinet-card-order__bottom{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
} |
||||
@media (max-width: 768px) { |
||||
.cabinet-card-order__bottom{ |
||||
display: flex; |
||||
align-items: flex-start; |
||||
flex-direction: column-reverse; |
||||
margin-top: 16px; |
||||
} |
||||
.cabinet-card-order__detail-short{ |
||||
max-width: calc(100%); |
||||
flex-wrap: wrap; |
||||
justify-content: flex-start; |
||||
margin-left: 0; |
||||
} |
||||
} |
||||
.cabinet-card-order-detail-short__item{ |
||||
border-radius: 16px; |
||||
width: 106px; |
||||
height: 96px; |
||||
} |
||||
.cabinet-card__download{ |
||||
margin-top: 32px; |
||||
} |
||||
.cabinet-card__order.active .cabinet-card-order__detail-short{ |
||||
opacity: 0; |
||||
height: 0; |
||||
} |
||||
.cabinet-card__order.active .cabinet-card-order__open-detail::after{ |
||||
transform: rotate(180deg); |
||||
} |
||||
/* .cabinet-card-no-orders__ */ |
||||
.cabinet__subscription-pc{ |
||||
} |
||||
.cabinet__subscription-mobile{ |
||||
display: none; |
||||
} |
||||
/* cabinet */ |
||||
|
||||
.main-page-wrapper{ |
||||
margin-top: 20px !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; |
||||
} |
||||
|
||||
@media only screen and (max-width: 1200px) { |
||||
/* 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 */ |
||||
} |
||||
@media only screen and (max-width: 750px) { |
||||
/* cabinet */ |
||||
.cabinet-card-order__open-detail{ |
||||
margin-top: 0px; |
||||
} |
||||
.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__detail-short{ |
||||
max-width: 100%; |
||||
} |
||||
.cabinet-card-order__content, .cabinet-card-order__bottom{ |
||||
margin-top: 0; |
||||
} |
||||
/* cabinet */ |
||||
} |
||||
@media only screen and (max-width: 720px) { |
||||
/* 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__products{ |
||||
position: relative; |
||||
} |
||||
.cabinet-card-order-detail-main-product__content{ |
||||
margin-left: 16px; |
||||
|
||||
flex-wrap: wrap; |
||||
|
||||
|
||||
} |
||||
.cabinet-card-order-detail-main-product__description{ |
||||
width: 100%; |
||||
} |
||||
.cabinet-card-order-detail-main-product__count{ |
||||
margin-left: 0; |
||||
margin-top: 7px; |
||||
} |
||||
.cabinet-card-order-detail-main-product__price{ |
||||
margin-top: 7px; |
||||
} |
||||
.cabinet-card__content{ |
||||
padding-right: 19px; |
||||
} |
||||
/* .cabinet-card__order.active */ |
||||
/* .cabinet-card__order.active */ |
||||
/* cabinet */ |
||||
} |
||||
|
||||
@media only screen and (max-width: 576px) { |
||||
/* 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-card-order-detail-short__item { |
||||
border-radius: 16px; |
||||
width: 80px; |
||||
height: 80px; |
||||
} |
||||
|
||||
/* cabinet */ |
||||
} |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 615 B |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 491 B |
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 456 B |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 954 B |
After Width: | Height: | Size: 983 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 349 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 453 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 695 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 623 B |
After Width: | Height: | Size: 855 B |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,300 @@ |
||||
'use strict'; |
||||
|
||||
|
||||
let widthPhoneCabinet = 1200; |
||||
|
||||
toggleOpenX('.cabinet-card__order', '.cabinet-card-order__open-detail', '.cabinet-card-order__detail', '.cabinet-card-order__block-detail'); |
||||
// modalFormOpen('.form-open');
|
||||
|
||||
// closeModalForm('.modal-form__close');
|
||||
// closeModalForm('.modal-form__button-close');
|
||||
|
||||
controlCabinet('.cabinet-control__button', '.cabinet', widthPhoneCabinet); |
||||
|
||||
function controlCabinet(buttons, main, minWidth){ |
||||
let thisWidth = window.innerWidth; |
||||
let thisMain = document.querySelector(main); |
||||
|
||||
let thisButtons = document.querySelectorAll(buttons); |
||||
|
||||
thisButtons.forEach(e => { |
||||
e.onclick = function (element){ |
||||
let thisContent = document.querySelector(`.cabinet__${e.dataset.cabinet}`); |
||||
let newHeight = thisContent.clientHeight + 48; |
||||
let thisButton = element.target; |
||||
|
||||
thisMain.style.height = `${newHeight}px` |
||||
|
||||
if (!thisContent.classList.contains('active')) { |
||||
thisMain.querySelector('.active').classList.remove('active'); |
||||
thisContent.classList.add('active'); |
||||
|
||||
setTimeout(() => { |
||||
thisMain.style.height = 'auto'; |
||||
|
||||
if (thisMain.querySelector('.hide')) { |
||||
thisMain.querySelector('.hide').classList.remove('hide'); |
||||
} |
||||
|
||||
thisMain.querySelector('.active').classList.add('hide'); |
||||
}, 200); |
||||
} |
||||
|
||||
thisButtons.forEach(e => { |
||||
e.classList.remove('active'); |
||||
}) |
||||
thisButton.classList.add('active'); |
||||
} |
||||
}) |
||||
|
||||
} |
||||
|
||||
// let modal = document.querySelector('.modal');
|
||||
// modal.onclick = function (eventModal) {
|
||||
// let thisTarget = eventModal.target;
|
||||
|
||||
// if (thisTarget.classList.contains('modal')) {
|
||||
// thisTarget.classList.remove('active');
|
||||
|
||||
// if (!thisTarget.querySelector('.modal-map.active')) {
|
||||
// thisTarget.querySelector('.modal-form.active').classList.remove('active');
|
||||
// }else{
|
||||
// thisTarget.querySelector('.modal-map.active').classList.remove('active');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function modalOpen(buttonElement, contentElement){
|
||||
// let modal = document.querySelector('.modal'),
|
||||
// aside = document.querySelector('.modal__aside'),
|
||||
// elements = document.querySelectorAll(buttonElement),
|
||||
// device = window.screen.width;
|
||||
|
||||
// elements.forEach(e => {
|
||||
// let thisContentElement = document.querySelector(contentElement);
|
||||
|
||||
// e.onclick = function () {
|
||||
// modal.classList.add('active');
|
||||
// thisContentElement.classList.add('active');
|
||||
|
||||
// let width = thisContentElement.clientWidth;
|
||||
|
||||
// setTimeout(() => {
|
||||
// if (device <= 720) {
|
||||
// aside.style.width = `${device}px`;
|
||||
// thisContentElement.style.opacity = 1;
|
||||
// thisContentElement.style.filter = 'blur(0px)';
|
||||
// }else{
|
||||
// aside.style.width = `${width}px`;
|
||||
// thisContentElement.style.opacity = 1;
|
||||
// thisContentElement.style.filter = 'blur(0px)';
|
||||
// }
|
||||
// }, 10);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// function modalClose(buttonElement) {
|
||||
// let modal = document.querySelector('.modal'),
|
||||
// aside = document.querySelector('.modal__aside'),
|
||||
// asideItems = document.querySelectorAll('.modal__item'),
|
||||
// elements = document.querySelectorAll(buttonElement);
|
||||
|
||||
// elements.forEach(e => {
|
||||
// e.onclick = function () {
|
||||
// aside.style.width = '0px';
|
||||
|
||||
// asideItems.forEach(e => {
|
||||
// if (e.classList.contains('active')) {
|
||||
// e.style.filter = 'blur(10px)';
|
||||
// }
|
||||
// });
|
||||
|
||||
// setTimeout(() => {
|
||||
// asideItems.forEach(e => {
|
||||
// if (e.classList.contains('active')) {
|
||||
// e.classList.remove('active');
|
||||
// }
|
||||
// });
|
||||
|
||||
// modal.classList.remove('active');
|
||||
// }, 300);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// function closeModalForm(close){
|
||||
// let buttons = document.querySelectorAll(close),
|
||||
// modal = document.querySelector('.modal');
|
||||
|
||||
// buttons.forEach(button => {
|
||||
// button.onclick = function (buttonEvent) {
|
||||
// modal.classList.remove('active');
|
||||
|
||||
// if (!modal.querySelector('.modal-map.active')) {
|
||||
// modal.querySelector('.modal-form.active').classList.remove('active');
|
||||
// }else{
|
||||
// modal.querySelector('.modal-map.active').classList.remove('active');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) { |
||||
let elements = document.querySelectorAll(mainElement); |
||||
|
||||
elements.forEach(e => { |
||||
let thisMainElement = e, |
||||
thisButtonElement = e.querySelector(buttonElement), |
||||
thisHeightElement = e.querySelector(heightElement), |
||||
thisContentElement = e.querySelector(contentElement);
|
||||
|
||||
thisButtonElement.onclick = function (e) { |
||||
let height = thisHeightElement.clientHeight; |
||||
|
||||
if (close == true && !thisMainElement.classList.contains('active')) { |
||||
elements.forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.classList.remove('active'); |
||||
e.querySelector(contentElement).style.height = null |
||||
}
|
||||
}) |
||||
} |
||||
|
||||
if (!thisMainElement.classList.contains('active')) { |
||||
thisContentElement.style.height = `${height}px`; |
||||
thisMainElement.classList.add('active'); |
||||
}else{ |
||||
thisContentElement.style.height = null; |
||||
thisMainElement.classList.remove('active'); |
||||
} |
||||
} |
||||
|
||||
}); |
||||
} |
||||
|
||||
// function toggleHeader(button, content, blockheight, removeBlock, removeClass) {
|
||||
// let thisButton = document.querySelector(button),
|
||||
// thisContent = document.querySelector(content),
|
||||
// thisRemoveBlock = document.querySelector(removeBlock) || '',
|
||||
// thisBlockheight = document.querySelector(blockheight);
|
||||
|
||||
// thisButton.onclick = function () {
|
||||
// let height = thisBlockheight.clientHeight;
|
||||
|
||||
// if (!thisContent.classList .contains('open')) {
|
||||
// thisContent.style.height = `${height}px`;
|
||||
// thisContent.classList .add('open');
|
||||
|
||||
// if (removeBlock) {
|
||||
// thisRemoveBlock.classList.remove(removeClass);
|
||||
// }
|
||||
// }else{
|
||||
// thisContent.style.height = null;
|
||||
// thisContent.classList .remove('open');
|
||||
|
||||
// if (removeBlock) {
|
||||
// if (window.scrollY <= 25) {
|
||||
// thisRemoveBlock.classList.add(removeClass);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function modalFormOpen(formOrNotification) {
|
||||
// let buttons = document.querySelectorAll(formOrNotification),
|
||||
// modal = document.querySelector('.modal');
|
||||
|
||||
// buttons.forEach(button => {
|
||||
// button.onclick = function (eventButton) {
|
||||
// let classOpenForm = button.dataset.form,
|
||||
// form = modal.querySelector(`.${classOpenForm}`);
|
||||
|
||||
// form.classList.add('active');
|
||||
// modal.classList.add('active');
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
// function
|
||||
|
||||
|
||||
// export function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) {
|
||||
// let elements = document.querySelectorAll(mainElement);
|
||||
|
||||
// elements.forEach(e => {
|
||||
// let thisMainElement = e,
|
||||
// thisButtonElement = e.querySelector(buttonElement),
|
||||
// thisHeightElement = e.querySelector(heightElement),
|
||||
// thisContentElement = e.querySelector(contentElement);
|
||||
|
||||
// thisButtonElement.onclick = function (e) {
|
||||
// let height = thisHeightElement.clientHeight;
|
||||
|
||||
// if (close == true && !thisMainElement.classList.contains('active')) {
|
||||
// elements.forEach(e => {
|
||||
// if (e.classList.contains('active')) {
|
||||
// e.classList.remove('active');
|
||||
// e.querySelector(contentElement).style.height = null
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// if (!thisMainElement.classList.contains('active')) {
|
||||
// thisContentElement.style.height = `${height}px`;
|
||||
// thisMainElement.classList.add('active');
|
||||
// }else{
|
||||
// thisContentElement.style.height = null;
|
||||
// thisMainElement.classList.remove('active');
|
||||
// }
|
||||
// }
|
||||
|
||||
// });
|
||||
// }
|
||||
|
||||
// export function toggleHeader(button, content, blockheight, removeBlock, removeClass) {
|
||||
// let thisButton = document.querySelector(button),
|
||||
// thisContent = document.querySelector(content),
|
||||
// thisRemoveBlock = document.querySelector(removeBlock) || '',
|
||||
// thisBlockheight = document.querySelector(blockheight);
|
||||
|
||||
// thisButton.onclick = function () {
|
||||
// let height = thisBlockheight.clientHeight;
|
||||
|
||||
// if (!thisContent.classList .contains('open')) {
|
||||
// thisContent.style.height = `${height}px`;
|
||||
// thisContent.classList .add('open');
|
||||
|
||||
// if (removeBlock) {
|
||||
// thisRemoveBlock.classList.remove(removeClass);
|
||||
// }
|
||||
// }else{
|
||||
// thisContent.style.height = null;
|
||||
// thisContent.classList .remove('open');
|
||||
|
||||
// if (removeBlock) {
|
||||
// if (window.scrollY <= 25) {
|
||||
// thisRemoveBlock.classList.add(removeClass);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// export function modalFormOpen(formOrNotification) {
|
||||
// let buttons = document.querySelectorAll(formOrNotification),
|
||||
// modal = document.querySelector('.modal');
|
||||
|
||||
// buttons.forEach(button => {
|
||||
// button.onclick = function (eventButton) {
|
||||
// let classOpenForm = button.dataset.form,
|
||||
// form = modal.querySelector(`.${classOpenForm}`);
|
||||
|
||||
// form.classList.add('active');
|
||||
// modal.classList.add('active');
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// function
|
@ -0,0 +1,188 @@ |
||||
<?php |
||||
|
||||
// namespace Cdek\UI; |
||||
|
||||
// use Cdek\UI\Cdek\CdekApi; |
||||
// use Cdek\UI\Cdek\Config; |
||||
// use Cdek\UI\Cdek\Helpers\WeightCalc; |
||||
// use Cdek\UI\Cdek\MetaKeys; |
||||
// use Cdek\UI\Exception; |
||||
// use Cdek\UI\WC_Order_Item_Shipping; |
||||
// $api = new CdekApi(); |
||||
|
||||
$context = Timber::get_context(); |
||||
|
||||
$current_user = wp_get_current_user(); |
||||
$context['current_user'] = $current_user; |
||||
$context['first_name'] = $current_user->user_firstname; |
||||
$context['last_name'] = $current_user->user_lastname; |
||||
$context['email'] = $current_user->user_email; |
||||
$context['phone'] = get_user_meta($current_user->ID, 'billing_phone', true); |
||||
$context['tg_account'] = get_user_meta($current_user->ID, 'tg_account', true); |
||||
|
||||
// ACF поля для пользователя |
||||
$context['activated'] = get_field('activated', 'user_' . get_current_user_id()); |
||||
$context['uuid'] = get_field('uuid', 'user_' . get_current_user_id()); |
||||
|
||||
// Запрос для питомцев |
||||
$current_user_id = get_current_user_id(); |
||||
if ($current_user_id) { |
||||
$args = [ |
||||
'post_type' => 'pets', |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'user', |
||||
'value' => $current_user_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]; |
||||
$context['pets'] = Timber::get_posts($args); |
||||
} |
||||
|
||||
// Заказы пользователя |
||||
$context['customer_orders'] = wc_get_orders(['customer_id' => $current_user->ID]); |
||||
// В page-profile.php, внутри цикла заказов |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// foreach ($context['customer_orders'] as &$order) { |
||||
// $meta_data = get_post_meta($order->get_id(), 'order_data', true); |
||||
// if (isset($meta_data['office_code'])) { |
||||
// $office_data = json_decode($api->getOffices(['code' => $meta_data['office_code']])['body'], true); |
||||
// $order->office_name = $office_data[0]['name'] ?? ''; |
||||
// } |
||||
// } |
||||
|
||||
|
||||
|
||||
|
||||
$context['bot_username'] = defined('BOT_USERNAME') ? BOT_USERNAME : ''; |
||||
|
||||
// Текущий пользователь |
||||
$current_user_id = get_current_user_id(); |
||||
$context['current_user_id'] = $current_user_id; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Запрос для питомцев |
||||
// if ($current_user_id) { |
||||
// $args = [ |
||||
// 'post_type' => 'pets', |
||||
// 'meta_query' => [ |
||||
// [ |
||||
// 'key' => 'user', |
||||
// 'value' => $current_user_id, |
||||
// 'compare' => '=' |
||||
// ] |
||||
// ] |
||||
// ]; |
||||
// $pets = Timber::get_posts($args); |
||||
|
||||
// // Обработка ACF-полей для каждого питомца |
||||
// foreach ($pets as &$pet) { |
||||
// // ACF-поля |
||||
// $pet->weight = get_field('weight', $pet->ID); |
||||
// $pet->old = get_field('old', $pet->ID); |
||||
// $pet->activity = get_field('activity', $pet->ID); |
||||
|
||||
// // Перевод веса |
||||
// switch ($pet->weight) { |
||||
// case 'below_1_5': |
||||
// $pet->weight_text = __('from 0,5 kg to 1,5 kg', 'woodmart'); |
||||
// break; |
||||
// case '1_5-3': |
||||
// $pet->weight_text = __('from 1.5 to 3 kg', 'woodmart'); |
||||
// break; |
||||
// case '3-5': |
||||
// $pet->weight_text = __('from 3 to 5 kg', 'woodmart'); |
||||
// break; |
||||
// case '5-8': |
||||
// $pet->weight_text = __('from 5 to 8 kg', 'woodmart'); |
||||
// break; |
||||
// case '8-11': |
||||
// $pet->weight_text = __('from 8 to 11 kg', 'woodmart'); |
||||
// break; |
||||
// case '11-15': |
||||
// $pet->weight_text = __('from 11 to 15 kg', 'woodmart'); |
||||
// break; |
||||
// case '15-20': |
||||
// $pet->weight_text = __('from 15 to 20 kg', 'woodmart'); |
||||
// break; |
||||
// case '20-25': |
||||
// $pet->weight_text = __('from 20 to 25 kg', 'woodmart'); |
||||
// break; |
||||
// case '25-35': |
||||
// $pet->weight_text = __('from 25 to 35 kg', 'woodmart'); |
||||
// break; |
||||
// case 'more_35': |
||||
// $pet->weight_text = __('More than 35 kg', 'woodmart'); |
||||
// break; |
||||
// default: |
||||
// $pet->weight_text = ''; |
||||
// } |
||||
|
||||
// // Перевод возраста |
||||
// switch ($pet->old) { |
||||
// case 'normal': |
||||
// $pet->old_text = __('Adult (from 1 year to 7 years)', 'woodmart'); |
||||
// break; |
||||
// case 'old': |
||||
// $pet->old_text = __('Elderly (from 7 to 12 years)', 'woodmart'); |
||||
// break; |
||||
// case 'very_old': |
||||
// $pet->old_text = __('Aging (12 years and older)', 'woodmart'); |
||||
// break; |
||||
// case 'baby': |
||||
// $pet->old_text = __('Baby (from 0 to 1 year)', 'woodmart'); |
||||
// break; |
||||
// default: |
||||
// $pet->old_text = ''; |
||||
// } |
||||
|
||||
// // Перевод активности |
||||
// switch ($pet->activity) { |
||||
// case 'low': |
||||
// $pet->activity_text = __('Low', 'woodmart'); |
||||
// break; |
||||
// case 'moderate': |
||||
// $pet->activity_text = __('Moderate', 'woodmart'); |
||||
// break; |
||||
// case 'high': |
||||
// $pet->activity_text = __('High', 'woodmart'); |
||||
// break; |
||||
// default: |
||||
// $pet->activity_text = ''; |
||||
// } |
||||
// } |
||||
|
||||
// $context['pets'] = $pets; |
||||
// } |
||||
|
||||
|
||||
|
||||
|
||||
// Месяцы для локализации |
||||
$context['months'] = [ |
||||
__('january', 'woodmart'), |
||||
__('february', 'woodmart'), |
||||
__('march', 'woodmart'), |
||||
__('april', 'woodmart'), |
||||
__('may', 'woodmart'), // Исправлено 'mail' на 'may' |
||||
__('june', 'woodmart'), |
||||
__('july', 'woodmart'), |
||||
__('august', 'woodmart'), |
||||
__('september', 'woodmart'), |
||||
__('october', 'woodmart'), |
||||
__('november', 'woodmart'), |
||||
__('december', 'woodmart'), |
||||
]; |
||||
|
||||
|
||||
|
||||
Timber::render('templates/profile/profile.twig', $context); |
||||
?> |
@ -0,0 +1,133 @@ |
||||
<?php |
||||
|
||||
// include_module('profile'); |
||||
|
||||
// Сохранить значения полей |
||||
add_action('wp_ajax_edit_user', 'save_custom_user_profile_fields'); |
||||
add_action('wp_ajax_nopriv_edit_user', 'save_custom_user_profile_fields'); // |
||||
|
||||
function save_custom_user_profile_fields() { |
||||
// Проверка прав пользователя |
||||
wp_update_user( array( |
||||
'ID' => get_current_user_id(), |
||||
'first_name' => $_POST['name'], |
||||
'last_name' => $_POST['l_name'], |
||||
|
||||
) ); |
||||
|
||||
$phone = update_user_meta( get_current_user_id(), 'billing_phone', $_POST['full'] ); |
||||
|
||||
} |
||||
|
||||
function ajax_add_pet() { |
||||
$current_user = wp_get_current_user(); |
||||
// Подготовка данных |
||||
$pet_name = $_POST['name']; |
||||
$old_type = $_POST['old_type']; |
||||
if ($old_type == 'ex'){ |
||||
$old= $_POST['old']; |
||||
} |
||||
|
||||
$weight= $_POST['weight']; |
||||
$activity = $_POST['activity']; |
||||
$pet = $_POST['pet']; |
||||
$breed = $_POST['breed']; |
||||
$sex = $_POST['sex']; |
||||
$user = $current_user->ID; |
||||
|
||||
$post_data = array( |
||||
'post_title' => $pet_name, |
||||
'post_type' => 'pets', |
||||
'post_status' => 'publish', |
||||
); |
||||
|
||||
|
||||
$post_id = wp_insert_post($post_data); |
||||
var_dump($post_id); |
||||
if ($post_id) { |
||||
// Добавление мета-полей |
||||
if ($old_type == 'ex'){ |
||||
|
||||
update_field( 'old', $old, $post_id ); |
||||
|
||||
|
||||
} |
||||
else{ |
||||
|
||||
update_field( 'day', $_POST['day'], $post_id ); |
||||
update_field( 'month', $_POST['month'], $post_id ); |
||||
update_field( 'year', $_POST['year'], $post_id ); |
||||
} |
||||
update_field( 'weight', $weight, $post_id ); |
||||
update_field( 'breed', $breed, $post_id ); |
||||
update_field( 'sex', $sex, $post_id ); |
||||
update_field( 'type', $pet, $post_id ); |
||||
update_field( 'user', $user, $post_id ); |
||||
update_field( 'activity', $activity, $post_id ); |
||||
if($_POST['sterilized']=='1' && $pet=='cat'){ |
||||
update_field( 'sterilized', true ); |
||||
} |
||||
else{ |
||||
update_field( 'sterilized', false ); |
||||
} |
||||
wp_send_json_success('Питомец успешно добавлен!'); |
||||
} else { |
||||
wp_send_json_error('Ошибка при добавлении питомца.'); |
||||
} |
||||
|
||||
wp_die(); // Завершение работы |
||||
} |
||||
add_action('wp_ajax_add_pet', 'ajax_add_pet'); |
||||
add_action('wp_ajax_nopriv_add_pet', 'ajax_add_pet'); // Если нужно разрешить для незалогиненных пользователей |
||||
|
||||
function ajax_edit_pet() { |
||||
$current_user = wp_get_current_user(); |
||||
// Подготовка данных |
||||
$pet_name = $_POST['name']; |
||||
$old_type = $_POST['old_type']; |
||||
if ($old_type == 'ex'){ |
||||
$old= $_POST['old']; |
||||
} |
||||
else{ |
||||
$old_acc = $_POST['day'] . ' ' . $_POST['month'] . ' ' . $_POST['year']; |
||||
} |
||||
$weight= $_POST['weight']; |
||||
$activity = $_POST['activity']; |
||||
$pet = $_POST['pet']; |
||||
$breed = $_POST['breed']; |
||||
$sex = $_POST['sex']; |
||||
$user = $current_user->ID; |
||||
|
||||
$post_id = intval($_POST['pet_id']); |
||||
|
||||
if (get_field('user', $post_id) == $user) { |
||||
// Добавление мета-полей |
||||
if ($old_type == 'ex'){ |
||||
update_field( 'old', $old, $post_id ); |
||||
} |
||||
else{ |
||||
update_field( 'old', '', $post_id ); |
||||
update_field( 'day', $_POST['day'], $post_id ); |
||||
update_field( 'month', $_POST['month'], $post_id ); |
||||
update_field( 'year', $_POST['year'], $post_id ); |
||||
} |
||||
update_field( 'weight', $weight, $post_id ); |
||||
update_field( 'breed', $breed, $post_id ); |
||||
update_field( 'sex', $sex, $post_id ); |
||||
update_field( 'type', $pet, $post_id ); |
||||
update_field( 'activity', $activity, $post_id ); |
||||
if($_POST['sterilized']=='1' && $pet=='cat'){ |
||||
update_field( 'sterilized', true ); |
||||
} |
||||
else{ |
||||
update_field( 'sterilized', false ); |
||||
} |
||||
wp_send_json_success('Питомец успешно отредактирован!'); |
||||
} else { |
||||
wp_send_json_error('Ошибка при редактировании питомца.'); |
||||
} |
||||
|
||||
wp_die(); // Завершение работы |
||||
} |
||||
add_action('wp_ajax_edit_pet', 'ajax_edit_pet'); |
||||
add_action('wp_ajax_nopriv_edit_pet', 'ajax_edit_pet'); |
@ -0,0 +1,178 @@ |
||||
<?php
|
||||
|
||||
pll_register_string( 'Link email', 'Link email'); |
||||
pll_register_string( 'Linked accounts', 'Linked accounts'); |
||||
|
||||
|
||||
add_action('template_redirect', 'redirect_non_logged_in_users'); |
||||
|
||||
function redirect_non_logged_in_users() { |
||||
// URL личного кабинета (замените 'your-account-page-slug' на ваш slug) |
||||
$account_page_slug = 'my-account-3'; |
||||
$account_page_slug__2 = 'my-account'; |
||||
// Проверяем, находится ли пользователь на странице личного кабинета |
||||
if (is_page($account_page_slug) && !is_user_logged_in() || is_page($account_page_slug__2) && !is_user_logged_in() ) { |
||||
wp_redirect(home_url()); // Перенаправляем на главную страницу |
||||
exit; |
||||
} |
||||
} |
||||
|
||||
add_action('init', 'register_pets'); |
||||
function register_pets(){ |
||||
register_post_type('pets', array( |
||||
'labels' => array( |
||||
'name' => 'Питомцы', // Основное название типа записи |
||||
'singular_name' => 'Питомец', // отдельное название записи типа Book |
||||
'add_new' => 'Добавить нового', |
||||
'add_new_item' => 'Добавить нового питомца', |
||||
'edit_item' => 'Редактировать питомца', |
||||
'new_item' => 'Новый питомец', |
||||
'view_item' => 'Посмотреть питомца', |
||||
'search_items' => 'Найти питомца', |
||||
'not_found' => 'Питомцев не найдено', |
||||
'not_found_in_trash' => 'В корзине книг не найдено', |
||||
'parent_item_colon' => '', |
||||
'menu_name' => 'Питомцы' |
||||
|
||||
), |
||||
'public' => false, |
||||
'show_ui' => true, |
||||
'supports' => array('title','editor') |
||||
) ); |
||||
} |
||||
|
||||
function get_pet_card($item){ |
||||
?> |
||||
<?php |
||||
|
||||
switch (get_field('weight')){ |
||||
case ('below_1_5'): |
||||
$w = esc_html__('from 0,5 kg to 1,5 kg', 'woodmart' ); |
||||
break; |
||||
case ('1_5-3'): |
||||
$w = esc_html__('from 1.5 to 3 kg', 'woodmart' ); |
||||
break; |
||||
case ('3-5'): |
||||
$w = esc_html__('from 3 to 5 kg', 'woodmart' ); |
||||
break; |
||||
case ('5-8'): |
||||
$w = esc_html__('from 5 to 8 kg', 'woodmart' ); |
||||
break; |
||||
case ('8-11'): |
||||
$w = esc_html__('from 8 to 11 kg', 'woodmart' ); |
||||
break; |
||||
case ('11-15'): |
||||
$w = esc_html__('from 11 to 15 kg', 'woodmart' ); |
||||
break; |
||||
case ('15-20'): |
||||
$w = esc_html__('from 15 to 20 kg', 'woodmart' ); |
||||
break; |
||||
case ('20-25'): |
||||
$w = esc_html__('from 20 to 25 kg', 'woodmart' ); |
||||
break; |
||||
|
||||
|
||||
case ('25-35'): |
||||
$w = esc_html__('from 25 to 35 kg', 'woodmart' ); |
||||
break; |
||||
|
||||
|
||||
case ('more_35'): |
||||
$w = esc_html__('More than 35 kg', 'woodmart' ); |
||||
break; |
||||
|
||||
} |
||||
switch (get_field('old')){ |
||||
case ('normal'): |
||||
$old = esc_html__('Adult (from 1 year to 7 years)', 'woodmart' ); |
||||
break; |
||||
case ('old'): |
||||
$old = esc_html__('Elderly (from 7 to 12 years)', 'woodmart' ); |
||||
break; |
||||
case ('very_old'): |
||||
$old = esc_html__('Aging (12 years and older)', 'woodmart' ); |
||||
break; |
||||
case ('baby'): |
||||
$old = esc_html__('Baby (from 0 to 1 year)' ); |
||||
break; |
||||
} |
||||
|
||||
switch (get_field('activity')){ |
||||
case ('low'): |
||||
$act = esc_html__('Low', 'woodmart' ); |
||||
break; |
||||
case ('moderate'): |
||||
$act = esc_html__('Moderate', 'woodmart' ); |
||||
break; |
||||
case ('high'): |
||||
$act = esc_html__('High', 'woodmart' ); |
||||
break; |
||||
|
||||
} |
||||
?> |
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__pet"> |
||||
<div class="cabinet-card-pet__icon"> |
||||
<div class="cabinet-card-pet-icon__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/pet/mini-<?php echo get_field('type', $item) ?>.png" alt="">
|
||||
</div> |
||||
</div> |
||||
|
||||
<p class="cabinet-card-pet__name"><?php echo get_the_title($item) ?></p>
|
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Breed', 'woodmart' ) ?>:</p>
|
||||
<p class="cabinet-card__text"><?php echo get_field('breed', $item) ?></p>
|
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Weight', 'woodmart' ) ?>:</p>
|
||||
<p class="cabinet-card__text"><?php echo $w; ?></p>
|
||||
</div> |
||||
<?php if ($old): ?> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Age', 'woodmart' ) ?>:</p>
|
||||
<p class="cabinet-card__text"><?php echo $old; ?></p>
|
||||
</div> |
||||
|
||||
<?php |
||||
else: |
||||
?> |
||||
<?php |
||||
$zero = ''; |
||||
if (intval(get_field('month', $item)) < 10){ |
||||
$zero = '0'; |
||||
} |
||||
?> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Birhtday', 'woodmart' ) ?>:</p>
|
||||
<p class="cabinet-card__text"><?php echo get_field('day', $item) . '.' . $zero . get_field('month', $item) . '.' . get_field('year', $item); ?></p>
|
||||
</div> |
||||
<?php |
||||
endif; |
||||
?> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Activity', 'woodmart' ) ?>:</p>
|
||||
<p class="cabinet-card__text"><?php echo $act; ?></p>
|
||||
</div> |
||||
<?php |
||||
if (get_field('type', $item) == 'cat' && get_field('sterilized', $item)): |
||||
?> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"><?php echo esc_html__('Sterilized', 'woodmart' ) ?></p>
|
||||
|
||||
</div> |
||||
<?php |
||||
endif; |
||||
?> |
||||
<div class="cabinet-card__element"> |
||||
<button class="cabinet-card__button" data-edit="<?php echo get_the_ID($item); ?>">
|
||||
<?php echo esc_html__('Edit', 'woodmart' ) ?> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<?php |
||||
} |
||||
|
@ -0,0 +1,839 @@ |
||||
{% extends 'layout.twig' %} |
||||
|
||||
{% block content %} |
||||
{% set bodyClass = 'bg-white' %} |
||||
|
||||
<main class="wrapper"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-mobile"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title"> |
||||
<?php echo esc_html__( 'Feed subscription', '_pll_e' ) ?> |
||||
</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text"><?php echo esc_html__( 'Weekly food delivery for your pet', '_pll_e' ) ?></p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn"> |
||||
<?php echo esc_html__( 'Get details', '_pll_e' ) ?> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="cabinet__control"> |
||||
<button class="cabinet-control__button active start" data-cabinet="orders"> <?php echo esc_html__( 'Orders', '_pll_e' ) ?></button> |
||||
<button class="cabinet-control__button" data-cabinet="profile"> <?php echo esc_html__( 'Profile', '_pll_e' ) ?></button> |
||||
</div> |
||||
<div class="cabinet"> |
||||
<div class="cabinet__profile cabinet-content"> |
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__element"> |
||||
<?php |
||||
$first_name = $current_user->user_firstname; |
||||
$last_name = $current_user->user_lastname;?> |
||||
<p class="cabinet-card__text <?php if (!$first_name && !$last_name): ?>cabinet-card__text--grey<?php endif; ?>"> |
||||
<?php |
||||
$phone = get_user_meta( $current_user->ID, 'billing_phone', true ); |
||||
|
||||
if($first_name || $last_name): |
||||
echo $first_name . ' ' . $last_name; |
||||
else: |
||||
?> |
||||
|
||||
<?php echo esc_html__( 'Name is not set', '_pll_e' ) ?> |
||||
<?php endif; ?> |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"> <?php echo esc_html__( 'Phone', '_pll_e' ) ?>:</p> |
||||
<p class="cabinet-card__text <?php if (!$phone): ?>cabinet-card__text--grey<?php endif; ?>"> |
||||
<?php if ($phone): |
||||
echo $phone; |
||||
else: |
||||
?> |
||||
<?php echo esc_html__( 'Not filled', '_pll_e' ) ?> |
||||
<?php endif ?> |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"> <?php echo esc_html__( 'Email', '_pll_e' ) ?>:</p> |
||||
<?php if($current_user->user_email): ?> |
||||
<p class="cabinet-card__text"><?php echo $current_user->user_email ?></p> |
||||
<?php |
||||
if (get_field('activated', 'user_' . get_current_user_id())): |
||||
?> |
||||
<p class="cabinet-card__status cabinet-card__status--chek"> <?php echo esc_html__( 'Email is verified', '_pll_e' ) ?></p> |
||||
<?php |
||||
else: |
||||
?> |
||||
<p class="cabinet-card__status cabinet-card__status--cancelled"> <?php echo esc_html__( 'Email is not verified', '_pll_e' ) ?></p> |
||||
<form class="email_approve_form"> |
||||
<input type="hidden" name="action" value="email_activate"> |
||||
<button type="submit" class="cabinet-card__confirm"> |
||||
<?php echo esc_html__( 'Verify', '_pll_e' ) ?> |
||||
</button> |
||||
</form> |
||||
<?php |
||||
if (get_field('uuid', 'user_' . get_current_user_id())): |
||||
?> |
||||
<p class="cabinet-card__status"> <?php echo esc_html__( 'Email width verification link is sent to your email.', '_pll_e' ) ?></p> |
||||
<?php |
||||
endif; |
||||
?> |
||||
<?php |
||||
endif; |
||||
?> |
||||
<?php else: ?> |
||||
<div class="cabinet-card__label"> |
||||
<form class="email_link_form"> |
||||
<input type="hidden" name="action" value="email_link"> |
||||
<div class="cabinet-card_linked-email"> |
||||
<input class="form__input" type="text" name="email" placeholder="example@example.com" required> |
||||
</div> |
||||
<button class="cabinet-card__confirm" type="submit"><?php echo pll__('Link email', '_pll_e'); ?></button> |
||||
</form> |
||||
</div> |
||||
<?php endif; ?> |
||||
</div> |
||||
|
||||
<?php |
||||
$tg_account = get_user_meta( $current_user->ID, ' Traveling', true ); |
||||
?> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label"> <?php echo pll__( 'Linked accounts') ?>:</p> |
||||
<p class="cabinet-card__text cabinet-accounts"> |
||||
<?php if ($tg_account): ?> |
||||
<svg width="40px" height="40px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg> |
||||
<?php else: ?> |
||||
<script async src="https://telegram.org/js/telegram-widget.js?2" data-telegram-login="<?= BOT_USERNAME; ?>" data-size="large" data-onauth="linkTelegram(user)"></script> |
||||
<?php endif ?> |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<div class="cabinet-card__block-buttons"> |
||||
<button class="cabinet-card__button user-edit-open"> |
||||
<?php echo esc_html__( 'Edit', '_pll_e' ) ?> |
||||
</button> |
||||
|
||||
<a href="<?php echo wp_logout_url(home_url()) ?>" class="cabinet-card__button"> |
||||
<?php echo esc_html__( 'Logout', '_pll_e' ) ?> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
// Получаем текущего пользователя |
||||
$current_user_id = get_current_user_id(); |
||||
|
||||
// Проверяем, что пользователь авторизован |
||||
if ($current_user_id) { |
||||
// Параметры для WP_Query |
||||
$args = array( |
||||
'post_type' => 'pets', // Тип постов |
||||
'meta_query' => array( |
||||
array( |
||||
'key' => 'user', // Имя метаполя |
||||
'value' => $current_user_id, // Значение метаполя (ID текущего пользователя) |
||||
'compare' => '=' // Условие сравнения |
||||
) |
||||
) |
||||
); |
||||
|
||||
// Создаем новый объект WP_Query |
||||
$query = new \WP_Query($args); |
||||
|
||||
if ($query->have_posts()) { |
||||
// Начинаем цикл по постам |
||||
while ($query->have_posts()) { |
||||
$query->the_post(); |
||||
get_pet_card($post); |
||||
} |
||||
// Сбрасываем данные постов |
||||
wp_reset_postdata(); |
||||
} |
||||
} |
||||
?> |
||||
|
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<button class="cabinet-card__block-add-pets form-open" data-form="form-pet"> |
||||
<div class="cabinet-card-add-pets__circle"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/plus-grey.svg" alt=""> |
||||
</div> |
||||
|
||||
<p class="cabinet-card-add-pets__text"> |
||||
<?php echo esc_html__( 'Add a pet', '_pll_e' ) ?> |
||||
</p> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="cabinet__orders cabinet-content active hide"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title"> |
||||
<?php echo esc_html__( 'Feed subscription', '_pll_e' ) ?> |
||||
</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text"> <?php echo esc_html__( 'Weekly food delivery for your pet', '_pll_e' ) ?></p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn"> |
||||
<?php echo esc_html__( 'Get details', '_pll_e' ) ?> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php |
||||
$customer_orders = wc_get_orders( array( |
||||
'customer_id' => $current_user->ID, |
||||
) ); |
||||
|
||||
if ($customer_orders): |
||||
foreach($customer_orders as $order): |
||||
$meta_data = get_post_meta($order->get_id(), 'order_data', true); |
||||
$shipping_address = $order->get_address( 'shipping' ); |
||||
?> |
||||
<div class="cabinet-card cabinet-card--grey"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__order"> |
||||
<div class="cabinet-card-order__header"> |
||||
<div class="cabinet-card-order__main"> |
||||
<p class="cabinet-card-order-main__date"><?php echo esc_html__( 'Order from', '_pll_e' ) ?> <?php echo $order->get_date_created()->date('Y.m.d') ?></p> |
||||
<p class="cabinet-card-order-main__number"><?php echo $order->get_id() ?></p> |
||||
</div> |
||||
<div class="cabinet-card-order__payment"> |
||||
<p class="cabinet-card-order-payment__title"><?php echo esc_html__( 'Summary', '_pll_e' ) ?>:</p> |
||||
<p class="cabinet-card-order-payment__price"><?php echo $order->get_total() ?></p> |
||||
</div> |
||||
</div> |
||||
<div class="cabinet-card-order__bottom"> |
||||
<div class="cabinet-card-order__content"> |
||||
<?php |
||||
if ($meta_data){ |
||||
$order_track = $meta_data['order_number']; |
||||
} |
||||
else{ |
||||
$order_track = ''; |
||||
} |
||||
?> |
||||
<div class="cabinet-card-order__block-detail"> |
||||
<div class="cabinet-card-order__detail"> |
||||
<div class="cabinet-card-order-detail__address"> |
||||
<p class="cabinet-card-order-detail-address__title"><?php echo esc_html__( 'Delivery address', '_pll_e' ) ?> </p> |
||||
<p class="cabinet-card-order-detail-address__text"> |
||||
<?php |
||||
if (isset($meta_data['office_code'])): |
||||
echo esc_html__( 'CDEK shipping point', '_pll_e' ); |
||||
echo '<br>'; |
||||
echo json_decode($api->getOffices(['code' => $meta_data['office_code']])['body'])[0]->name; |
||||
?> |
||||
<?php |
||||
else: |
||||
echo $shipping_address['city'] . ' ' . $shipping_address['address_1']; |
||||
?> |
||||
<?php |
||||
endif; |
||||
?> |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card-order-detail__main"> |
||||
<div class="cabinet-card-order-detail-main__products"> |
||||
<?php |
||||
foreach ($order->get_items() as $item_id => $item) : |
||||
$product_name = $item->get_name(); |
||||
$product_quantity = $item->get_quantity(); |
||||
$product_total = $item->get_total(); |
||||
$product = $item->get_product(); |
||||
|
||||
if ($product){ |
||||
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $product->get_id() ), 'thumbnail' ); |
||||
} |
||||
else{ |
||||
$thumbnail = ''; |
||||
} |
||||
?> |
||||
<div class="cabinet-card-order-detail-main__product"> |
||||
<img src="<?php echo $thumbnail[0]; ?>" alt="" class="cabinet-card-order-detail-main-product__img"> |
||||
|
||||
<div class="cabinet-card-order-detail-main-product__content"> |
||||
<div class="cabinet-card-order-detail-main-product__description"> |
||||
<p class="cabinet-card-order-detail-main-product-description__what"><?php echo $product_name ?></p> |
||||
<!-- <p class="cabinet-card-order-detail-main-product-description__with-what">Индейка, 2 <?php echo esc_html__('kg', '_pll_e' ); ?></p> --> |
||||
</div> |
||||
|
||||
<p class="cabinet-card-order-detail-main-product__count"><?php echo $product_quantity ?></p> |
||||
|
||||
<p class="cabinet-card-order-detail-main-product__price"><?php echo $product_total ?></p> |
||||
</div> |
||||
</div> |
||||
<?php endforeach; ?> |
||||
</div> |
||||
|
||||
<div class="cabinet-card-order-detail-main__links"> |
||||
<?php |
||||
if($order_track): |
||||
?> |
||||
<a href="https://www.cdek.ru/ru/tracking/?order_id=<?php echo $order_track ?>" target="_blank" class="cabinet-card__button cabinet-card-order-detail-main__link"> |
||||
<?php echo esc_html__( 'Track order', '_pll_e' ) ?> |
||||
</a> |
||||
<?php endif; ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<button class="cabinet-card-order__open-detail"><?php echo esc_html__( 'Order details', '_pll_e' ) ?></button> |
||||
</div> |
||||
|
||||
<div class="cabinet-card-order__detail-short"> |
||||
<?php |
||||
foreach ($order->get_items() as $item_id => $item) : |
||||
$product = $item->get_product(); |
||||
if ($product){ |
||||
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $product->get_id() ), 'thumbnail' ); |
||||
} |
||||
else{ |
||||
$thumbnail = ''; |
||||
} |
||||
?> |
||||
<?php if ($thumbnail[0]): ?> |
||||
<a href="<?php echo get_the_permalink($product->get_id()) ?>"><img src="<?= $thumbnail[0] ?>" alt="" class="cabinet-card-order-detail-short__item"></a> |
||||
<?php endif; ?> |
||||
<?php endforeach; ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<?php |
||||
endforeach; |
||||
else: |
||||
?> |
||||
<div class="cabinet-card__no-orders"> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<p class="cabinet-card-no-orders__title"><?php echo esc_html__( 'No orders yet', '_pll_e' ) ?></p> |
||||
</div> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<a href="/shop/" class="to-know button--100-perc to-know--background-none"> |
||||
<p><?php echo esc_html__( 'Catalog', '_pll_e' ) ?></p> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<?php |
||||
endif; |
||||
?> |
||||
</div> |
||||
</div> |
||||
</main> |
||||
|
||||
<?php |
||||
$args = array( |
||||
'post_type' => 'pets', // Тип постов |
||||
'meta_query' => array( |
||||
array( |
||||
'key' => 'user', // Имя метаполя |
||||
'value' => $current_user_id, // Значение метаполя (ID текущего пользователя) |
||||
'compare' => '=' // Условие сравнения |
||||
) |
||||
) |
||||
); |
||||
|
||||
// Создаем новый объект WP_Query |
||||
$query = new \WP_Query($args); |
||||
|
||||
if ($query->have_posts()) { |
||||
// Начинаем цикл по постам |
||||
while ($query->have_posts()) { |
||||
$query->the_post(); |
||||
|
||||
switch (get_field('weight')){ |
||||
case ('below_1_5'): |
||||
$w = esc_html__('from 0,5 kg to 1,5 kg', '_pll_e' ); |
||||
break; |
||||
case ('1_5-3'): |
||||
$w = esc_html__('from 1.5 to 3 kg', '_pll_e' ); |
||||
break; |
||||
case ('3-5'): |
||||
$w = esc_html__('from 3 to 5 kg', '_pll_e' ); |
||||
break; |
||||
case ('5-8'): |
||||
$w = esc_html__('from 5 to 8 kg', '_pll_e' ); |
||||
break; |
||||
case ('8-11'): |
||||
$w = esc_html__('from 8 to 11 kg', '_pll_e' ); |
||||
break; |
||||
case ('11-15'): |
||||
$w = esc_html__('from 11 to 15 kg', '_pll_e' ); |
||||
break; |
||||
case ('15-20'): |
||||
$w = esc_html__('from 15 to 20 kg', '_pll_e' ); |
||||
break; |
||||
case ('20-25'): |
||||
$w = esc_html__('from 20 to 25 kg', '_pll_e' ); |
||||
break; |
||||
case ('25-35'): |
||||
$w = esc_html__('from 25 to 35 kg', '_pll_e' ); |
||||
break; |
||||
case ('more_35'): |
||||
$w = esc_html__('More than 35 kg', '_pll_e' ); |
||||
break; |
||||
} |
||||
switch (get_field('old')){ |
||||
case ('normal'): |
||||
$old = __('Adult (from 1 year to 7 years)', '_pll_e' ); |
||||
break; |
||||
case ('old'): |
||||
$old = __('Elderly (from 7 to 12 years)', '_pll_e' ); |
||||
break; |
||||
case ('very_old'): |
||||
$old = __('Aging (12 years and older)', '_pll_e' ); |
||||
break; |
||||
case ('baby'): |
||||
$old = __('Baby (from 0 to 1 year)', '_pll_e' ); |
||||
break; |
||||
} |
||||
switch (get_field('activity')){ |
||||
case ('low'): |
||||
$act = esc_html__('Low', '_pll_e' ); |
||||
break; |
||||
case ('moderate'): |
||||
$act = esc_html__('Moderate', '_pll_e' ); |
||||
break; |
||||
case ('high'): |
||||
$act = esc_html__('High', '_pll_e' ); |
||||
break; |
||||
} |
||||
?> |
||||
<?php |
||||
$months = array( |
||||
esc_html__('january', '_pll_e' ), |
||||
esc_html__('february', '_pll_e' ), |
||||
esc_html__('march', '_pll_e' ), |
||||
esc_html__('april', '_pll_e' ), |
||||
esc_html__('may', '_pll_e' ), |
||||
esc_html__('june', '_pll_e' ), |
||||
esc_html__('july', '_pll_e' ), |
||||
esc_html__('august', '_pll_e' ), |
||||
esc_html__('september', '_pll_e' ), |
||||
esc_html__('october', '_pll_e' ), |
||||
esc_html__('november', '_pll_e' ), |
||||
esc_html__('december', '_pll_e' ), |
||||
); |
||||
?> |
||||
|
||||
<div class="modalProfile" id="pet_edit_<?php echo get_the_ID($post); ?>"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form form__full-mobile modal-form--white modal-form--height-100-phone form-pet active"> |
||||
<button class="modal-form__close"></button> |
||||
<p class="modal-form__title"><?php echo esc_html__('Edit pet', '_pll_e' ); ?> <?php echo get_the_title() ?></p> |
||||
|
||||
<form class="modal-form__content edit-pet-form" method="post" action=""> |
||||
<input type="hidden" name="action" value="edit_pet"> |
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name"><?php echo esc_html__('Pet type', '_pll_e' ); ?></label> |
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button <?php if (get_field('type', $post) == 'cat'): ?> active <?php endif; ?>"> |
||||
<?php echo esc_html__('Dog', '_pll_e' ); ?> |
||||
<input type="radio" value="cat" <?php if (get_field('type', $post) == 'cat'): ?> checked <?php endif; ?> name="pet" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button <?php if (get_field('type', $post) == 'dog'): ?> active <?php endif; ?>"> |
||||
<?php echo esc_html__('Cat', '_pll_e' ); ?> |
||||
<input type="radio" value="dog" <?php if (get_field('type', $post) == 'dog'): ?> checked <?php endif; ?> name="pet" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line sterilized" <?php if (get_field('type', $post) == 'dog'): ?> style="display: none;" <?php endif; ?>> |
||||
<label for="" class="label-name"><?php echo esc_html__('Sterilized', '_pll_e' ); ?></label> |
||||
|
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button <?php if (get_field('sterilized', $post)): ?> active<?php endif; ?>"> |
||||
<?php echo esc_html__('Yes', '_pll_e' ); ?> |
||||
<input type="radio" value="1" <?php if (get_field('sterilized', $post)): ?> checked <?php endif; ?> name="sterilized" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button <?php if (!get_field('sterilized', $post)): ?> active<?php endif; ?>"> |
||||
<?php echo esc_html__('No', '_pll_e' ); ?> |
||||
<input type="radio" value="0" <?php if (!get_field('sterilized', $post)): ?> checked <?php endif; ?> name="sterilized" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name"><?php echo esc_html__('Breed', '_pll_e' ); ?></label> |
||||
<input id="firstname" class="form__input" type="text" value="<?php echo get_field('breed', $post) ?>" name="breed" |
||||
placeholder="Порода вашего питомца" required=""> |
||||
<!-- <span class="form-input__error form-input__error--absolute">Порода введено неверно</span> --> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name"><?php echo esc_html__('Gender of your pet', '_pll_e' ); ?></label> |
||||
|
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button <?php if (get_field('sex', $post) == 'male'): ?> active<?php endif; ?>"> |
||||
<?php echo esc_html__('Boy', '_pll_e' ); ?> |
||||
<input type="radio" value="male" <?php if (get_field('sex', $post) == 'male'): ?> checked<?php endif; ?> name="sex" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button <?php if (get_field('sex', $post) != 'male'): ?> active<?php endif; ?>"> |
||||
<?php echo esc_html__('Girl', '_pll_e' ); ?> |
||||
<input type="radio" value="female" <?php if (get_field('sex', $post) != 'male'): ?> checked<?php endif; ?> name="sex" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line modal-form-content__line--two"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label class="label-name"><?php echo esc_html__('Type of activity', '_pll_e' ); ?></label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input"><?php echo $act ?></div> |
||||
<div class="form-input-list__block-content" style="height: 0px;"> |
||||
<div class="form-input-list__content"> |
||||
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'low'): ?> active<?php endif; ?>"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('Low', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="activity" <?php if (get_field('activity', $post) == 'low'): ?> checked<?php endif; ?> value="low" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'moderate'): ?> active<?php endif; ?>"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('Moderate', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="activity" <?php if (get_field('activity', $post) == 'moderate'): ?> checked<?php endif; ?> value="moderate" class="v-hidden" |
||||
id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item <?php if (get_field('activity', $post) == 'high'): ?> active<?php endif; ?>"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('High', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="activity" value="high" <?php if (get_field('activity', $post) == 'high'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name"><?php echo esc_html__('Weight', '_pll_e' ); ?></label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input"><?php echo $w ?></div> |
||||
<div class="form-input-list__block-content" style="height: 0px;"> |
||||
<div class="form-input-list__content"> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">1-1.5 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == 'below_1_5'): ?> checked<?php endif; ?> value="below_1_5" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">1.5-3 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '1_5-3'): ?> checked<?php endif; ?> value="1_5-3" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">3-5 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '3-5'): ?> checked<?php endif; ?> value="3-5" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">5-8 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '5-8'): ?> checked<?php endif; ?> value="5-8" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">8-11 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '8-11'): ?> checked<?php endif; ?> value="8-11" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">11-15 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '11-15'): ?> checked<?php endif; ?> value="11-15" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">15-20 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '15-20'): ?> checked<?php endif; ?> value="15-20" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">20-25 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '20-25'): ?> checked<?php endif; ?> value="20-25" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">25-35 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == '25-35'): ?> checked<?php endif; ?> value="25-35" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('More than', '_pll_e' ); ?> 35 <?php echo esc_html__('kg', '_pll_e' ); ?></p> |
||||
<input type="radio" required name="weight" <?php if (get_field('weight', $post) == 'more_35'): ?> checked<?php endif; ?> value="more_35" class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="rm"> |
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name"><?php echo esc_html__("Pet's age", '_pll_e' ); ?></label> |
||||
<div class="form-input__tabs form-input__remote-control" data-content="modal__age"> |
||||
<label class="form-input-tabs__button active" data-rm="0"> |
||||
<?php echo esc_html__('Exemplary', '_pll_e' ); ?> |
||||
<input type="radio" checked value="ex" name="old_type" required |
||||
class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button" data-rm="1"> |
||||
<?php echo esc_html__('Exact', '_pll_e' ); ?> |
||||
<input type="radio" value="acc" name="old_type" required |
||||
class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal__age"> |
||||
<div class="form-input__radio remote-control__item active" data-rmcont="0"> |
||||
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'baby'): ?> active<?php endif; ?>" > |
||||
<input type="radio" name="old" value="baby" <?php if (get_field('old', $post) == 'baby'): ?> checked<?php endif; ?> class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
|
||||
<p class="form-input-radio__title"> <?php echo __('Baby <span>(from 0 to 1 year)</span>', '_pll_e' ); ?></p> |
||||
</label> |
||||
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'normal'): ?> active<?php endif; ?>"> |
||||
<input type="radio" name="old" value="normal" <?php if (get_field('old', $post) == 'normal'): ?> checked<?php endif; ?> class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
|
||||
<p class="form-input-radio__title"> <?php echo __('Adult <span>(from 1 year to 7 years)</span>', '_pll_e' ); ?></p> |
||||
</label> |
||||
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'old'): ?> active<?php endif; ?>"> |
||||
<input type="radio" name="old" value="old" <?php if (get_field('old', $post) == 'old'): ?> checked<?php endif; ?> class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
|
||||
<p class="form-input-radio__title"> <?php echo __('Elderly <span>(from 7 to 12 years)</span>', '_pll_e' ); ?></p> |
||||
</label> |
||||
<label class="form-input-radio__item <?php if (get_field('old', $post) == 'very_old'): ?> active<?php endif; ?>"> |
||||
<input type="radio" name="old" <?php if (get_field('old', $post) == 'very_old'): ?> checked<?php endif; ?> value="very_old" class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
|
||||
<p class="form-input-radio__title"> <?php echo __('Aging <span>(12 years and older)</span>', '_pll_e' ); ?></p> |
||||
</label> |
||||
</div> |
||||
<div data-rmcont="1" |
||||
class="modal-form-content__line remote-control__item modal-form-content__line--three modal-form-content__line--margin-top-16 "> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name"><?php echo esc_html__('Day', '_pll_e' ); ?></label> |
||||
<input id="firstname" class="form__input form__input--center" maxlength="2" type="text" |
||||
name="day" placeholder="<?php echo esc_html__('DD', '_pll_e' ); ?>" value="<?php echo get_field('day', $post) ?>"> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name"><?php echo esc_html__('Month', '_pll_e' ); ?></label> |
||||
<div class="form-input__list"> |
||||
<?php |
||||
if(get_field('month', $post)): |
||||
?> |
||||
<div class="form-input-list__input"><?php echo $months[intval(get_field('month', $post)) - 1 ]; ?></div> |
||||
<?php |
||||
else: |
||||
?> |
||||
<div class="form-input-list__input"><?php echo esc_html__('Month', '_pll_e' ); ?></div> |
||||
<?php |
||||
endif; |
||||
?> |
||||
<div class="form-input-list__block-content"> |
||||
<div class="form-input-list__content"> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('January', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="1" <?php if (get_field('month', $post) == '1'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('February', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="2" <?php if (get_field('month', $post) == '2'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('March', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="3" <?php if (get_field('month', $post) == '3'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('April', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="4" <?php if (get_field('month', $post) == '4'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('May', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="5" <?php if (get_field('month', $post) == '5'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('June', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="6" <?php if (get_field('month', $post) == '6'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('July', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="7" <?php if (get_field('month', $post) == '7'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('August', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="8" <?php if (get_field('month', $post) == '8'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('September', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="9" <?php if (get_field('month', $post) == '9'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" |
||||
alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text"><?php echo esc_html__('October', '_pll_e' ); ?></p> |
||||
<input type="radio" name="month" value="10" <?php if (get_field('month', $post) == '10'): ?> checked<?php endif; ?> class="v-hidden" id=""> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="<?= get_template_directory_uri();?>/gp-include/assets/lk/img/svg/main/arrow Progressive Web App (PWA) support |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
{% endblock %} |
@ -0,0 +1,537 @@ |
||||
|
||||
|
||||
|
||||
<main class="wrapper"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-mobile"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title"> |
||||
{{ __('Feed subscription', 'woodmart')|esc_html }} |
||||
</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text">{{ __('Weekly food delivery for your pet', 'woodmart')|esc_html }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn"> |
||||
{{ __('Get details', 'woodmart')|esc_html }} |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="cabinet__control"> |
||||
<button class="cabinet-control__button active start" data-cabinet="orders">{{ __('Orders', 'woodmart')|esc_html }}</button> |
||||
<button class="cabinet-control__button" data-cabinet="profile">{{ __('Profile', 'woodmart')|esc_html }}</button> |
||||
</div> |
||||
|
||||
<div class="cabinet"> |
||||
<div class="cabinet__profile cabinet-content"> |
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text {% if not first_name and not last_name %}cabinet-card__text--grey{% endif %}"> |
||||
{% if first_name or last_name %} |
||||
{{ first_name }} {{ last_name }} |
||||
{% else %} |
||||
{{ __('Name is not set', 'woodmart')|esc_html }} |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Phone', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card__text {% if not phone %}cabinet-card__text--grey{% endif %}"> |
||||
{% if phone %} |
||||
{{ phone }} |
||||
{% else %} |
||||
{{ __('Not filled', 'woodmart')|esc_html }} |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Email', 'woodmart')|esc_html }}:</p> |
||||
{% if email %} |
||||
<p class="cabinet-card__text">{{ email }}</p> |
||||
{% if activated %} |
||||
<p class="cabinet-card__status cabinet-card__status--chek">{{ __('Email is verified', 'woodmart')|esc_html }}</p> |
||||
{% else %} |
||||
<p class="cabinet-card__status cabinet-card__status--cancelled">{{ __('Email is not verified', 'woodmart')|esc_html }}</p> |
||||
<form class="email_approve_form"> |
||||
<input type="hidden" name="action" value="email_activate"> |
||||
<button type="submit" class="cabinet-card__confirm">{{ __('Verify', 'woodmart')|esc_html }}</button> |
||||
</form> |
||||
{% if uuid %} |
||||
<p class="cabinet-card__status">{{ __('Email with verification link is sent to your email.', 'woodmart')|esc_html }}</p> |
||||
{% endif %} |
||||
{% endif %} |
||||
{% else %} |
||||
<div class="cabinet-card__label"> |
||||
<form class="email_link_form"> |
||||
<input type="hidden" name="action" value="email_link"> |
||||
<div class="cabinet-card_linked-email"> |
||||
<input class="form__input" type="text" name="email" placeholder="example@example.com" required> |
||||
</div> |
||||
<button class="cabinet-card__confirm" type="submit">{{ __('Link email', 'woodmart')|esc_html }}</button> |
||||
</form> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Linked accounts', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card__text cabinet-accounts"> |
||||
{% if tg_account %} |
||||
<svg width="40px" height="40px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"> |
||||
<g> |
||||
<path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path> |
||||
<path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path> |
||||
<path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path> |
||||
<path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path> |
||||
</g> |
||||
</svg> |
||||
{% else %} |
||||
<script async src="https://telegram.org/js/telegram-widget.js?2" data-telegram-login="{{ bot_username }}" data-size="large" data-onauth="linkTelegram(user)"></script> |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<div class="cabinet-card__block-buttons"> |
||||
<button class="cabinet-card__button user-edit-open">{{ __('Edit', 'woodmart')|esc_html }}</button> |
||||
<a href="{{ fn('wp_logout_url', fn('home_url')) }}" class="cabinet-card__button">{{ __('Logout', 'woodmart')|esc_html }}</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
{% if pets %} |
||||
{% for pet in pets %} |
||||
{% include 'pet-card.twig' with { 'post': pet } %} |
||||
{% endfor %} |
||||
{% endif %} |
||||
|
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<button class="cabinet-card__block-add-pets form-open" data-form="form-pet"> |
||||
<div class="cabinet-card-add-pets__circle"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/plus-grey.svg" alt=""> |
||||
</div> |
||||
<p class="cabinet-card-add-pets__text">{{ __('Add a pet', 'woodmart')|esc_html }}</p> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="cabinet__orders cabinet-content active hide"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title">{{ __('Feed subscription', 'woodmart')|esc_html }}</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text">{{ __('Weekly food delivery for your pet', 'woodmart')|esc_html }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn">{{ __('Get details', 'woodmart')|esc_html }}</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
{% if customer_orders %} |
||||
{% for order in customer_orders %} |
||||
{% set meta_data = order.meta_data.order_data %} |
||||
{% set shipping_address = order.get_address('shipping') %} |
||||
<div class="cabinet-card cabinet-card--grey"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__order"> |
||||
<div class="cabinet-card-order__header"> |
||||
<div class="cabinet-card-order__main"> |
||||
<p class="cabinet-card-order-main__date">{{ __('Order from', 'woodmart')|esc_html }} {{ order.date_created|date('Y.m.d') }}</p> |
||||
<p class="cabinet-card-order-main__number">{{ order.id }}</p> |
||||
</div> |
||||
<div class="cabinet-card-order__payment"> |
||||
<p class="cabinet-card-order-payment__title">{{ __('Summary', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card-order-payment__price">{{ order.total }}</p> |
||||
</div> |
||||
</div> |
||||
<div class="cabinet-card-order__bottom"> |
||||
<div class="cabinet-card-order__content"> |
||||
{% set order_track = meta_data.order_number|default('') %} |
||||
<div class="cabinet-card-order__block-detail"> |
||||
<div class="cabinet-card-order__detail"> |
||||
<div class="cabinet-card-order-detail__address"> |
||||
<p class="cabinet-card-order-detail-address__title">{{ __('Delivery address', 'woodmart')|esc_html }}</p> |
||||
<p class="cabinet-card-order-detail-address__text"> |
||||
{% if meta_data.office_code %} |
||||
{{ __('CDEK shipping point', 'woodmart')|esc_html }}<br> |
||||
{# Предполагается, что API-запрос обрабатывается в PHP, добавляем в контекст #} |
||||
{{ office_name }} |
||||
{% else %} |
||||
{{ shipping_address.city }} {{ shipping_address.address_1 }} |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
<div class="cabinet-card-order-detail__main"> |
||||
<div class="cabinet-card-order-detail-main__products"> |
||||
{% for item in order.get_items %} |
||||
{% set product = item.get_product %} |
||||
{% set thumbnail = product ? product.thumbnail.src('thumbnail') : '' %} |
||||
<div class="cabinet-card-order-detail-main__product"> |
||||
<img src="{{ thumbnail }}" alt="" class="cabinet-card-order-detail-main-product__img"> |
||||
<div class="cabinet-card-order-detail-main-product__content"> |
||||
<div class="cabinet-card-order-detail-main-product__description"> |
||||
<p class="cabinet-card-order-detail-main-product-description__what">{{ item.name }}</p> |
||||
</div> |
||||
<p class="cabinet-card-order-detail-main-product__count">{{ item.quantity }}</p> |
||||
<p class="cabinet-card-order-detail-main-product__price">{{ item.total }}</p> |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
<div class="cabinet-card-order-detail-main__links"> |
||||
{% if order_track %} |
||||
<a href="https://www.cdek.ru/ru/tracking/?order_id={{ order_track }}" target="_blank" class="cabinet-card__button cabinet-card-order-detail-main__link"> |
||||
{{ __('Track order', 'woodmart')|esc_html }} |
||||
</a> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<button class="cabinet-card-order__open-detail">{{ __('Order details', 'woodmart')|esc_html }}</button> |
||||
</div> |
||||
<div class="cabinet-card-order__detail-short"> |
||||
{% for item in order.get_items %} |
||||
{% set product = item.get_product %} |
||||
{% set thumbnail = product ? product.thumbnail.src('thumbnail') : '' %} |
||||
{% if thumbnail %} |
||||
<a href="{{ product.permalink }}"><img src="{{ thumbnail }}" alt="" class="cabinet-card-order-detail-short__item"></a> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
{% else %} |
||||
<div class="cabinet-card__no-orders"> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<p class="cabinet-card-no-orders__title">{{ __('No orders yet', 'woodmart')|esc_html }}</p> |
||||
</div> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<a href="/shop/" class="to-know button--100-perc to-know--background-none"> |
||||
<p>{{ __('Catalog', 'woodmart')|esc_html }}</p> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</main> |
||||
|
||||
{% if pet %} |
||||
<div class="cabinet-card cabinet-card--green"> |
||||
<div class="cabinet-card__content"> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Weight', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card__text">{{ pet.weight_text }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Age', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card__text">{{ pet.old_text }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ __('Activity', 'woodmart')|esc_html }}:</p> |
||||
<p class="cabinet-card__text">{{ pet.activity_text }}</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="modalProfile" id="pet_edit_{{ pet.ID }}"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form form__full-mobile modal-form--white modal-form--height-100-phone form-pet active"> |
||||
<button class="modal-form__close"></button> |
||||
<p class="modal-form__title">{{ __('Edit pet', 'woodmart')|esc_html }} {{ pet.title }}</p> |
||||
|
||||
<form class="modal-form__content edit-pet-form" method="post" action=""> |
||||
<input type="hidden" name="action" value="edit_pet"> |
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ __('Pet type', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button {% if pet.type == 'cat' %}active{% endif %}"> |
||||
{{ __('Dog', 'woodmart')|esc_html }} |
||||
<input come="true" inputtype="radio" value="cat" {% if pet.type == 'cat' %}checked{% endif %} name="pet" class="form-input-tabs__input" /> |
||||
</label> |
||||
<label class="form-input-tabs__button {% if pet.type == 'dog' %}active{% endif %}"> |
||||
{{ __('Cat', 'woodmart')|esc_html }} |
||||
<input type="radio" value="dog" {% if pet.type == 'dog' %}checked{% endif %} name="pet" class="form-input-tabs__input" /> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line sterilized" {% if pet.type == 'dog' %}style="display: none;"{% endif %}> |
||||
<label class="label-name">{{ __('Sterilized', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button {% if pet.sterilized %}active{% endif %}"> |
||||
{{ __('Yes', 'woodmart')|esc_html }} |
||||
<input type="radio" value="1" {% if pet.sterilized %}checked{% endif %} name="sterilized" class="form-input-tabs__input" /> |
||||
</label> |
||||
<label class="form-input-tabs__button {% if not pet.sterilized %}active{% endif %}"> |
||||
{{ __('No', 'woodmart')|esc_html }} |
||||
<input type="radio" value="0" {% if not pet.sterilized %}checked{% endif %} name="sterilized" class="form-input-tabs__input" /> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ __('Breed', 'woodmart')|esc_html }}</label> |
||||
<input id="firstname" class="form__input" type="text" value="{{ pet.breed }}" name="breed" placeholder="Порода вашего питомца" required> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ __('Gender of your pet', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button {% if pet.sex == 'male' %}active{% endif %}"> |
||||
{{ __('Boy', 'woodmart')|esc_html }} |
||||
<input type="radio" value="male" {% if pet.sex == 'male' %}checked{% endif %} name="sex" class="form-input-tabs__input" /> |
||||
</label> |
||||
<label class="form-input-tabs__button {% if pet.sex != 'male' %}active{% endif %}"> |
||||
{{ __('Girl', 'woodmart')|esc_html }} |
||||
<input type="radio" value="female" {% if pet.sex != 'male' %}checked{% endif %} name="sex" class="form-input-tabs__input" /> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line modal-form-content__line--two"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label class="label-name">{{ __('Type of activity', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ pet.activity_text }}</div> |
||||
<div class="form-input-list__block-content" style="height: 0px;"> |
||||
<div class="form-input-list__content"> |
||||
<label class="form-input-list__item {% if pet.activity == 'low' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">{{ __('Low', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="activity" {% if pet.activity == 'low' %}checked{% endif %} value="low" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.activity == 'moderate' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">{{ __('Moderate', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="activity" {% if pet.activity == 'moderate' %}checked{% endif %} value="moderate" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.activity == 'high' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">{{ __('High', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="activity" {% if pet.activity == 'high' %}checked{% endif %} value="high" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label class="label-name">{{ __('Weight', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ pet.weight_text }}</div> |
||||
<div class="form-input-list__block-content" style="height: 0px;"> |
||||
<div class="form-input-list__content"> |
||||
<label class="form-input-list__item {% if pet.weight == 'below_1_5' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">1-1.5 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == 'below_1_5' %}checked{% endif %} value="below_1_5" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '1_5-3' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">1.5-3 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '1_5-3' %}checked{% endif %} value="1_5-3" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '3-5' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">3-5 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '3-5' %}checked{% endif %} value="3-5" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '5-8' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">5-8 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '5-8' %}checked{% endif %} value="5-8" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '8-11' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">8-11 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '8-11' %}checked{% endif %} value="8-11" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '11-15' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">11-15 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '11-15' %}checked{% endif %} value="11-15" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '15-20' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">15-20 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '15-20' %}checked{% endif %} value="15-20" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '20-25' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">20-25 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '20-25' %}checked{% endif %} value="20-25" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == '25-35' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">25-35 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == '25-35' %}checked{% endif %} value="25-35" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
<label class="form-input-list__item {% if pet.weight == 'more_35' %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">{{ __('More than', 'woodmart')|esc_html }} 35 {{ __('kg', 'woodmart')|esc_html }}</p> |
||||
<input type="radio" required name="weight" {% if pet.weight == 'more_35' %}checked{% endif %} value="more_35" class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ __('Pet\'s age', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__tabs form-input__remote-control" data-content="modal__age"> |
||||
<label class="form-input-tabs__button active" data-rm="0"> |
||||
{{ __('Exemplary', 'woodmart')|esc_html }} |
||||
<input type="radio" checked value="ex" name="old_type" required class="form-input-tabs__input"> |
||||
</label> |
||||
<label class="form-input-tabs__button" data-rm="1"> |
||||
{{ __('Exact', 'woodmart')|esc_html }} |
||||
<input type="radio" value="acc" name="old_type" required class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal__age"> |
||||
<div class="form-input__radio remote-control__item active" data-rmcont="0"> |
||||
<label class="form-input-radio__item {% if pet.old == 'baby' %}active{% endif %}"> |
||||
<input type="radio" name="old" value="baby" {% if pet.old == 'baby' %}checked{% endif %} class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ __('Baby <span>(from 0 to 1 year)</span>', 'woodmart')|raw }}</p> |
||||
</label> |
||||
<label class="form-input-radio__item {% if pet.old == 'normal' %}active{% endif %}"> |
||||
<input type="radio" name="old" value="normal" {% if pet.old == 'normal' %}checked{% endif %} class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ __('Adult <span>(from 1 year to 7 years)</span>', 'woodmart')|raw }}</p> |
||||
</label> |
||||
<label class="form-input-radio__item {% if pet.old == 'old' %}active{% endif %}"> |
||||
<input type="radio" name="old" value="old" {% if pet.old == 'old' %}checked{% endif %} class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ __('Elderly <span>(from 7 to 12 years)</span>', 'woodmart')|raw }}</p> |
||||
</label> |
||||
<label class="form-input-radio__item {% if pet.old == 'veryVvery_old' %}active{% endif %}"> |
||||
<input type="radio" name="old" value="very_old" {% if pet.old == 'very_old' %}checked{% endif %} class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ __('Aging <span>(12 years and older)</span>', 'woodmart')|raw }}</p> |
||||
</label> |
||||
</div> |
||||
<div data-rmcont="1" class="modal-form-content__line remote-control__item modal-form-content__line--three modal-form-content__line--margin-top-16"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ __('Day', 'woodmart')|esc_html }}</label> |
||||
<input id="firstname" class="form__input form__input--center" maxlength="2" type="text" name="day" placeholder="{{ __('DD', 'woodmart')|esc_html }}" value="{{ pet.day }}"> |
||||
</div> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ __('Month', 'woodmart')|esc_html }}</label> |
||||
<div class="form-input__list"> |
||||
{% if pet.month %} |
||||
<div class="form-input-list__input">{{ months[pet.month - 1] }}</div> |
||||
{% else %} |
||||
<div class="form-input-list__input">{{ __('Month', 'woodmart')|esc_html }}</div> |
||||
{% endif %} |
||||
<div class="form-input-list__block-content"> |
||||
<div class="form-input-list__content"> |
||||
{% for month, month_name in months %} |
||||
<label class="form-input-list__item {% if pet.month == loop.index %}active{% endif %}"> |
||||
<p class="form-input-list-item__text">{{ month_name|esc_html }}</p> |
||||
<input type="radio" name="month" value="{{ loop.index }}" {% if pet.month == loop.index %}checked{% endif %} class="v-hidden"> |
||||
<div class="form-input-list-item__box"> |
||||
<div class="form-input-list-item-box__content"> |
||||
<img src="{{ theme.link }}/gp-include/assets/lk/img/svg/main/arrow-selected-white.svg" alt=""> |
||||
</div> |
||||
</div> |
||||
</label> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ __('Year', 'woodmart')|esc_html }}</label> |
||||
<input id="firstname" class="form__input form__input--center" maxlength="4" type="text" name="year" placeholder="{{ __('YYYY', 'woodmart')|esc_html }}" value="{{ pet.year }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<input type="hidden" name="pet_id" value="{{ pet.ID }}"> |
||||
<div class="modal-form__buttons"> |
||||
<button class="button button--gradient button--high button--100-perc" type="submit">{{ __('Save', 'woodmart')|esc_html }}</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
@ -0,0 +1,119 @@ |
||||
<?php |
||||
/** |
||||
* Login Form |
||||
* |
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php. |
||||
* |
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you |
||||
* (the theme developer) will need to copy the new files to your theme to |
||||
* maintain compatibility. We try to do this as little as possible, but it does |
||||
* happen. When this occurs the version of the template file will be bumped and |
||||
* the readme will list any important changes. |
||||
* |
||||
* @see https://woocommerce.com/document/template-structure/ |
||||
* @package WooCommerce\Templates |
||||
* @version 9.7.0 |
||||
*/ |
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) { |
||||
exit; // Exit if accessed directly. |
||||
} |
||||
|
||||
do_action( 'woocommerce_before_customer_login_form' ); ?> |
||||
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?> |
||||
|
||||
<div class="u-columns col2-set" id="customer_login"> |
||||
|
||||
<div class="u-column1 col-1"> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<h2><?php esc_html_e( 'Login', 'woocommerce' ); ?></h2>
|
||||
|
||||
<form class="woocommerce-form woocommerce-form-login login" method="post" novalidate> |
||||
|
||||
<?php do_action( 'woocommerce_login_form_start' ); ?> |
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> |
||||
<label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?> <span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" required aria-required="true" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p> |
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> |
||||
<label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
|
||||
<input class="woocommerce-Input woocommerce-Input--text input-text" type="password" name="password" id="password" autocomplete="current-password" required aria-required="true" /> |
||||
</p> |
||||
|
||||
<?php do_action( 'woocommerce_login_form' ); ?> |
||||
|
||||
<p class="form-row"> |
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme"> |
||||
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'woocommerce' ); ?></span>
|
||||
</label> |
||||
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> |
||||
<button type="submit" class="woocommerce-button button woocommerce-form-login__submit<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>" name="login" value="<?php esc_attr_e( 'Log in', 'woocommerce' ); ?>"><?php esc_html_e( 'Log in', 'woocommerce' ); ?></button>
|
||||
</p> |
||||
<p class="woocommerce-LostPassword lost_password"> |
||||
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a>
|
||||
</p> |
||||
|
||||
<?php do_action( 'woocommerce_login_form_end' ); ?> |
||||
|
||||
</form> |
||||
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?> |
||||
|
||||
</div> |
||||
|
||||
<div class="u-column2 col-2"> |
||||
|
||||
<h2><?php esc_html_e( 'Register', 'woocommerce' ); ?></h2>
|
||||
|
||||
<form method="post" class="woocommerce-form woocommerce-form-register register" <?php do_action( 'woocommerce_register_form_tag' ); ?> >
|
||||
|
||||
<?php do_action( 'woocommerce_register_form_start' ); ?> |
||||
|
||||
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?> |
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> |
||||
<label for="reg_username"><?php esc_html_e( 'Username', 'woocommerce' ); ?> <span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" required aria-required="true" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> |
||||
<label for="reg_email"><?php esc_html_e( 'Email address', 'woocommerce' ); ?> <span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
|
||||
<input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" autocomplete="email" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( wp_unslash( $_POST['email'] ) ) : ''; ?>" required aria-required="true" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p> |
||||
|
||||
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?> |
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> |
||||
<label for="reg_password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" autocomplete="new-password" required aria-required="true" /> |
||||
</p> |
||||
|
||||
<?php else : ?> |
||||
|
||||
<p><?php esc_html_e( 'A link to set a new password will be sent to your email address.', 'woocommerce' ); ?></p>
|
||||
|
||||
<?php endif; ?> |
||||
|
||||
<?php do_action( 'woocommerce_register_form' ); ?> |
||||
|
||||
<p class="woocommerce-form-row form-row"> |
||||
<?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?> |
||||
<button type="submit" class="woocommerce-Button woocommerce-button button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?> woocommerce-form-register__submit" name="register" value="<?php esc_attr_e( 'Register', 'woocommerce' ); ?>"><?php esc_html_e( 'Register', 'woocommerce' ); ?></button>
|
||||
</p> |
||||
|
||||
<?php do_action( 'woocommerce_register_form_end' ); ?> |
||||
|
||||
</form> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
<?php endif; ?> |
||||
|
||||
<?php do_action( 'woocommerce_after_customer_login_form' ); ?> |
@ -0,0 +1,4 @@ |
||||
<?php |
||||
// include_module('profile'); |
||||
// include_component('profile', 'profile'); |
||||
?> |
@ -0,0 +1,93 @@ |
||||
<?php |
||||
/** |
||||
* My Addresses |
||||
* |
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-address.php. |
||||
* |
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you |
||||
* (the theme developer) will need to copy the new files to your theme to |
||||
* maintain compatibility. We try to do this as little as possible, but it does |
||||
* happen. When this occurs the version of the template file will be bumped and |
||||
* the readme will list any important changes. |
||||
* |
||||
* @see https://woocommerce.com/document/template-structure/ |
||||
* @package WooCommerce\Templates |
||||
* @version 9.3.0 |
||||
*/ |
||||
|
||||
defined( 'ABSPATH' ) || exit; |
||||
|
||||
$customer_id = get_current_user_id(); |
||||
|
||||
if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) { |
||||
$get_addresses = apply_filters( |
||||
'woocommerce_my_account_get_addresses', |
||||
array( |
||||
'billing' => __( 'Billing address', 'woocommerce' ), |
||||
'shipping' => __( 'Shipping address', 'woocommerce' ), |
||||
), |
||||
$customer_id |
||||
); |
||||
} else { |
||||
$get_addresses = apply_filters( |
||||
'woocommerce_my_account_get_addresses', |
||||
array( |
||||
'billing' => __( 'Billing address', 'woocommerce' ), |
||||
), |
||||
$customer_id |
||||
); |
||||
} |
||||
|
||||
$oldcol = 1; |
||||
$col = 1; |
||||
?> |
||||
|
||||
<p> |
||||
<?php echo apply_filters( 'woocommerce_my_account_my_address_description', esc_html__( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</p> |
||||
|
||||
<?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?> |
||||
<div class="u-columns woocommerce-Addresses col2-set addresses"> |
||||
<?php endif; ?> |
||||
|
||||
<?php foreach ( $get_addresses as $name => $address_title ) : ?> |
||||
<?php |
||||
$address = wc_get_account_formatted_address( $name ); |
||||
$col = $col * -1; |
||||
$oldcol = $oldcol * -1; |
||||
?> |
||||
|
||||
<div class="u-column<?php echo $col < 0 ? 1 : 2; ?> col-<?php echo $oldcol < 0 ? 1 : 2; ?> woocommerce-Address">
|
||||
<header class="woocommerce-Address-title title"> |
||||
<h2><?php echo esc_html( $address_title ); ?></h2>
|
||||
<a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', $name ) ); ?>" class="edit">
|
||||
<?php |
||||
printf( |
||||
/* translators: %s: Address title */ |
||||
$address ? esc_html__( 'Edit %s', 'woocommerce' ) : esc_html__( 'Add %s', 'woocommerce' ), |
||||
esc_html( $address_title ) |
||||
); |
||||
?> |
||||
</a> |
||||
</header> |
||||
<address> |
||||
<?php |
||||
echo $address ? wp_kses_post( $address ) : esc_html_e( 'You have not set up this type of address yet.', 'woocommerce' ); |
||||
|
||||
/** |
||||
* Used to output content after core address fields. |
||||
* |
||||
* @param string $name Address type. |
||||
* @since 8.7.0 |
||||
*/ |
||||
do_action( 'woocommerce_my_account_after_my_address', $name ); |
||||
?> |
||||
</address> |
||||
</div> |
||||
|
||||
<?php endforeach; ?> |
||||
|
||||
<?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?> |
||||
</div> |
||||
<?php |
||||
endif; |