@ -0,0 +1,200 @@ |
||||
/* Editorial */ |
||||
.editorial { |
||||
padding-bottom: 68px; |
||||
} |
||||
|
||||
.editorial-head { |
||||
position: relative; |
||||
z-index: 1; |
||||
max-width: 841px; |
||||
margin-bottom: 37px; |
||||
} |
||||
|
||||
.editorial-head__title { |
||||
font-size: 82px; |
||||
line-height: 96px; |
||||
font-weight: bold; |
||||
color: var(--main_white); |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.editorial-head__img { |
||||
position: absolute; |
||||
z-index: -1; |
||||
top: -14px; |
||||
right: -20px; |
||||
width: 221px; |
||||
} |
||||
|
||||
.editorial-head__star { |
||||
position: absolute; |
||||
top: 8.26px; |
||||
right: -13.5px; |
||||
transform: translateX(100%); |
||||
width: 87.5px; |
||||
} |
||||
|
||||
.editorial-card__wrap { |
||||
display: grid; |
||||
grid-template-columns: repeat(2, minmax(0, 1fr)); |
||||
gap: 31px 25px; |
||||
position: relative; |
||||
z-index: 1; |
||||
} |
||||
|
||||
.editorial-card { |
||||
border: 2px solid var(--creme-white); |
||||
border-radius: 30px; |
||||
display: flex; |
||||
align-items: stretch; |
||||
overflow: hidden; |
||||
background: var(--linear); |
||||
backdrop-filter: blur(28px); |
||||
} |
||||
|
||||
.editorial-card .main-img { |
||||
min-height: 282px; |
||||
width: 207px; |
||||
border-radius: 29px; |
||||
overflow: hidden; |
||||
flex-shrink: 0; |
||||
} |
||||
|
||||
.editorial-card:hover .main-img img{ |
||||
width: 120%; |
||||
height: 120%; |
||||
} |
||||
|
||||
.editorial-card .main-img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
transition: all .5s; |
||||
} |
||||
|
||||
.editorial-card__content { |
||||
padding: 42px 19px 19px 35px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
align-items: center; |
||||
gap: 7px; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts a { |
||||
background: var(--main_black); |
||||
border-radius: 16px; |
||||
padding: 6px 8px; |
||||
font-size: 16px; |
||||
font-weight: 500; |
||||
line-height: 20px; |
||||
color: var(--background); |
||||
} |
||||
|
||||
.editorial-card__content-title { |
||||
font-size: 28px; |
||||
font-weight: bold; |
||||
line-height: 32px; |
||||
color: var(--grey-black); |
||||
text-transform: uppercase; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-data { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 5px 16px; |
||||
color: var(--interface_hover); |
||||
font-size: 16px; |
||||
font-weight: 500; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
.editorial-card__content-data ul { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 16px; |
||||
} |
||||
|
||||
.editorial-card__content-data li { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 5px; |
||||
} |
||||
|
||||
.editorial-card__content-data .logo img { |
||||
width: 24px; |
||||
height: 24px; |
||||
border-radius: 50%; |
||||
object-fit: cover; |
||||
} |
||||
/* Editorial end */ |
||||
|
||||
@media (max-width: 1200px) { |
||||
.editorial-card__wrap { |
||||
grid-template-columns: repeat(1, minmax(0, 1fr)); |
||||
} |
||||
} |
||||
|
||||
@media (max-width: 992px) { |
||||
.editorial { |
||||
padding-bottom: 36px; |
||||
} |
||||
|
||||
.editorial-head { |
||||
margin-bottom: 36px; |
||||
max-width: 313px; |
||||
} |
||||
|
||||
.editorial-head__title { |
||||
font-size: 32px; |
||||
line-height: 38px; |
||||
} |
||||
|
||||
.editorial-head__img { |
||||
width: 100px; |
||||
top: -14px; |
||||
right: -22.5px; |
||||
} |
||||
|
||||
.editorial-head__star { |
||||
display: none; |
||||
} |
||||
} |
||||
|
||||
@media (max-width: 576px) { |
||||
.editorial-card { |
||||
flex-direction: column; |
||||
border-radius: 30px; |
||||
position: relative; |
||||
} |
||||
|
||||
.editorial-card .main-img { |
||||
width: 100%; |
||||
height: 203px; |
||||
} |
||||
|
||||
.editorial-card__content { |
||||
padding: 17px 13px 24px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts { |
||||
position: absolute; |
||||
top: 13px; |
||||
left: 8px; |
||||
width: calc(100% - 16px); |
||||
} |
||||
|
||||
.editorial-card__content-title { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-data { |
||||
gap: 5px 16px; |
||||
} |
||||
} |
@ -0,0 +1,957 @@ |
||||
'use strict'; |
||||
|
||||
(function ($) { |
||||
const metaLocale = document.querySelector('meta[property="og:locale"]'); |
||||
const localeValue = metaLocale.getAttribute('content'); |
||||
function wc_cart_summary_upd(){ |
||||
let total = 0 |
||||
$('.cart_item').each(function(){ |
||||
total += Number($(this).data('cost')) |
||||
}) |
||||
return total |
||||
} |
||||
$('[data-pname]').on('click', function(){ |
||||
$('#sub_product_name').val($(this).data('pname')) |
||||
}) |
||||
|
||||
$(document).on('submit', '.product-item__form, .detail-block__form', function (e) { |
||||
e.preventDefault(); |
||||
var $form = $(this) |
||||
var product_qty = $form.find('input[name=quantity]').val() || 1 |
||||
var product_id = $form.find('input[name=product_id]').val() |
||||
var variation_id = $form.find('input[name=variation_id]').val() || 0; |
||||
var title = $(this).data('name') |
||||
var data = { |
||||
action: 'woocommerce_ajax_add_to_cart', |
||||
product_id: product_id, |
||||
product_sku: '', |
||||
quantity: product_qty, |
||||
variation_id: variation_id, |
||||
}; |
||||
dataLayer.push({ |
||||
"ecommerce": { |
||||
"currencyCode": "RUB", |
||||
"add": { |
||||
"products": [ |
||||
{ |
||||
"id": product_id, |
||||
"name": title, |
||||
"quantity": product_qty, |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}); |
||||
// $(document.body).trigger('adding_to_cart', [$thisbutton, data]);
|
||||
|
||||
$.ajax({ |
||||
type: 'post', |
||||
url: woocommerce_params.ajax_url, |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
$form.find('.detail-block-form__submit, .store-add-to-cart').addClass('loading').attr('disabled', true) |
||||
}, |
||||
complete: function (response) { |
||||
$form.find('.detail-block-form__submit, .store-add-to-cart').removeClass('loading').attr('disabled', false) |
||||
}, |
||||
success: function (response) { |
||||
$('.modal__item.modal__basket').html(response['cart']); |
||||
if(response['cart_count'] > 0){ |
||||
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count']) |
||||
} |
||||
else{ |
||||
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count']) |
||||
} |
||||
initCounters(); |
||||
let modalF = document.querySelector('.modal'), |
||||
aside = document.querySelector('.modal__aside'), |
||||
device = window.screen.width; |
||||
|
||||
if(!$.cookie('gp-cosmopet-cartadd')){ |
||||
modalF.classList.add('active');
|
||||
$('.modal__basket').addClass('active'); |
||||
let thisContentElement = document.querySelector('.modal__basket'); |
||||
|
||||
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); |
||||
|
||||
$.cookie('gp-cosmopet-cartadd', 'true', { expires: 2 }); |
||||
} |
||||
modalClose('.modal__close'); |
||||
}, |
||||
}); |
||||
|
||||
return false; |
||||
}); |
||||
|
||||
$(document).on('submit', '.modal__form-sub', function (e) { |
||||
e.preventDefault(); |
||||
var email = $(this).find('input[name="email"]').val() |
||||
var data = $(this).serialize() |
||||
$.ajax({ |
||||
type: 'post', |
||||
url: woocommerce_params.ajax_url, |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
// $thisbutton.removeClass('added').addClass('loading');
|
||||
}, |
||||
complete: function (response) { |
||||
// $thisbutton.addClass('added').removeClass('loading');
|
||||
}, |
||||
success: function (response) { |
||||
$('.modal__to-know').removeClass('active') |
||||
$('#sub-result-email').html(email) |
||||
$('.modal__to-know-submit').addClass('active').css('filter', 'blur(0px)') |
||||
}, |
||||
}); |
||||
}); |
||||
|
||||
$(document).on('submit', '.form--contact', function (e) { |
||||
e.preventDefault(); |
||||
var form = this; |
||||
var data = $(this).serialize() |
||||
$.ajax({ |
||||
type: 'post', |
||||
url: woocommerce_params.ajax_url, |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
// $thisbutton.removeClass('added').addClass('loading');
|
||||
}, |
||||
complete: function (response) { |
||||
// $thisbutton.addClass('added').removeClass('loading');
|
||||
}, |
||||
success: function (response) { |
||||
$(form).addClass('submited') |
||||
}, |
||||
}); |
||||
}); |
||||
|
||||
$('body').on('click', '.modal-basket__item .counter__button', function(){ |
||||
var input = $(this).closest('.counter').find('.counter__input').val() |
||||
var price = $(this).closest('.modal-basket-item__control').find('.modal-basket-item__price') |
||||
var productID = $(this).data('id') |
||||
var pr = $(this).closest('.modal-basket__item').find('.modal-basket__item-before').data('pr') |
||||
$(price).html(Number(input) * $(price).data('basecost')) |
||||
$(this).closest('.modal-basket__item').data('cost', Number(price.html())) |
||||
$('#cart_total').html(wc_cart_summary_upd()) |
||||
var title = $(this).closest('.cart_item').find('.modal-basket-item__title').html() |
||||
if ($(this).hasClass('minus')){ |
||||
$(this).attr('data-value', Number( $(this).attr('data-value')) - 1) |
||||
|
||||
if(Number($(this).attr('data-value')) == 0){ |
||||
$(this).closest('.modal-basket__item').find('.modal-basket__item-before').click() |
||||
} |
||||
dataLayer.push({ |
||||
"ecommerce": { |
||||
"currencyCode": "RUB", |
||||
"remove": { |
||||
"products": [ |
||||
{ |
||||
"id": pr, |
||||
"name": title, |
||||
"quantity": 1, |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
else{ |
||||
var min = $(this).closest('.counter--small').find('.minus') |
||||
$(min).attr('data-value', Number($(min).attr('data-value')) + 1) |
||||
dataLayer.push({ |
||||
"ecommerce": { |
||||
"currencyCode": "RUB", |
||||
"add": { |
||||
"products": [ |
||||
{ |
||||
"id": pr, |
||||
"name": title, |
||||
"quantity": 1, |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
// if ($(this).hasClass('minus') && Number(input) == 1){
|
||||
// $(this).closest('.modal-basket__item').find('.modal-basket__item-before').click()
|
||||
// }
|
||||
var data = { |
||||
action: 'get_cartprice', |
||||
quantity: input, |
||||
product: productID |
||||
}; |
||||
$.ajax({ |
||||
type: 'post', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
// $thisbutton.removeClass('added').addClass('loading');
|
||||
}, |
||||
complete: function (response) { |
||||
// $thisbutton.addClass('added').removeClass('loading');
|
||||
}, |
||||
success: function (response) { |
||||
if (response.error) { |
||||
|
||||
} else { |
||||
// $('#cart_total').html(response)
|
||||
initCounters() |
||||
if(response['cart_count'] > 0){ |
||||
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count']) |
||||
} |
||||
else{ |
||||
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count']) |
||||
} |
||||
} |
||||
}, |
||||
}); |
||||
}) |
||||
|
||||
$('body').on('click', '.product-item-overlay__field .counter__button', function(){ |
||||
var input = $(this).closest('.counter').find('.counter__input').val() |
||||
var price = $(this).closest('.product-item__form').find('.product-item-overlay__price') |
||||
|
||||
|
||||
$(price).html(Number(input) * $(price).data('basecost')) |
||||
}) |
||||
|
||||
$('body').on('click', '.modal-basket__item-before', function(){ |
||||
var key = $(this).data('id') |
||||
var p_ID = $(this).data('pr'); |
||||
var var_ID = $(this).data('var'); |
||||
var quantity = $(this).closest('.modal-basket__item').find('.counter__input').val() |
||||
var layout = ` |
||||
<p class="modal-basket-item__title"> |
||||
Удаление товара из корзины: <span id="${key}_timer" class="timer_counter">5</span>с |
||||
</p> |
||||
|
||||
<button class="modal-basket-item__return" id="${key}_return" data-id="${p_ID}" data-var="${var_ID}" data-quantity="${quantity}"> |
||||
Восстановить |
||||
</button> |
||||
` |
||||
if(localeValue == 'en_US'){ |
||||
var layout = ` |
||||
<p class="modal-basket-item__title"> |
||||
Removing product from cart: <span id="${key}_timer" class="timer_counter">5</span>s |
||||
</p> |
||||
|
||||
<button class="modal-basket-item__return" id="${key}_return" data-id="${p_ID}" data-var="${var_ID}" data-quantity="${quantity}"> |
||||
Restore |
||||
</button> |
||||
` |
||||
} |
||||
|
||||
var old_html = $(this).closest('.modal-basket__item').html() |
||||
$(this).closest('.modal-basket__item').addClass('.modal-basket__item--return').html(layout) |
||||
var title = $(this).closest('.cart_item').find('.modal-basket-item__title').html() |
||||
|
||||
|
||||
var timerVal = 5; |
||||
|
||||
var interval = setInterval(function(){ |
||||
timerVal -= 1; |
||||
if (timerVal > 0){ |
||||
$(`#${key}_timer`).html(timerVal) |
||||
} |
||||
else{ |
||||
|
||||
dataLayer.push({ |
||||
"ecommerce": { |
||||
"currencyCode": "RUB", |
||||
"remove": { |
||||
"products": [ |
||||
{ |
||||
"id": p_ID, |
||||
"name": title, |
||||
"quantity": quantity, |
||||
} |
||||
] |
||||
} |
||||
} |
||||
}); |
||||
var input = 0; |
||||
var productID = key; |
||||
|
||||
var data = { |
||||
action: 'get_cartprice', |
||||
quantity: input, |
||||
product: productID |
||||
}; |
||||
$.ajax({ |
||||
type: 'post', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
// $thisbutton.removeClass('added').addClass('loading');
|
||||
}, |
||||
complete: function (response) { |
||||
// $thisbutton.addClass('added').removeClass('loading');
|
||||
}, |
||||
success: function (response) { |
||||
|
||||
if(response['cart_count'] > 0){ |
||||
$('.mini-profile__button--counter').removeClass('disabled').html(response['cart_count']) |
||||
} |
||||
else{ |
||||
$('.mini-profile__button--counter').addClass('disabled').html(response['cart_count']) |
||||
} |
||||
}, |
||||
}); |
||||
$(`#${key}_timer`).closest('.modal-basket__item').remove() |
||||
if (Number(wc_cart_summary_upd()) > 0){ |
||||
$('#cart_total').html(wc_cart_summary_upd()) |
||||
} |
||||
else{ |
||||
var tmpl = `<div class="modal__header --nb">
|
||||
<p class="modal__title">Корзина</p> |
||||
<p class="modal__text">Ваша корзина пуста</p> |
||||
</div> |
||||
|
||||
<div class="modal__footer"> |
||||
<div class="modal__block-button"> |
||||
<div class="modal__button"> |
||||
<a href="/shop/" class="button button--100-perc button--link button--white"> |
||||
Продолжить покупки |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div>` |
||||
|
||||
if(localeValue == 'en_US'){ |
||||
var tmpl = `<div class="modal__header --nb">
|
||||
<p class="modal__title">Cart</p> |
||||
<p class="modal__text">Your cart is empty</p> |
||||
</div> |
||||
|
||||
<div class="modal__footer"> |
||||
<div class="modal__block-button"> |
||||
<div class="modal__button"> |
||||
<a href="/en/shop-3/" class="button button--100-perc button--link button--white"> |
||||
Return to catalog |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div>` |
||||
} |
||||
$('.modal__basket').html(tmpl) |
||||
} |
||||
clearInterval(interval); |
||||
} |
||||
}, 1000) |
||||
|
||||
|
||||
|
||||
|
||||
$(`#${key}_return`).one('click', function(){ |
||||
$(this).closest('.modal-basket__item').removeClass('.modal-basket__item--return').html(old_html) |
||||
clearInterval(interval); |
||||
}) |
||||
}) |
||||
|
||||
$('body').on('click', '.state__button', function(){ |
||||
var s = $(this).closest('.select') |
||||
var id = $(this).data('id') |
||||
var bc = $(this).data('bc') |
||||
|
||||
var form = $(this).closest('.product-item__form') |
||||
|
||||
$(form).find('input[name="variation_id"]').val(id) |
||||
$(form).find('.counter__input').data('maxcount', $(this).data('stock')).attr('data-maxcount', $(this).data('stock')) |
||||
if (Number($(form).find('.counter__input').val()) > Number($(form).find('.counter__input').data('maxcount'))){ |
||||
$(form).find('.counter__input').val($(form).find('.counter__input').data('maxcount')) |
||||
} |
||||
var input = $(form).find('.counter__input').val() |
||||
$(form).find('.product-item-overlay__price').data('basecost', bc).html(Number(bc) * Number(input)) |
||||
}) |
||||
|
||||
$('body').on('click', '.btn-load-ajax', function(){ |
||||
var page = Number($(this).data('page')) + 1 |
||||
var maxpage = Number($(this).data('maxpage')) |
||||
var data = { |
||||
ajax_load: 'ajax',
|
||||
}; |
||||
var btn = this |
||||
var baseUrl = jQuery(location).attr('origin') + jQuery(location).attr('pathname') |
||||
baseUrl += 'page/' + page + '/' |
||||
var searchUrl = baseUrl |
||||
if (jQuery(location).attr('search')){ |
||||
searchUrl += jQuery(location).attr('search') + '&ajax_search=ajax' |
||||
} |
||||
else{ |
||||
searchUrl += '?ajax_search=ajax' |
||||
} |
||||
$.ajax({ |
||||
type: 'get', |
||||
url: searchUrl, |
||||
data: data, |
||||
beforeSend: function (response) { |
||||
$(btn).attr('disabled', true) |
||||
$(btn).attr('data-page', page) |
||||
$(btn).data('page', page) |
||||
}, |
||||
complete: function (response) { |
||||
if (page >= maxpage){ |
||||
$(btn).remove() |
||||
} |
||||
else{ |
||||
$(btn).attr('disabled', false) |
||||
} |
||||
}, |
||||
success: function (response) { |
||||
$('.products').append(response) |
||||
initCounters() |
||||
initOverlay() |
||||
initSelect() |
||||
modalOpen('.open-to-know', '.modal__to-know'); |
||||
|
||||
/// РЕШЕНИЕ ДЛЯ СТЕНДА AJAX ДЛЯ ПОДГРУЗКИ AJAX
|
||||
document.querySelectorAll('img').forEach(img => {
|
||||
var str = img.attributes['src'].value.replace('https://cosmopet.good-production.xyz/', 'https://cosmopet.shop/') |
||||
checkImage(str, function(){ img.attributes['src'].value = str }); |
||||
if (img.attributes['srcset']){ |
||||
img.attributes['srcset'].value = img.attributes['srcset'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>') |
||||
} |
||||
}) |
||||
//
|
||||
}, |
||||
}); |
||||
}) |
||||
|
||||
// $('body').on('click', '.singular-w-btn', function(){
|
||||
// var wg = $(this).data('wg')
|
||||
// var id = $(this).data('id')
|
||||
// $('#variation_id').val(id)
|
||||
// $('.detail__block-price').hide()
|
||||
// $('.detail__block-price[data-wg="' + wg + '"]').show()
|
||||
// if ($(this).data('available')){
|
||||
// $('.detail-block-form__item--tn').hide()
|
||||
// $('.detail-block-form__item--add').show()
|
||||
// }
|
||||
// else{
|
||||
// $('.detail-block-form__item--tn').show()
|
||||
// $('.detail-block-form__item--add').hide()
|
||||
// }
|
||||
|
||||
// })
|
||||
// асинхронный запрос при отправке формы
|
||||
$( '#ajaxform' ).on( 'submit',function( event ) { |
||||
event.preventDefault(); |
||||
|
||||
const form = $(this); |
||||
|
||||
$.ajax( { |
||||
type : 'POST', |
||||
url : woocommerce_params.ajax_url, |
||||
data : form.serialize(), |
||||
beforeSend : function( xhr ) { |
||||
$('.products').addClass('loading') |
||||
form.find('.button-submit').addClass('loading').attr('disabled', true) |
||||
}, |
||||
success : function( data ) { |
||||
$( '.products' ).html( data.products ); |
||||
$('.product__tag').html(data.tags); |
||||
$( '.btn-load-ajax' ).remove() |
||||
form.find('.button-submit').removeClass('loading').attr('disabled', false) |
||||
form.find('.modal__close').click() |
||||
$('.products').removeClass('loading') |
||||
if (data.err){ |
||||
$('.product__error-button').show() |
||||
} |
||||
else{ |
||||
$('.product__error-button').hide() |
||||
} |
||||
|
||||
initCounters() |
||||
initOverlay() |
||||
initSelect() |
||||
modalOpen('.open-to-know', '.modal__to-know'); |
||||
|
||||
document.querySelectorAll('img').forEach(img => {
|
||||
var str = img.attributes['src'].value.replace('https://cosmopet.good-production.xyz/', 'https://cosmopet.shop/') |
||||
checkImage(str, function(){ img.attributes['src'].value = str }); |
||||
if (img.attributes['srcset']){ |
||||
img.attributes['srcset'].value = img.attributes['srcset'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>') |
||||
} |
||||
}) |
||||
} |
||||
|
||||
} ); |
||||
|
||||
} ); |
||||
|
||||
|
||||
$('body').on('click', '.product-tag__item', function(){ |
||||
$('#tax_' + $(this).data('tag')).find('input').prop('checked', false) |
||||
$('#tax_' + $(this).data('tag')).removeClass('active'); |
||||
$(this).remove() |
||||
$('#ajaxform').submit() |
||||
}) |
||||
|
||||
|
||||
// Login
|
||||
$('.login_popup').on('click', function(e){ |
||||
e.preventDefault(); |
||||
$('.login_modal').addClass('active'); |
||||
}); |
||||
$('.login_close').on('click', function(){ |
||||
$('.login_modal').removeClass('active'); |
||||
}); |
||||
$('.login_back').on('click', function(){ |
||||
if($(this).is('.disabled')) { |
||||
return false; |
||||
} |
||||
$('.login_wrap .step').toggleClass('active'); |
||||
}); |
||||
$('.login_input input').on('input keyup', function(){ |
||||
$('.login_input').removeClass('error'); |
||||
}); |
||||
$('.js-get-code').on('click', function(){ |
||||
$('.login_input').removeClass('error'); |
||||
|
||||
var email = $('.js-input-email input').val(); |
||||
$('.sended_email').text(email); |
||||
|
||||
if(email === '') { |
||||
$('.js-input-email').addClass('error'); |
||||
$('.js-input-email .login_error').text(localeValue == 'en_US' ? 'Enter your email' : 'Укажите Email'); |
||||
return false; |
||||
} else { |
||||
// Проверка Email
|
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: {action: 'email_validate', email:email}, |
||||
success: function(data){ |
||||
if(data['status'] === 'error') { |
||||
$('.js-input-email').addClass('error'); |
||||
$('.js-input-email .login_error').text(data['text']); |
||||
return false; |
||||
} else { |
||||
$('.login_wrap .step').toggleClass('active'); |
||||
send_code(); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
} |
||||
|
||||
}); |
||||
$('.js-repeat-code').on('click', function(){ |
||||
$('.login_input').removeClass('error'); |
||||
send_code(); |
||||
}); |
||||
|
||||
function send_code(){ |
||||
$('.login_timer').show(); |
||||
$('.js-repeat-code').hide(); |
||||
$('.login_back').addClass('disabled'); |
||||
// Timer
|
||||
var seconds = 15; |
||||
var interval = setInterval(function() { |
||||
if (seconds > 0) { |
||||
seconds--; |
||||
$('.seconds').text(seconds); |
||||
} else { |
||||
clearInterval(interval); |
||||
$('.login_timer').hide(); |
||||
$('.js-repeat-code').show(); |
||||
$('.login_back').removeClass('disabled'); |
||||
$('.seconds').text(15); |
||||
} |
||||
}, 1000); |
||||
//Ajax отправка кода
|
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: {action: 'send_code', email: $('.js-input-email input').val()} |
||||
}); |
||||
} |
||||
// Проверка кода и регистрация/авторизация
|
||||
$('.js-input-code input').on('input keydown keyup propertychange paste cut copy change', function(){ |
||||
var val = $(this).val(); |
||||
var email = $('.js-input-email input').val(); |
||||
if(val.length === 4) { |
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: {action: 'check_code', code: val, email: email}, |
||||
success: function(data){ |
||||
console.log(data); |
||||
if(data['status'] == 'success_reg') { |
||||
$('.login_forms').addClass('hide'); |
||||
$('.login_success').removeClass('hide'); |
||||
if (typeof wc_checkout_params !== 'undefined') { |
||||
location.reload() |
||||
} |
||||
} |
||||
if(data['status'] == 'success_auth') { |
||||
$('.login_forms').addClass('hide'); |
||||
$('.login_auth').removeClass('hide'); |
||||
if (typeof wc_checkout_params !== 'undefined') { |
||||
location.reload() |
||||
} |
||||
} |
||||
if(data['status'] == 'error') { |
||||
$('.js-input-code').addClass('error'); |
||||
$('.js-input-code .login_error').text(data['text']); |
||||
} |
||||
} |
||||
}); |
||||
}
|
||||
}); |
||||
|
||||
$('.email_link_form').on('submit', function(e){ |
||||
e.preventDefault(); |
||||
$('.cabinet-card_linked-email .error').remove(); |
||||
var data = $(this).serializeArray(); |
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: '/wp-admin/admin-ajax.php', |
||||
data: data, |
||||
success: function(data){ |
||||
if(data['error']) { |
||||
$('.cabinet-card_linked-email').append('<div class="cabinet-card__status cabinet-card__status--cancelled error">'+data['error']+'</div>'); |
||||
} else { |
||||
location.reload(); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
}); |
||||
|
||||
|
||||
})(jQuery); |
||||
|
||||
function checkImage(imageSrc, good) { |
||||
var img = new Image(); |
||||
img.onload = good; |
||||
img.src = imageSrc; |
||||
} |
||||
// header
|
||||
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false); |
||||
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white'); |
||||
toggleHeader('#phone-menu','.header__menu-block','.header__phone-menu', '.white', 'white'); |
||||
// header
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function initOverlay(){ |
||||
|
||||
// overlay
|
||||
let products = document.querySelectorAll('.product__item'); |
||||
|
||||
products.forEach(productItem => { |
||||
let button = productItem.querySelector('.open-overlay'), |
||||
overlay = productItem.querySelector('.product-item__overlay'); |
||||
|
||||
|
||||
if (button) { |
||||
button.onclick = function (e) { |
||||
document.querySelectorAll('.product__item').forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.classList.remove('active'); |
||||
} |
||||
}); |
||||
document.querySelectorAll('.product-item__overlay').forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.classList.remove('active'); |
||||
} |
||||
}); |
||||
|
||||
productItem.classList.toggle('active');
|
||||
overlay.classList.toggle('active');
|
||||
} |
||||
} |
||||
|
||||
}) |
||||
// overlay
|
||||
} |
||||
|
||||
initOverlay() |
||||
|
||||
|
||||
function initSelect(){ |
||||
|
||||
|
||||
// select
|
||||
toggleOpenX('.select', '.select__state' , '.state__content', '.state__block', true); |
||||
|
||||
let selects = document.querySelectorAll('.select'); |
||||
|
||||
selects.forEach(select => { |
||||
let state = select.querySelector('.select__state'), |
||||
content = select.querySelector('.state__block'), |
||||
buttons = select.querySelectorAll('.state__button'); |
||||
|
||||
buttons.forEach(e => { |
||||
let button = e; |
||||
|
||||
e.onclick = function (event) { |
||||
event.preventDefault(); |
||||
|
||||
buttons.forEach(element => { |
||||
if (element.classList.contains('active')) { |
||||
element.classList.remove('active'); |
||||
} |
||||
})
|
||||
|
||||
let text = e.textContent.trim(); |
||||
state.value = text; |
||||
|
||||
button.classList.add('active'); |
||||
content.style.height = 0; |
||||
select.classList.remove('active'); |
||||
}
|
||||
}) |
||||
}) |
||||
|
||||
// select
|
||||
} |
||||
initSelect() |
||||
|
||||
// counter
|
||||
function initCounters(){ |
||||
let counters = document.querySelectorAll('.counter'); |
||||
counters.forEach(e => { |
||||
let minus = e.querySelector('.minus'), |
||||
plus = e.querySelector('.plus'), |
||||
input = e.querySelector('.counter__input'); |
||||
minus.onclick = function (e) { |
||||
e.preventDefault(); |
||||
|
||||
let number = input.value; |
||||
|
||||
if (number >= 2){ |
||||
input.value = Number(number) - 1; |
||||
input.setAttribute('value', input.value) |
||||
} |
||||
} |
||||
|
||||
plus.onclick = function (e) { |
||||
e.preventDefault(); |
||||
|
||||
let number = input.value; |
||||
let max = input.dataset.maxcount |
||||
if (number <= max - 1) { |
||||
input.value = Number(number) + 1; |
||||
input.setAttribute('value', input.value) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
|
||||
initCounters() |
||||
// counter
|
||||
|
||||
// checkbox
|
||||
let checkbox = document.querySelectorAll('.checkbox'); |
||||
|
||||
checkbox.forEach(e => { |
||||
e.onclick = function (event) { |
||||
let input = e.querySelector('.checkbox__input'); |
||||
|
||||
if (!e.classList.contains('active')) { |
||||
input.checked = 1; |
||||
}else{ |
||||
input.checked = 0; |
||||
} |
||||
e.classList.toggle('active'); |
||||
} |
||||
}) |
||||
// checkbox
|
||||
|
||||
|
||||
// function
|
||||
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 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'); |
||||
} |
||||
} |
||||
|
||||
}); |
||||
} |
||||
var menu_opened = false; |
||||
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.Y <= 25) { |
||||
thisRemoveBlock.classList.add(removeClass); |
||||
} |
||||
} |
||||
} |
||||
menu_opened = !menu_opened; |
||||
} |
||||
} |
||||
|
||||
|
||||
// resize
|
||||
window.addEventListener('resize', (e) => { |
||||
let width = window.screen.width; |
||||
|
||||
// media
|
||||
modalOpen('.button--filter', '.modal__filter'); |
||||
modalOpen('.basket-open', '.modal__basket'); |
||||
modalOpen('.login-open', '.modal__login'); |
||||
modalOpen('.open-to-know', '.modal__to-know'); |
||||
modalClose('.modal__close'); |
||||
modalClose('.modal-form-sub__close'); |
||||
|
||||
let modalItem = document.querySelectorAll('.modal__item'); |
||||
|
||||
// if (width <= 720) {
|
||||
modalItem.forEach(modal => { |
||||
if (modal.classList.contains('active')) { |
||||
let aside = document.querySelector('.modal__aside'); |
||||
|
||||
if (width <= 720) { |
||||
aside.style.width = `${width}px` |
||||
}else{ |
||||
let openAside = document.querySelector('.modal__item.active'), |
||||
newWidth = openAside.clientWidth; |
||||
|
||||
aside.style.width = `${newWidth}px` |
||||
} |
||||
} |
||||
}) |
||||
// }
|
||||
}); |
||||
// resize
|
||||
|
||||
//
|
||||
|
||||
|
||||
if (document.querySelector('.header').classList.contains('white')) { |
||||
window.addEventListener("scroll", function (e) { |
||||
let header = document.querySelector('.header'); |
||||
let scroll = window.scrollY; |
||||
if(!menu_opened){ |
||||
if (scroll >= 25) { |
||||
header.classList.remove('white') |
||||
}else{ |
||||
|
||||
header.classList.add('white') |
||||
|
||||
} |
||||
} |
||||
|
||||
}); |
||||
} |
||||
// scroll
|
||||
|
||||
|
||||
|
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,96 @@ |
||||
'use strict'; |
||||
|
||||
|
||||
let widthPhoneCabinet = 1200; |
||||
|
||||
toggleOpenX('.cabinet-card__order', '.cabinet-card-order__open-detail', '.cabinet-card-order__detail', '.cabinet-card-order__block-detail'); |
||||
|
||||
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);
|
||||
if (thisButtonElement){ |
||||
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'); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
}); |
||||
} |
||||
|
||||
jQuery('.cabinet-card__button').on('click', function(){ |
||||
var id = jQuery(this).data('edit') |
||||
jQuery(`#pet_edit_` + id).addClass('active') |
||||
}) |
||||
|
||||
jQuery('.form-sub__btn').on('click', function(){ |
||||
jQuery(`#subForm`).addClass('active') |
||||
}) |
||||
|
||||
jQuery('.user-edit-open').on('click', function(){ |
||||
jQuery(`#user_edit`).addClass('active') |
||||
}) |
||||
|
||||
jQuery('.cabinet-card__block-add-pets').on('click', function(){ |
||||
jQuery(`#pet_add_form`).addClass('active') |
||||
}) |
||||
|
||||
|
||||
jQuery(document).ready(function ($) { |
||||
$('.subscription-address-form').on('submit', function (e) { |
||||
e.preventDefault(); |
||||
|
||||
var $form = $(this); |
||||
var $message = $form.find('.form-message'); |
||||
var subscriptionId = $form.data('subscription-id'); |
||||
var address = $form.find('input[name="address"]').val(); |
||||
var comment = $form.find('textarea[name="comment"]').val(); |
||||
var nonce = $form.find('input[name="address_nonce"]').val(); |
||||
|
||||
$message.hide().removeClass('success error').empty(); |
||||
|
||||
$.ajax({ |
||||
url: '/wp-admin/admin-ajax.php', // Defined in wp_localize_script
|
||||
type: 'POST', |
||||
data: { |
||||
action: 'update_subscription_address', |
||||
subscription_id: subscriptionId, |
||||
address: address, |
||||
comment: comment, |
||||
address_nonce: nonce |
||||
}, |
||||
success: function (response) { |
||||
if (response.success) { |
||||
$message.addClass('success').text(response.data.message).show(); |
||||
} else { |
||||
$message.addClass('error').text(response.data.message).show(); |
||||
} |
||||
}, |
||||
error: function () { |
||||
|
||||
} |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,193 @@ |
||||
<?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'), |
||||
]; |
||||
|
||||
|
||||
if ($orders_pg){ |
||||
Timber::render('profile/profile-orders.twig', $context); |
||||
} |
||||
else{ |
||||
Timber::render('profile/profile.twig', $context); |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,143 @@ |
||||
<?php |
||||
if (!defined('ABSPATH')) { |
||||
exit; |
||||
} |
||||
use Timber\Timber; |
||||
add_filter('timber/twig/filters', function ($filters) { |
||||
$filters['wp_get_attachment_image_src'] = [ |
||||
'callable' => function ($attachment_id, $size = 'thumbnail', $icon = false) { |
||||
$image = wp_get_attachment_image_src($attachment_id, $size, $icon); |
||||
return $image ? $image[0] : ''; // Return the URL or empty string |
||||
}, |
||||
]; |
||||
return $filters; |
||||
}); |
||||
add_filter('timber/twig/functions', function ($functions) { |
||||
$functions['wc_get_page_permalink'] = [ |
||||
'callable' => 'wc_get_page_permalink', |
||||
]; |
||||
$functions['wc_get_endpoint_url'] = [ |
||||
'callable' => 'wc_get_endpoint_url', |
||||
]; |
||||
$functions['is_wc_endpoint_url'] = [ |
||||
'callable' => 'is_wc_endpoint_url', |
||||
]; |
||||
$functions['get_permalink'] = [ |
||||
'callable' => 'get_permalink', |
||||
]; |
||||
$functions['get_the_ID'] = [ |
||||
'callable' => 'get_the_ID', |
||||
]; |
||||
$functions['pll_e'] = [ |
||||
'callable' => 'pll_e', |
||||
]; |
||||
return $functions; |
||||
}); |
||||
|
||||
// Get subscription ID from URL (e.g., /my-account/view-subscription/7632/) |
||||
|
||||
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; |
||||
if (preg_match('/view-subscription\/(\d+)/', $request_uri, $matches)) { |
||||
$subscription_id = absint($matches[1]); |
||||
} |
||||
|
||||
|
||||
$subscription = $subscription_id ? wcs_get_subscription($subscription_id) : null; |
||||
|
||||
if (!$subscription || !wcs_is_subscription($subscription) || $subscription->get_user_id() !== get_current_user_id()) { |
||||
error_log('Invalid or inaccessible subscription ID: ' . $subscription_id); |
||||
$subscription = null; |
||||
} else { |
||||
error_log('Subscription ID: ' . $subscription->get_id() . ' | Status: ' . $subscription->get_status()); |
||||
|
||||
$items = array_map(function ($item) { |
||||
$product_id = $item->get_product_id(); |
||||
$variation_id = $item->get_variation_id(); |
||||
$wc_product = $product_id ? wc_get_product($variation_id ?: $product_id) : null; |
||||
$product_name = $wc_product ? $wc_product->get_name() : 'Unknown Product'; |
||||
$image_id = $wc_product ? $wc_product->get_image_id() : 0; |
||||
$status = $product_id ? get_post_status($product_id) : 'N/A'; |
||||
$permalink = $wc_product && $wc_product->is_visible() ? get_permalink($product_id) : ''; |
||||
$variation_details = $variation_id ? wc_get_formatted_variation($wc_product, true) : ''; |
||||
error_log('Item ID: ' . $item->get_id() . ' | Product ID: ' . $product_id . ' | Variation ID: ' . $variation_id . ' | Name: ' . $product_name . ' | Permalink: ' . $permalink . ' | Status: ' . $status); |
||||
|
||||
return [ |
||||
'product' => [ |
||||
'id' => $product_id ?: 0, |
||||
'name' => $product_name, |
||||
'image_id' => $image_id, |
||||
'variation_details' => $variation_details, |
||||
], |
||||
'quantity' => $item->get_quantity(), |
||||
'total' => $item->get_total(), |
||||
]; |
||||
}, $subscription->get_items()); |
||||
|
||||
|
||||
$cancel_url = ''; |
||||
if ($subscription->can_be_updated_to('cancelled')) { |
||||
$cancel_url = add_query_arg( |
||||
[ |
||||
'subscription_id' => $subscription->get_id(), |
||||
'change_subscription_to' => 'cancelled', |
||||
'_wpnonce' => wp_create_nonce('wcs_switch_request'), |
||||
], |
||||
wc_get_endpoint_url('view-subscription', $subscription->get_id(), wc_get_page_permalink('myaccount')) |
||||
); |
||||
} |
||||
|
||||
$subscription_data = [ |
||||
'id' => $subscription->get_id(), |
||||
'status' => $subscription->get_status(), |
||||
'date_created' => $subscription->get_date_created(), |
||||
'last_order_date' => $subscription->get_date('last_order_date_created'), |
||||
'next_payment_date' => $subscription->get_date('next_payment'), |
||||
'payment_method_title' => $subscription->get_payment_method_title(), |
||||
'total' => $subscription->get_total(), |
||||
'currency' => $subscription->get_currency(), |
||||
'items' => $items, |
||||
'cancel_url' => $cancel_url, |
||||
'shipping_address' => $subscription->get_formatted_shipping_address(), |
||||
'shipping_comment' => $subscription->get_customer_note(), |
||||
]; |
||||
} |
||||
|
||||
// Timber context |
||||
$context = Timber::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['bot_username'] = defined('BOT_USERNAME') ? BOT_USERNAME : ''; |
||||
$context['subscription'] = $subscription_data; |
||||
|
||||
// Debug: Log subscription data |
||||
error_log('Subscription Data: ' . print_r($subscription_data, true)); |
||||
|
||||
// Render the Twig template |
||||
Timber::render('profile/profile-subs-single.twig', $context); |
||||
?> |
@ -0,0 +1,107 @@ |
||||
<?php |
||||
if (!defined('ABSPATH')) { |
||||
exit; |
||||
} |
||||
add_filter('timber/twig/filters', function ($filters) { |
||||
$filters['wp_get_attachment_image_src'] = [ |
||||
'callable' => function ($attachment_id, $size = 'thumbnail', $icon = false) { |
||||
$image = wp_get_attachment_image_src($attachment_id, $size, $icon); |
||||
return $image ? $image[0] : ''; // Return the URL or empty string |
||||
}, |
||||
]; |
||||
return $filters; |
||||
}); |
||||
|
||||
|
||||
use Timber\Timber; |
||||
|
||||
|
||||
$context = Timber::context(); |
||||
if (!class_exists('WC_Subscriptions')) { |
||||
error_log('WooCommerce Subscriptions plugin is not active.'); |
||||
return; |
||||
} |
||||
|
||||
// Get the current user’s subscriptions |
||||
$user_id = get_current_user_id(); |
||||
$subscriptions = wcs_get_users_subscriptions($user_id); |
||||
|
||||
$subscription_data = []; |
||||
foreach ($subscriptions as $subscription) { |
||||
$view_url = $subscription->get_view_order_url(); |
||||
// Debug: Log the view_url to check its value |
||||
error_log('Subscription ID: ' . $subscription->get_id() . ' | View URL: ' . $view_url); |
||||
|
||||
$subscription_data[] = [ |
||||
'id' => $subscription->get_id(), |
||||
'date_created' => $subscription->get_date_created(), |
||||
'total' => $subscription->get_total(), |
||||
'currency' => $subscription->get_currency(), |
||||
'billing_period' => $subscription->get_billing_period(), |
||||
'next_payment_date' => $subscription->get_date('next_payment'), |
||||
'view_url' => esc_url($view_url), // Ensure URL is escaped for safety |
||||
'items' => array_map(function ($item) { |
||||
$product = $item->get_product(); |
||||
return [ |
||||
'product' => [ |
||||
'name' => $product->get_name(), |
||||
'image_id' => $product->get_image_id(), |
||||
], |
||||
]; |
||||
}, $subscription->get_items()), |
||||
]; |
||||
} |
||||
|
||||
$context['subscriptions'] = $subscription_data; |
||||
|
||||
// Debug: Log the entire subscriptions array |
||||
error_log('Subscriptions Data: ' . print_r($subscription_data, true)); |
||||
|
||||
// Render the Twig template |
||||
|
||||
$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()); |
||||
$context['bot_username'] = defined('BOT_USERNAME') ? BOT_USERNAME : ''; |
||||
// Запрос для питомцев |
||||
$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['months'] = [ |
||||
__('january', 'woodmart'), |
||||
__('february', 'woodmart'), |
||||
__('march', 'woodmart'), |
||||
__('april', 'woodmart'), |
||||
__('may', 'woodmart'), |
||||
__('june', 'woodmart'), |
||||
__('july', 'woodmart'), |
||||
__('august', 'woodmart'), |
||||
__('september', 'woodmart'), |
||||
__('october', 'woodmart'), |
||||
__('november', 'woodmart'), |
||||
__('december', 'woodmart'), |
||||
]; |
||||
|
||||
Timber::render('profile/profile-subs.twig', $context); |
||||
?> |
@ -0,0 +1,134 @@ |
||||
<?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['phone'] ); |
||||
|
||||
} |
||||
|
||||
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,2 @@ |
||||
<?php
|
||||
$context = Timber::get_context(); |
@ -0,0 +1,65 @@ |
||||
/* Основные стили страницы */ |
||||
.woocommerce-order { |
||||
max-width: 800px; |
||||
margin: 2rem auto; |
||||
padding: 2rem; |
||||
background: #fff; |
||||
box-shadow: 0 0 10px rgba(0,0,0,0.1); |
||||
border-radius: 8px; |
||||
} |
||||
|
||||
/* Заголовок */ |
||||
.woocommerce-order h2.woocommerce-order-details__title, |
||||
.woocommerce-order h2.woocommerce-column__title { |
||||
color: #333; |
||||
border-bottom: 2px solid #eee; |
||||
padding-bottom: 10px; |
||||
} |
||||
|
||||
/* Детали заказа */ |
||||
.woocommerce-order-overview { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 1rem; |
||||
margin-bottom: 2rem; |
||||
} |
||||
|
||||
.woocommerce-order-overview li { |
||||
flex: 1; |
||||
min-width: 200px; |
||||
background: #f9f9f9; |
||||
padding: 1rem; |
||||
border-radius: 4px; |
||||
} |
||||
|
||||
/* Кнопка "Вернуться в магазин" */ |
||||
.woocommerce-button.button.wc-backward { |
||||
background: #4CAF50; |
||||
color: white; |
||||
padding: 10px 20px; |
||||
border-radius: 4px; |
||||
text-decoration: none; |
||||
display: inline-block; |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
.woocommerce-button.button.wc-backward:hover { |
||||
background: #3e8e41; |
||||
} |
||||
|
||||
|
||||
@media (max-width: 768px) { |
||||
.woocommerce-order { |
||||
padding: 1rem; |
||||
margin: 1rem; |
||||
} |
||||
|
||||
.woocommerce-order-overview li { |
||||
min-width: 100%; |
||||
} |
||||
|
||||
.woocommerce-order-details, |
||||
.woocommerce-customer-details { |
||||
margin-top: 1rem; |
||||
} |
||||
} |
@ -0,0 +1,55 @@ |
||||
jQuery(document).ready(function($) { |
||||
window.onTelegramAuth = function(user) { |
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: telegram_auth_params.ajax_url, |
||||
data: { |
||||
action: 'ontelegramauth', |
||||
userid: user.id, |
||||
username: user.username || '', |
||||
fname: user.first_name || '', |
||||
lname: user.last_name || '', |
||||
photo_url: user.photo_url || '', |
||||
auth_date: user.auth_date, |
||||
hash: user.hash |
||||
}, |
||||
success: function(response) { |
||||
if (response.success) { |
||||
window.location.href = telegram_auth_params.my_account_url; |
||||
} else { |
||||
alert(telegram_auth_params.i18n_error + ': ' + (response.data.message || 'Unknown error')); |
||||
} |
||||
}, |
||||
error: function() { |
||||
alert(telegram_auth_params.i18n_error); |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
window.linkTelegram = function(user) { |
||||
$.ajax({ |
||||
type: 'POST', |
||||
url: telegram_auth_params.ajax_url, |
||||
data: { |
||||
action: 'linktelegram', |
||||
userid: user.id, |
||||
username: user.username || '', |
||||
fname: user.first_name || '', |
||||
lname: user.last_name || '', |
||||
photo_url: user.photo_url || '', |
||||
auth_date: user.auth_date, |
||||
hash: user.hash |
||||
}, |
||||
success: function(response) { |
||||
if (response.success) { |
||||
$('.cabinet-accounts').html('<svg width="40px" height="40px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg>'); |
||||
} else { |
||||
alert(telegram_auth_params.i18n_error_link + ': ' + (response.data.message || 'Unknown error')); |
||||
} |
||||
}, |
||||
error: function() { |
||||
alert(telegram_auth_params.i18n_error_link); |
||||
} |
||||
}); |
||||
}; |
||||
}); |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,51 @@ |
||||
<div class="modal__item modal__login"> |
||||
<button class="modal__close"> |
||||
<img src="<?php bloginfo('template_url');?>/gp-include/assets/core/img/svg/main/black-x.svg" alt=""> |
||||
</button> |
||||
|
||||
<div class="login_wrap login_forms"> |
||||
<div class="login_inner step active"> |
||||
<h2 class="login_title">Войти или зарегистрироваться</h2> |
||||
<div class="login_subtitle">Подтвердите свой e-mail в письме</div> |
||||
<div class="login_input js-input-email"> |
||||
<input type="text" name="email" placeholder="example@example.com"/> |
||||
<div class="login_error"></div> |
||||
</div> |
||||
<button class="login_btn btn_gradient js-get-code">Получить код</button> |
||||
{{ function('tgWidget') }} |
||||
</div> |
||||
<div class="login_inner step"> |
||||
<div class="login_back"> |
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="32" height="32" rx="16" fill="#121212"/><path d="M8.5 16.3633H25" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.5 16.3633L14.864 22.7272" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M8.5 16.3633L14.864 9.99932" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg> |
||||
</div> |
||||
<h2 class="login_title">Введите код</h2> |
||||
<div class="login_subtitle">Код отправленный на e-mail:<span class="sended_email"></span></div> |
||||
<div class="login_input js-input-code"> |
||||
<input type="text" name="code" placeholder="0000"/> |
||||
<div class="login_error"></div> |
||||
</div> |
||||
<div class="login_timer">Запросить новый код: <span class="seconds">15</span> секунд</div> |
||||
<button class="login_btn btn_gradient js-repeat-code">Запросить новый код</button> |
||||
</div> |
||||
<div class="login_privacy"> |
||||
Нажимая на кнопку «Получить код», я даю согласие на обработку моих персональных данных в соответствии с <a href="/privacy-policy">политикой обработки персональных данных</a> |
||||
</div> |
||||
</div> |
||||
<div class="login_wrap login_success hide"> |
||||
<div class="login_inner active"> |
||||
<h2 class="login_title">Спасибо<br />за авторизацию</h2> |
||||
<div class="login_subtitle">Теперь вы можете получать промокоды за покупки.</div> |
||||
<img src="<?php bloginfo('template_url');?>/images/people.png" alt=""/> |
||||
<a href="/my-account" class="login_btn account_link">Заполнить профиль</a> |
||||
</div> |
||||
</div> |
||||
<div class="login_wrap login_auth hide"> |
||||
<div class="login_inner active"> |
||||
<h2 class="login_title --text-center"> |
||||
Вы вошли в систему</h2> |
||||
<img src="<?php bloginfo('template_url');?>/images/people.png" alt=""/> |
||||
<a href="/my-account" class="login_btn account_link">Профиль</a> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
@ -0,0 +1,611 @@ |
||||
<main class="wrapper"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-mobile"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title"> |
||||
{{ function('pll_e', 'Feed subscription') }} |
||||
</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text">{{ function('pll_e', 'Weekly food delivery for your pet') }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn"> |
||||
{{ function('pll_e', 'Get details') }} |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="cabinet__control cabinet__control--column"> |
||||
<a href="{{ fn('wc_get_page_permalink', 'myaccount') }}" class="to-know to-know--start button--100-perc to-know--background-none"> |
||||
<p>{{ fn('pll_e', 'Перейти в профиль') }}</p> |
||||
</a> |
||||
<div class="form-input__tabs form-input__tabs--control form-input__tabs--white"> |
||||
<a href="{{ fn('wc_get_endpoint_url', 'orders', '', fn('wc_get_page_permalink', 'myaccount')) }}" class="form-input-tabs__button {% if fn('is_wc_endpoint_url','orders') %}active{% endif %}"> |
||||
{{ fn('pll_e', 'Заказы') }} |
||||
</a> |
||||
<a href="{{ fn('wc_get_page_permalink', 'myaccount') }}subscriptions" class="form-input-tabs__button {% if fn('is_wc_endpoint_url','subscriptions') %}active{% endif %}"> |
||||
{{ fn('pll_e', 'Подписки') }} |
||||
</a> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="cabinet"> |
||||
<div class="cabinet__profile cabinet-content {% if not fn('is_wc_endpoint_url') %}active hide{% endif %}"> |
||||
<div class="form-input__tabs form-input__tabs--control form-input__tabs--white"> |
||||
|
||||
<a href="{{ fn('wc_get_endpoint_url', '', '', fn('wc_get_page_permalink', 'myaccount')) }}" class="form-input-tabs__button {% if not fn('is_wc_endpoint_url') %}active{% endif %}"> |
||||
{{ fn('pll_e', 'Заказы') }} |
||||
</a> |
||||
<a href="subscriptions" class="form-input-tabs__button {% if fn('is_wc_endpoint_url','subscriptions') %}active{% endif %}"> |
||||
{{ fn('pll_e', 'Подписки') }} |
||||
</a> |
||||
</div> |
||||
|
||||
<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 %} |
||||
{{ function('pll_e', 'Name is not set') }} |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ function('pll_e', 'Phone') }}:</p> |
||||
<p class="cabinet-card__text {% if not phone %}cabinet-card__text--grey{% endif %}"> |
||||
{% if phone %} |
||||
{{ phone }} |
||||
{% else %} |
||||
{{ function('pll_e', 'Not filled') }} |
||||
{% endif %} |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ function('pll_e', 'Email') }}:</p> |
||||
{% if email %} |
||||
<p class="cabinet-card__text">{{ email }}</p> |
||||
{% if activated %} |
||||
<p class="cabinet-card__status cabinet-card__status--chek">{{ function('pll_e', 'Email is verified') }}</p> |
||||
{% else %} |
||||
<p class="cabinet-card__status cabinet-card__status--cancelled">{{ function('pll_e', 'Email is not verified') }}</p> |
||||
<form class="email_approve_form"> |
||||
<input type="hidden" name="action" value="email_activate"> |
||||
<button type="submit" class="cabinet-card__confirm">{{ function('pll_e', 'Verify') }}</button> |
||||
</form> |
||||
{% if uuid %} |
||||
<p class="cabinet-card__status">{{ function('pll_e', 'Email with verification link is sent to your email.') }}</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">{{ function('pll_e', 'Link email') }}</button> |
||||
</form> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__label">{{ function('pll_e', 'Linked accounts') }}:</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">{{ function('pll_e', 'Edit') }}</button> |
||||
<a href="{{ fn('wp_logout_url', fn('home_url')) }}" class="cabinet-card__button">{{ function('pll_e', 'Logout') }}</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
{% if pets %} |
||||
{% for pet in pets %} |
||||
{% include 'pet-card.twig' with { 'item': 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 }}/static/img/svg/main/plus-grey.svg" alt=""> |
||||
</div> |
||||
<p class="cabinet-card-add-pets__text">{{ function('pll_e', 'Add a pet') }}</p> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
{% block profile_content %} |
||||
|
||||
{% endblock %} |
||||
|
||||
|
||||
</main> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modalProfile" id="pet_add_form"> |
||||
<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">{{ fn('pll_e', 'Добавить питомца') }}</p> |
||||
|
||||
<form class="modal-form__content" id="add-pet-form" method="post" action=""> |
||||
<input type="hidden" name="nonce" value="{{ fn('wp_create_nonce', 'add_pet_nonce') }}"> |
||||
<input type="hidden" name="action" value="add_pet"> |
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Вид животного') }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label for="pet_type_cat" class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Кошка') }} |
||||
<input type="radio" value="cat" checked name="pet" id="pet_type_cat" class="form-input-tabs__input"> |
||||
</label> |
||||
<label for="pet_type_dog" class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Собака') }} |
||||
<input type="radio" value="dog" name="pet" id="pet_type_dog" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line sterilized"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Стерелизован') }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label for="sterilized_yes" class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Да') }} |
||||
<input type="radio" value="1" checked name="sterilized" id="sterilized_yes" class="form-input-tabs__input"> |
||||
</label> |
||||
<label for="sterilized_no" class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Нет') }} |
||||
<input type="radio" value="0" name="sterilized" id="sterilized_no" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="pet_name" class="label-name">{{ fn('pll_e', 'Имя') }}</label> |
||||
<input id="pet_name" class="form__input" type="text" name="name" placeholder="{{ fn('pll_e', 'Имя питомца') }}" required> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="pet_breed" class="label-name">{{ fn('pll_e', 'Порода') }}</label> |
||||
<input id="pet_breed" class="form__input" type="text" name="breed" placeholder="{{ fn('pll_e', 'Порода вашего питомца') }}" required> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Пол вашего питомца') }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label for="pet_sex_male" class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Мальчик') }} |
||||
<input type="radio" value="male" checked name="sex" id="pet_sex_male" class="form-input-tabs__input"> |
||||
</label> |
||||
<label for="pet_sex_female" class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Девочка') }} |
||||
<input type="radio" value="female" name="sex" id="pet_sex_female" 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">{{ fn('pll_e', 'Вид активности') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Выберите из списка') }}</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">{{ fn('pll_e', 'Низкая') }}</p> |
||||
<input type="radio" required name="activity" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Средняя') }}</p> |
||||
<input type="radio" required name="activity" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Высокая') }}</p> |
||||
<input type="radio" required name="activity" 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 for="pet_weight" class="label-name">{{ fn('pll_e', 'Вес') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Выберите из списка') }}</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">{{ fn('pll_e', '1-1.5 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '1.5-3 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '3-5 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '5-8 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '8-11 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '11-15 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '10-20кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '20-25кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', '25-35 кг') }}</p> |
||||
<input type="radio" required name="weight" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Более 35 кг') }}</p> |
||||
<input type="radio" required name="weight" 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="rm"> |
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ fn('pll_e', 'Возраст питомца') }}</label> |
||||
<div class="form-input__tabs form-input__remote-control" data-content="modal__age"> |
||||
<label for="age_type_exemplary" class="form-input-tabs__button active" data-rm="0"> |
||||
{{ fn('pll_e', 'Примерный') }} |
||||
<input type="radio" checked value="ex" name="old_type" required id="age_type_exemplary" class="form-input-tabs__input"> |
||||
</label> |
||||
<label for="age_type_accurate" class="form-input-tabs__button" data-rm="1"> |
||||
{{ fn('pll_e', 'Точный') }} |
||||
<input type="radio" value="acc" name="old_type" required id="age_type_accurate" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal__age"> |
||||
<!-- Approximate age selection --> |
||||
<div class="form-input__radio remote-control__item active" data-rmcont="0"> |
||||
<label class="form-input-radio__item active"> |
||||
<input type="radio" name="old" value="baby" checked class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ fn('pll_e', 'Малыш') }} <span>{{ fn('pll_e', '(от 0 до 1 года)') }}</span></p> |
||||
</label> |
||||
<label class="form-input-radio__item"> |
||||
<input type="radio" name="old" value="normal" class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ fn('pll_e', 'Взрослый') }} <span>{{ fn('pll_e', '(от 1 года до 7 лет)') }}</span></p> |
||||
</label> |
||||
<label class="form-input-radio__item"> |
||||
<input type="radio" name="old" value="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">{{ fn('pll_e', 'Пожилой') }} <span>{{ fn('pll_e', '(от 7 до 12 лет)') }}</span></p> |
||||
</label> |
||||
<label class="form-input-radio__item"> |
||||
<input type="radio" name="old" 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">{{ fn('pll_e', 'Стареющий') }} <span>{{ fn('pll_e', '(от 12 лет и старше)') }}</span></p> |
||||
</label> |
||||
</div> |
||||
|
||||
<!-- Exact age selection --> |
||||
<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="pet_day" class="label-name">{{ fn('pll_e', 'День') }}</label> |
||||
<input id="pet_day" class="form__input form__input--center" maxlength="2" type="text" name="day" placeholder="{{ fn('pll_e', 'ДД') }}"> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="pet_month" class="label-name">{{ fn('pll_e', 'Месяц') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Месяц') }}</div> |
||||
<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">{{ fn('pll_e', 'Январь') }}</p> |
||||
<input type="radio" name="month" value="1" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Февраль') }}</p> |
||||
<input type="radio" name="month" value="2" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Март') }}</p> |
||||
<input type="radio" name="month" value="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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Апрель') }}</p> |
||||
<input type="radio" name="month" value="4" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Май') }}</p> |
||||
<input type="radio" name="month" value="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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Июнь') }}</p> |
||||
<input type="radio" name="month" value="6" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Июль') }}</p> |
||||
<input type="radio" name="month" value="7" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Август') }}</p> |
||||
<input type="radio" name="month" value="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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Сентябрь') }}</p> |
||||
<input type="radio" name="month" value="9" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Октябрь') }}</p> |
||||
<input type="radio" name="month" value="10" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Ноябрь') }}</p> |
||||
<input type="radio" name="month" value="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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Декабрь') }}</p> |
||||
<input type="radio" name="month" value="12" 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 for="pet_year" class="label-name">{{ fn('pll_e', 'Год') }}</label> |
||||
<input id="pet_year" class="form__input form__input--center" maxlength="4" type="text" name="year" placeholder="{{ fn('pll_e', 'ГГГГ') }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form__buttons"> |
||||
<button class="button button--gradient button--high button--100-perc" type="submit">{{ fn('pll_e', 'Добавить') }}</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modalProfile" id="subForm"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form modal__notification modal-form--green-gradient modal-form--width-584 form-sub active"> |
||||
<button class="modal-form__close modal-form__close--white"></button> |
||||
<p class="modal-form__title modal-form__title--white">{{ fn('pll_e', 'Подписка на корм') }}</p> |
||||
|
||||
<div class="modal-form__element modal-form__element--top-40"> |
||||
<p class="modal-form__text modal-form__text--white"> |
||||
{{ fn('pll_e', 'Спасибо за интерес к нашему новому виду услуг, данная функция находится в разработке, если вы хотите узнать первыми о запуске подпишитесь на рассылку.') }} |
||||
</p> |
||||
</div> |
||||
|
||||
<form class="modal-form__element modal-form__element--top-40 foodSub"> |
||||
<input type="hidden" name="email" value="{{ user.user_email }}"> |
||||
<input type="hidden" name="action" value="subscription_sub__profile"> |
||||
<button class="button form__button-pc button--white button--100-perc open-overlay button--high"> |
||||
{{ fn('pll_e', 'Хочу попробовать первым!') }} |
||||
</button> |
||||
<button class="button form__button-mobile button--white button--100-perc open-overlay button--high"> |
||||
{{ fn('pll_e', 'Хочу быть первым!') }} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="modalProfile" id="user_edit"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form form__full-mobile modal-form--white modal-form--height-100-phone form-data active"> |
||||
<button class="modal-form__close"></button> |
||||
<p class="modal-form__title">{{ fn('pll_e', 'Изменить мои данные') }}</p> |
||||
|
||||
<form class="modal-form__content user-edit-form" method="post"> |
||||
<input type="hidden" name="action" value="edit_user"> |
||||
<div class="modal-form-content__line modal-form-content__line--two"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="user_firstname" class="label-name">{{ fn('pll_e', 'Имя') }}</label> |
||||
<input id="user_firstname" class="form__input" type="text" value="{{ user.user_firstname }}" name="name" placeholder="{{ fn('pll_e', 'Ваше имя') }}" required> |
||||
<span class="form-input__error form-input__error--absolute">{{ fn('pll_e', 'Имя введено неверно') }}</span> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="user_lastname" class="label-name">{{ fn('pll_e', 'Фамилия') }}</label> |
||||
<input id="user_lastname" class="form__input" type="text" value="{{ user.user_lastname }}" name="l_name" placeholder="{{ fn('pll_e', 'Ваша фамилия') }}" required> |
||||
<span class="form-input__error form-input__error--absolute">{{ fn('pll_e', 'Фамилия введена неверно') }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ fn('pll_e', 'Телефон') }}</label> |
||||
<div class="form-input__phone"> |
||||
<input type="text" placeholder="___ ___ ____" id="user_phone" value="{{ fn('get_user_meta', user.ID, 'billing_phone', true) }}" name="phone" class="form-input-phone__input" required> |
||||
<div class="form-input__error form-input__error--absolute">{{ fn('pll_e', 'Номер введён неверно') }}</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form__buttons modal-form__buttons--two"> |
||||
<button class="button button--gradient button--high" type="submit">{{ fn('pll_e', 'Сохранить') }}</button> |
||||
<input type="reset" class="button button--white open-overlay button--high modal-form__button-close" value="{{ fn('pll_e', 'Отмена') }}"> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,106 @@ |
||||
{% extends 'profile/profile-base.twig' %} |
||||
|
||||
{% block profile_content%} |
||||
<div class="cabinet__orders cabinet-content {% if fn('is_wc_endpoint_url') %}active hide{% endif %}"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title">{{ function('pll_e', 'Feed subscription') }}</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text">{{ function('pll_e', 'Weekly food delivery for your pet') }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn">{{ function('pll_e', 'Get details') }}</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% 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">{{ function('pll_e', 'Order from') }} {{ 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">{{ function('pll_e', 'Summary') }}:</p> |
||||
<p class="cabinet-card-order-payment__price">{{ order.get_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">{{ function('pll_e', 'Delivery address') }}</p> |
||||
<p class="cabinet-card-order-detail-address__text"> |
||||
{% if meta_data.office_code %} |
||||
{{ function('pll_e', 'CDEK shipping point') }}<br> |
||||
{{ 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 ? function('wp_get_attachment_image_url', product.get_image_id(), 'woocommerce_thumbnail') : function('wc_placeholder_img_src', 'woocommerce_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 }} {{ function('get_woocommerce_currency_symbol', code) }}</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"> |
||||
{{ function('pll_e', 'Track order') }} |
||||
</a> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<button class="cabinet-card-order__open-detail">{{ function('pll_e', 'Order details') }}</button> |
||||
</div> |
||||
<div class="cabinet-card-order__detail-short"> |
||||
{% for item in order.get_items %} |
||||
{% set product = item.get_product %} |
||||
{% set thumbnail = product ? function('wp_get_attachment_image_url', product.get_image_id(), 'woocommerce_thumbnail') : function('wc_placeholder_img_src', 'woocommerce_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">{{ function('pll_e', 'No orders yet') }}</p> |
||||
</div> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<a href="/shop/" class="to-know button--100-perc to-know--background-none"> |
||||
<p>{{ function('pll_e', 'Catalog') }}</p> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
@ -0,0 +1,133 @@ |
||||
{% extends 'profile/profile-base.twig' %} |
||||
|
||||
{% block profile_content %} |
||||
|
||||
<div class="cabinet__orders cabinet__orders--no-cab cabinet-content active hide"> |
||||
{% if subscription %} |
||||
<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"> |
||||
{{ fn('pll_e', 'Подписка №') }} {{ subscription.id }} |
||||
</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="subscription"> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Статус') }}</p> |
||||
<p class="subscription__status--end">{{ subscription.status | capitalize }}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Дата подписки') }}</p> |
||||
<p>{{ subscription.date_created | date('d.m.Y') }}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Дата последнего заказа') }}</p> |
||||
<p>{{ subscription.last_order_date | date('d.m.Y') }}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Следующий платеж') }}</p> |
||||
<p>{{ subscription.next_payment_date | date('d.m.Y')}}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Способ оплаты') }}</p> |
||||
<p>{{ subscription.payment_method_title}}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<div class="subscription__add"> |
||||
<div class="subscription__add-header"> |
||||
<p class="subscription__add-title">{{ fn('pll_e', 'Товары:') }}</p> |
||||
</div> |
||||
<div class="subscription__add-content"> |
||||
{% for item in subscription.items %} |
||||
{% set product = item.product %} |
||||
{% set image_id = product.image_id %} |
||||
{% set product_permalink = product.id ? fn('get_permalink', product.id) : '' %} |
||||
{# Debug: Display product ID and permalink for testing #} |
||||
<p class="debug-info" style="display: none;">Product ID: {{ product.id | default('null') }} | Permalink: {{ product_permalink | default('none') }}</p> |
||||
<div class="cabinet-card-order-detail-main__product subscription__add-product"> |
||||
{% if product.id and product_permalink and product_permalink != fn('get_permalink', fn('get_the_ID')) %} |
||||
<a href="{{ product_permalink }}"> |
||||
<img src="{{ image_id | wp_get_attachment_image_src('thumbnail') | default('assets/img/product/mini-card.png') }}" |
||||
alt="{{ product.name }}" |
||||
class="cabinet-card-order-detail-main-product__img"> |
||||
</a> |
||||
{% else %} |
||||
<img src="{{ image_id | wp_get_attachment_image_src('thumbnail') | default('assets/img/product/mini-card.png') }}" |
||||
alt="{{ product.name }}" |
||||
class="cabinet-card-order-detail-main-product__img"> |
||||
{% endif %} |
||||
<div class="cabinet-card-order-detail-main-product__description"> |
||||
<p class="cabinet-card-order-detail-main-product-description__what">{{ product.name }}</p> |
||||
<p class="cabinet-card-order-detail-main-product-description__with-what">{{ product.variation_details | default('') }}</p> |
||||
</div> |
||||
<div class="cabinet-card-order-detail-main-product__content"> |
||||
<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> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Сумма') }}</p> |
||||
<p><span>{{ subscription.total }} {{ subscription.currency }} <small>/ {{ fn('pll_e', 'месяц') }}</small></span></p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Доставка') }}</p> |
||||
<p>{{ fn('pll_e', 'Бесплатно') }}</p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<p>{{ fn('pll_e', 'Итого') }}</p> |
||||
<p><span>{{ subscription.total }} {{ subscription.currency }} <small>/ {{ fn('pll_e', 'месяц') }}</small></span></p> |
||||
</div> |
||||
<div class="subscription__item"> |
||||
<div class="subscription__add"> |
||||
<div class="subscription__add-header"> |
||||
<p class="subscription__add-title">{{ fn('pll_e', 'Доставка:') }}</p> |
||||
</div> |
||||
<div class="subscription__add-content" data-js-tabs=""> |
||||
<form action="" method="post" class="subscription-address-form" data-subscription-id="{{ subscription.id }}"> |
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="delivery_address" class="label-name modal-form-content-line__element--arrow">{{ fn('pll_e', 'Адрес доставки') }}</label> |
||||
<input id="delivery_address" class="form__input form-open" type="text" name="address" value="{{ subscription.shipping_address | striptags | default('') }}" placeholder="{{ fn('pll_e', 'Начните вводить адрес') }}" required data-form="form-data"> |
||||
<span class="form-input__error form-input__error--absolute">{{ fn('pll_e', 'Адрес введен неверно') }}</span> |
||||
</div> |
||||
</div> |
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="delivery_comment" class="label-name">{{ fn('pll_e', 'Комментарий для доставки') }}</label> |
||||
<textarea id="delivery_comment" class="form__input form__input--textarea-72" name="comment" placeholder="{{ fn('pll_e', 'Для службы доставки') }}">{{ subscription.shipping_comment | default('') }}</textarea> |
||||
<span class="form-input__error form-input__error--absolute">{{ fn('pll_e', 'Комментарий введен неверно') }}</span> |
||||
</div> |
||||
</div> |
||||
<input type="hidden" name="subscription_id" value="{{ subscription.id }}"> |
||||
<input type="hidden" name="address_nonce" value="{{ fn('wp_create_nonce', 'update_subscription_address') }}"> |
||||
<div class="modal-form-content__line"> |
||||
<button type="submit" style="width: 100%;" class="button button--gradient button--high-46">{{ fn('pll_e', 'Сохранить') }}</button> |
||||
</div> |
||||
<div class="form-message" style="display: none;"></div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<a href="{{ subscription.cancel_url }}" class="to-know to-know--start button--100-perc to-know--background-none"> |
||||
<p>{{ fn('pll_e', 'Отменить подписку') }}</p> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
{% else %} |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<p>{{ fn('pll_e', 'Подписка не найдена.') }}</p> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
{% endblock %} |
@ -0,0 +1,78 @@ |
||||
{% extends 'profile/profile-base.twig' %} |
||||
|
||||
{% block profile_content %} |
||||
<div class="cabinet__orders cabinet__orders--no-cab cabinet-content active hide"> |
||||
{% for subscription in subscriptions %} |
||||
<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"> |
||||
{% if subscription.view_url %} |
||||
<a href="{{ subscription.view_url }}">{{ fn('pll_e', 'Подписка от') }} {{ subscription.date_created | date('d.m.Y') }}</a> |
||||
{% else %} |
||||
{{ fn('pll_e', 'Подписка от') }} {{ subscription.date_created | date('d.m.Y') }} |
||||
{% endif %} |
||||
</p> |
||||
<p class="cabinet-card-order-main__number"> |
||||
{{ subscription.id }} |
||||
</p> |
||||
</div> |
||||
<div class="cabinet-card-order__payment"> |
||||
<p class="cabinet-card-order-payment__title">{{ fn('pll_e', 'Сумма:') }}</p> |
||||
<p class="cabinet-card-order-payment__price cabinet-card-order-payment__price--add"> |
||||
{{ subscription.total }} {{ subscription.currency }} <span>/ {{ subscription.billing_period }}</span> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="cabinet-card-order__content"> |
||||
<div class="cabinet-card-order__payment-add"> |
||||
<p class="cabinet-card-order__sub-title"> |
||||
{{ fn('pll_e', 'Следующий платеж:') }} |
||||
</p> |
||||
<p class="cabinet-card-order__date"> |
||||
{{ subscription.next_payment_date | date('d.m.Y') }} |
||||
</p> |
||||
</div> |
||||
|
||||
|
||||
</div> |
||||
|
||||
<div class="cabinet-card-order__detail-short mt-m-3"> |
||||
{% for item in subscription.items %} |
||||
{% set product = item.product %} |
||||
{% set image_id = product.image_id %} |
||||
{% if product.permalink %} |
||||
<a href="{{ product.permalink }}"> |
||||
<img src="{{ image_id | wp_get_attachment_image_src('thumbnail') | default('assets/img/product/mini-card.png') }}" |
||||
alt="{{ product.name }}" |
||||
class="cabinet-card-order-detail-short__item"> |
||||
</a> |
||||
{% else %} |
||||
<img src="{{ image_id | wp_get_attachment_image_src('thumbnail') | default('assets/img/product/mini-card.png') }}" |
||||
alt="{{ product.name }}" |
||||
class="cabinet-card-order-detail-short__item"> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</div> |
||||
<div class="cabinet-card-order__link"> |
||||
{% if subscription.view_url %} |
||||
<a href="{{ subscription.view_url }}" class="to-know to-know--start button--100-perc to-know--background-none"> |
||||
<p>{{ fn('pll_e', 'Детали подписки') }}</p> |
||||
</a> |
||||
{% else %} |
||||
<p class="to-know to-know--start button--100-perc to-know--background-none disabled"> |
||||
{{ fn('pll_e', 'Детали недоступны') }} |
||||
</p> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% else %} |
||||
<p>{{ fn('pll_e', 'У вас нет активных подписок.') }}</p> |
||||
{% endfor %} |
||||
</div> |
||||
{% endblock %} |
@ -0,0 +1,414 @@ |
||||
{% set profile_pg = 1 %} |
||||
|
||||
{% extends 'profile/profile-base.twig' %} |
||||
|
||||
{% block profile_content%} |
||||
<div class="cabinet__orders cabinet-content {% if fn('is_wc_endpoint_url') %}active hide{% endif %}"> |
||||
<div class="cabinet-card cabinet-card--green-white cabinet__subscription-pc"> |
||||
<div class="cabinet-card__content"> |
||||
<p class="cabinet-card__title">{{ function('pll_e', 'Feed subscription') }}</p> |
||||
<div class="cabinet-card__element"> |
||||
<p class="cabinet-card__text">{{ function('pll_e', 'Weekly food delivery for your pet') }}</p> |
||||
</div> |
||||
<div class="cabinet-card__element"> |
||||
<button class="button button--gradient button--high-46 form-sub__btn">{{ function('pll_e', 'Get details') }}</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% 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">{{ function('pll_e', 'Order from') }} {{ 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">{{ function('pll_e', 'Summary') }}:</p> |
||||
<p class="cabinet-card-order-payment__price">{{ order.get_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">{{ function('pll_e', 'Delivery address') }}</p> |
||||
<p class="cabinet-card-order-detail-address__text"> |
||||
{% if meta_data.office_code %} |
||||
{{ function('pll_e', 'CDEK shipping point') }}<br> |
||||
{{ 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 ? function('wp_get_attachment_image_url', product.get_image_id(), 'woocommerce_thumbnail') : function('wc_placeholder_img_src', 'woocommerce_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 }} {{ function('get_woocommerce_currency_symbol', code) }}</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"> |
||||
{{ function('pll_e', 'Track order') }} |
||||
</a> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<button class="cabinet-card-order__open-detail">{{ function('pll_e', 'Order details') }}</button> |
||||
</div> |
||||
<div class="cabinet-card-order__detail-short"> |
||||
{% for item in order.get_items %} |
||||
{% set product = item.get_product %} |
||||
{% set thumbnail = product ? function('wp_get_attachment_image_url', product.get_image_id(), 'woocommerce_thumbnail') : function('wc_placeholder_img_src', 'woocommerce_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">{{ function('pll_e', 'No orders yet') }}</p> |
||||
</div> |
||||
<div class="cabinet-card-no-orders__element"> |
||||
<a href="/shop/" class="to-know button--100-perc to-know--background-none"> |
||||
<p>{{ function('pll_e', 'Catalog') }}</p> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
|
||||
{% endblock %} |
||||
|
||||
</main> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modalProfile" id="pet_add_form"> |
||||
<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">{{ fn('pll_e', 'Добавить питомца') }}</p> |
||||
|
||||
<form class="modal-form__content" id="add-pet-form" method="post" action=""> |
||||
<input type="hidden" name="action" value="add_pet"> |
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Вид животного') }}</label> |
||||
<div class="form-input__tabs"> |
||||
<label for="cat" class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Кошка') }} |
||||
<input type="radio" value="cat" checked name="pet" id="cat" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label for="dog" class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Собака') }} |
||||
<input type="radio" value="dog" name="pet" id="dog" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line sterilized"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Стерелизован') }}</label> |
||||
|
||||
<div class="form-input__tabs"> |
||||
<label class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Да') }} |
||||
<input type="radio" value="1" checked name="sterilized" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Нет') }} |
||||
<input type="radio" value="0" 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">{{ fn('pll_e', 'Имя') }}</label> |
||||
<input id="firstname" class="form__input" type="text" name="name" placeholder="{{ fn('pll_e', 'Имя питомца') }}" required> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ fn('pll_e', 'Порода') }}</label> |
||||
<input id="firstname" class="form__input" type="text" name="breed" placeholder="{{ fn('pll_e', 'Порода вашего питомца') }}" required> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label for="" class="label-name">{{ fn('pll_e', 'Пол вашего питомца') }}</label> |
||||
|
||||
<div class="form-input__tabs"> |
||||
<label for="boy" class="form-input-tabs__button active"> |
||||
{{ fn('pll_e', 'Мальчик') }} |
||||
<input type="radio" value="male" checked name="sex" id="boy" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label for="girl" class="form-input-tabs__button"> |
||||
{{ fn('pll_e', 'Девочка') }} |
||||
<input type="radio" value="female" name="sex" id="girl" 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">{{ fn('pll_e', 'Вид активности') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Выберите из списка') }}</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">{{ fn('pll_e', 'Низкая') }}</p> |
||||
<input type="radio" required name="activity" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Средняя') }}</p> |
||||
<input type="radio" required name="activity" 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"> |
||||
<p class="form-input-list-item__text">{{ fn('pll_e', 'Высокая') }}</p> |
||||
<input type="radio" required name="activity" 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 for="firstname" class="label-name">{{ fn('pll_e', 'Вес') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Выберите из списка') }}</div> |
||||
<div class="form-input-list__block-content" style="height: 0px;"> |
||||
<div class="form-input-list__content"> |
||||
{% for weight in [ |
||||
{value: 'below_1_5', text: fn('pll_e', '1-1.5 кг')}, |
||||
{value: '1_5-3', text: fn('pll_e', '1.5-3 кг')}, |
||||
{value: '3-5', text: fn('pll_e', '3-5 кг')}, |
||||
{value: '5-8', text: fn('pll_e', '5-8 кг')}, |
||||
{value: '8-11', text: fn('pll_e', '8-11 кг')}, |
||||
{value: '11-15', text: fn('pll_e', '11-15 кг')}, |
||||
{value: '15-20', text: fn('pll_e', '10-20кг')}, |
||||
{value: '20-25', text: fn('pll_e', '20-25кг')}, |
||||
{value: '25-35', text: fn('pll_e', '25-35 кг')}, |
||||
{value: 'more_35', text: fn('pll_e', 'Более 35 кг')} |
||||
] %} |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">{{ weight.text }}</p> |
||||
<input type="radio" required name="weight" value="{{ weight.value }}" 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> |
||||
|
||||
<div class="rm"> |
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">{{ fn('pll_e', 'Возраст питомца') }}</label> |
||||
<div class="form-input__tabs form-input__remote-control" data-content="modal__age"> |
||||
<label for="exemplary" class="form-input-tabs__button active" data-rm="0"> |
||||
{{ fn('pll_e', 'Примерный') }} |
||||
<input type="radio" checked value="ex" name="old_type" required id="exemplary" class="form-input-tabs__input"> |
||||
</label> |
||||
|
||||
<label class="form-input-tabs__button" data-rm="1"> |
||||
{{ fn('pll_e', 'Точный') }} |
||||
<input type="radio" value="acc" name="old_type" required id="accurate" class="form-input-tabs__input"> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal__age"> |
||||
<div class="form-input__radio remote-control__item active" data-rmcont="0"> |
||||
{% for age in [ |
||||
{value: 'baby', title: fn('pll_e', 'Малыш'), desc: fn('pll_e', '(от 0 до 1 года)')}, |
||||
{value: 'normal', title: fn('pll_e', 'Взрослый'), desc: fn('pll_e', '(от 1 года до 7 лет)')}, |
||||
{value: 'old', title: fn('pll_e', 'Пожилой'), desc: fn('pll_e', '(от 7 до 12 лет)')}, |
||||
{value: 'very_old', title: fn('pll_e', 'Стареющий'), desc: fn('pll_e', '(от 12 лет и старше)')} |
||||
] %} |
||||
<label class="form-input-radio__item {{ loop.first ? 'active' : '' }}"> |
||||
<input type="radio" name="old" value="{{ age.value }}" {{ loop.first ? 'checked' : '' }} class="v-hidden"> |
||||
<div class="form-input-radio__circle"> |
||||
<div class="form-input-radio-circle__content"></div> |
||||
</div> |
||||
<p class="form-input-radio__title">{{ age.title }} <span>{{ age.desc }}</span></p> |
||||
</label> |
||||
{% endfor %} |
||||
</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">{{ fn('pll_e', 'День') }}</label> |
||||
<input id="firstname" class="form__input form__input--center" maxlength="2" type="text" name="day" placeholder="{{ fn('pll_e', 'ДД') }}"> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">{{ fn('pll_e', 'Месяц') }}</label> |
||||
<div class="form-input__list"> |
||||
<div class="form-input-list__input">{{ fn('pll_e', 'Месяц') }}</div> |
||||
<div class="form-input-list__block-content"> |
||||
<div class="form-input-list__content"> |
||||
{% for month in [ |
||||
{value: 1, text: fn('pll_e', 'Январь')}, |
||||
{value: 2, text: fn('pll_e', 'Февраль')}, |
||||
{value: 3, text: fn('pll_e', 'Март')}, |
||||
{value: 4, text: fn('pll_e', 'Апрель')}, |
||||
{value: 5, text: fn('pll_e', 'Май')}, |
||||
{value: 6, text: fn('pll_e', 'Июнь')}, |
||||
{value: 7, text: fn('pll_e', 'Июль')}, |
||||
{value: 8, text: fn('pll_e', 'Август')}, |
||||
{value: 9, text: fn('pll_e', 'Сентябрь')}, |
||||
{value: 10, text: fn('pll_e', 'Октябрь')}, |
||||
{value: 11, text: fn('pll_e', 'Ноябрь')}, |
||||
{value: 12, text: fn('pll_e', 'Декабрь')} |
||||
] %} |
||||
<label class="form-input-list__item"> |
||||
<p class="form-input-list-item__text">{{ month.text }}</p> |
||||
<input type="radio" name="month" value="{{ month.value }}" 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">{{ fn('pll_e', 'Год') }}</label> |
||||
<input id="firstname" class="form__input form__input--center" maxlength="4" type="text" name="year" placeholder="{{ fn('pll_e', 'ГГГГ') }}"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form__buttons"> |
||||
<button class="button button--gradient button--high button--100-perc" type="submit">{{ fn('pll_e', 'Добавить') }}</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modalProfile" id="subForm"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form modal__notification modal-form--green-gradient modal-form--width-584 form-sub active"> |
||||
<button class="modal-form__close modal-form__close--white"></button> |
||||
<p class="modal-form__title modal-form__title--white">Подписка на корм</p> |
||||
|
||||
<div class="modal-form__element modal-form__element--top-40"> |
||||
<p class="modal-form__text modal-form__text--white"> |
||||
Спасибо за интерес к нашему новому виду услуг, данная функция находится в разработке, если вы хотите узнать первыми о запуске подпишитесь на рассылку. |
||||
</p> |
||||
</div> |
||||
|
||||
<form class="modal-form__element modal-form__element--top-40 foodSub"> |
||||
<input type="hidden" name="email" value="{{ user.user_email }}"> |
||||
<input type="hidden" name="action" value="subscription_sub__profile"> |
||||
<button class="button form__button-pc button--white button--100-perc open-overlay button--high"> |
||||
Хочу попробовать первым! |
||||
</button> |
||||
<button class="button form__button-mobile button--white button--100-perc open-overlay button--high"> |
||||
Хочу быть первым! |
||||
</button> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modalProfile" id="user_edit"> |
||||
<div class="popup-wrap"> |
||||
<div class="modal-form form__full-mobile modal-form--white modal-form--height-100-phone form-data active"> |
||||
<button class="modal-form__close"></button> |
||||
<p class="modal-form__title">Изменить мои данные</p> |
||||
|
||||
<form class="modal-form__content user-edit-form" method="post"> |
||||
<input type="hidden" name="action" value="edit_user"> |
||||
<div class="modal-form-content__line modal-form-content__line--two"> |
||||
<div class="modal-form-content-line__element"> |
||||
<label for="firstname" class="label-name">Имя</label> |
||||
<input id="firstname" class="form__input" type="text" value="{{ user.user_firstname }}" name="name" placeholder="Ваше имя" required> |
||||
<span class="form-input__error form-input__error--absolute">Имя введено неверно</span> |
||||
</div> |
||||
|
||||
<div class="modal-form-content-line__element"> |
||||
<label for="lastname" class="label-name">Фамилия</label> |
||||
<input id="lastname" class="form__input" type="text" value="{{ user.user_lastname }}" name="l_name" placeholder="Ваша фамилия" required> |
||||
<span class="form-input__error form-input__error--absolute">Фамилия введена неверно</span> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form-content__line"> |
||||
<label class="label-name">Телефон</label> |
||||
<div class="form-input__phone"> |
||||
<input type="text" placeholder="___ ___ ____" id="tel-phone" value="{{ fn('get_user_meta', user.ID, 'billing_phone', true) }}" name="phone" class="form-input-phone__input" required> |
||||
<div class="form-input__error form-input__error--absolute">Номер введён неверно</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="modal-form__buttons modal-form__buttons--two"> |
||||
<button class="button button--gradient button--high" type="submit">Сохранить</button> |
||||
<input type="reset" class="button button--white open-overlay button--high modal-form__button-close" value="Отмена"> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
@ -0,0 +1,502 @@ |
||||
<?php |
||||
/* |
||||
Template Name: Where to byu |
||||
Template Post Type: page |
||||
*/ |
||||
|
||||
wp_enqueue_style( 'gp-wtb-style', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-core.css?v=1.14' ); |
||||
wp_enqueue_style( 'gp-wtb-style-dt', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-desktop.css?v=1.22' ); |
||||
wp_enqueue_style( 'gp-wtb-style-tb', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-tablet.css?v=1.22' ); |
||||
wp_enqueue_style( 'gp-wtb-style-mb', get_template_directory_uri() . '/gp-include/assets/where-to-buy/css/gp-style-mobile?v=1.122' ); |
||||
|
||||
get_header('gp_eng'); |
||||
// wp_head(); |
||||
add_filter('wpcf7_autop_or_not', '__return_false'); |
||||
?> |
||||
|
||||
<div class="body-wrap"> |
||||
|
||||
<main class="wrapper" style="padding-top: 0;"> |
||||
|
||||
<!-- Where home --> |
||||
<section class="where-home"> |
||||
<div class="container"> |
||||
<h1>Where to Buy</h1> |
||||
<p>Looking for Cosmopet products in stores? You can find our premium pet treats in select pet shops and retail stores across the UAE.</p> |
||||
</div> |
||||
</section> |
||||
<!-- Where home end --> |
||||
<div class="container"> |
||||
<?php |
||||
// Get marker data from ACF |
||||
$locations = get_field('location_markers'); |
||||
?> |
||||
|
||||
<div class="locations-map-container"> |
||||
<div id="map" style="width: 100%; height: 600px; border-radius: 20px; overflow: hidden;"></div> |
||||
</div> |
||||
|
||||
<script> |
||||
// Array of locations with predefined coordinates |
||||
const locationData = [ |
||||
{ |
||||
title: "Roots Supermarket", |
||||
address: "Waves Grande, Retail unit 1-2 Shobha Hartland, Dubai DU United Arab Emirates", |
||||
position: { lat: 25.1896, lng: 55.3662 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Pawdy Neighbors", |
||||
address: "Souk Al Manzil - Old Town Downtown, Dubai, United Arab Emirates", |
||||
position: { lat: 25.1915, lng: 55.2758 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "The Pet Co", |
||||
address: "Tower A, Shop 01, Prime Business Centre, JVC, Dubai, UAE", |
||||
position: { lat: 25.0580, lng: 55.2282 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Ivy Secret Garden", |
||||
address: "Al Wasl Warehouse Complex, Unit 14 - 26th St - Al Quoz Industrial Area 4 - Dubai", |
||||
position: { lat: 25.1416, lng: 55.2358 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Petzone", |
||||
address: "Petzone Sheikh Zayed Road - Petzone Umm Suqeim", |
||||
position: { lat: 25.1530, lng: 55.2145 }, |
||||
url: "https://petzone.com/uae/en/" |
||||
}, |
||||
{ |
||||
title: "Pet Corner", |
||||
address: "Pet Corner Sheikh Zayed Road, Al Fardan Building 1, Sheikh Zayed Road, Next to Deals on Wheels & Business Bay Metro Station", |
||||
position: { lat: 25.1868, lng: 55.2527 }, |
||||
url: "https://petcornerdubai.com/" |
||||
}, |
||||
{ |
||||
title: "Pet Corner Motor City - Dubai", |
||||
address: "Unit R7, Fox Hill 8, Motor City, Opposite Arabian Ranches", |
||||
position: { lat: 25.0499, lng: 55.2350 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Pet Corner Jumeirah Golf Estates - Dubai", |
||||
address: "Shop No. 7, The Fairway Mall Jumeirah Golf Estates Dubai", |
||||
position: { lat: 25.0394, lng: 55.2269 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Pet Corner Khalifa City - Abu Dhabi", |
||||
address: "Shop No 5, Al Raha Gardens, Khalifa City Abu Dhabi", |
||||
position: { lat: 24.4243, lng: 54.5754 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Pet Corner- Sharjah Al Mamsha", |
||||
address: "Al Sharjah, University Road", |
||||
position: { lat: 25.3126, lng: 55.4783 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Pet Corner Fujairah- Lulu Mall", |
||||
address: "Al - Korthabah Road - Fujairah City Center - Fujairah", |
||||
position: { lat: 25.1221, lng: 56.3244 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Tail Waggin Al Quoz", |
||||
address: "Warehouse 7, Street 8, Al Khail Road, Al Quoz 1, Dubai, United Arab Emirates", |
||||
position: { lat: 25.1368, lng: 55.2364 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Tail Waggin' Pet Spa Dubai Hills", |
||||
address: "SWAY Residences, Retail 2 - near Kings College Hospital Dubai Hills Estate - Dubai - United Arab Emirates", |
||||
position: { lat: 25.1276, lng: 55.2714 }, |
||||
url: '' |
||||
}, |
||||
{ |
||||
title: "Goofy Groom", |
||||
address: "Dubai, UAE Midtown Central Majan, Shop G-17", |
||||
position: { lat: 25.0834, lng: 55.1743 }, |
||||
url: '' |
||||
} |
||||
]; |
||||
|
||||
// Get data from ACF with added latitude and longitude fields |
||||
const acfLocations = <?php
|
||||
if ($locations && !empty($locations)) { |
||||
echo json_encode(array_map(function($location) { |
||||
return [ |
||||
'title' => $location['title'], |
||||
'address' => $location['address'], |
||||
'url' => $location['website'], |
||||
'latitude' => isset($location['latitude']) ? (float)$location['latitude'] : null, |
||||
'longitude' => isset($location['longitude']) ? (float)$location['longitude'] : null |
||||
]; |
||||
}, $locations)); |
||||
} else { |
||||
echo 'null'; |
||||
} |
||||
?>; |
||||
|
||||
// Map initialization function |
||||
function initMap() { |
||||
console.log("Map is initializing"); |
||||
|
||||
// Map center - approximately Dubai center |
||||
const dubai = { lat: 25.2048, lng: 55.2708 }; |
||||
|
||||
// Create map |
||||
const map = new google.maps.Map(document.getElementById("map"), { |
||||
zoom: 11, |
||||
center: dubai, |
||||
styles: [ |
||||
{ |
||||
"featureType": "water", |
||||
"elementType": "geometry", |
||||
"stylers": [ |
||||
{ |
||||
"color": "#93d5eb" |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
"featureType": "landscape", |
||||
"elementType": "geometry", |
||||
"stylers": [ |
||||
{ |
||||
"color": "#f5f5f5" |
||||
} |
||||
] |
||||
} |
||||
] |
||||
}); |
||||
|
||||
// Info window for markers |
||||
const infoWindow = new google.maps.InfoWindow(); |
||||
|
||||
// If ACF data exists, use it for markers |
||||
if (acfLocations && acfLocations.length > 0) { |
||||
console.log("Using ACF data:", acfLocations.length, "locations"); |
||||
|
||||
const geocoder = new google.maps.Geocoder(); |
||||
|
||||
// Create and place markers |
||||
acfLocations.forEach((location, i) => { |
||||
// Check if we have manual coordinates |
||||
if (location.latitude && location.longitude) { |
||||
console.log(`Using manual coordinates for: ${location.title}`); |
||||
const position = { lat: location.latitude, lng: location.longitude }; |
||||
createMarker(location, position, map, infoWindow); |
||||
} else { |
||||
// No coordinates provided, try geocoding |
||||
console.log(`Geocoding address: ${location.address}`); |
||||
|
||||
geocoder.geocode({ address: location.address }, (results, status) => { |
||||
if (status === "OK") { |
||||
console.log(`Geocoding successful for: ${location.title}`); |
||||
createMarker(location, results[0].geometry.location, map, infoWindow); |
||||
} else { |
||||
console.error(`Geocode failed for address: ${location.address}. Reason: ${status}`); |
||||
|
||||
// If geocoding fails, try to find matching location in predefined data |
||||
const predefinedLocation = locationData.find(item => |
||||
item.title.toLowerCase() === location.title.toLowerCase() || |
||||
item.address.toLowerCase().includes(location.address.toLowerCase()) |
||||
); |
||||
|
||||
if (predefinedLocation) { |
||||
console.log(`Using predefined coordinates for: ${location.title}`); |
||||
createMarker(location, predefinedLocation.position, map, infoWindow); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}); |
||||
} else { |
||||
// Use predefined data |
||||
console.log("Using predefined data:", locationData.length, "locations"); |
||||
|
||||
locationData.forEach((location) => { |
||||
createMarker(location, location.position, map, infoWindow); |
||||
}); |
||||
} |
||||
|
||||
// Marker creation function |
||||
function createMarker(location, position, map, infoWindow) { |
||||
// Create marker |
||||
const marker = new google.maps.Marker({ |
||||
map: map, |
||||
position: position, |
||||
animation: google.maps.Animation.DROP, |
||||
icon: { |
||||
url: 'https://maps.google.com/mapfiles/ms/icons/blue-dot.png' |
||||
} |
||||
}); |
||||
|
||||
// Add click event handler for marker |
||||
marker.addListener("click", () => { |
||||
let content = `<div><h3>${location.title}</h3><p>${location.address}</p>`; |
||||
|
||||
if (location.url) { |
||||
content += `<p><a href="${location.url}" target="_blank">Visit website</a></p>`; |
||||
} |
||||
|
||||
content += `</div>`; |
||||
|
||||
infoWindow.setContent(content); |
||||
infoWindow.open(map, marker); |
||||
}); |
||||
|
||||
// Add slight delay for animation |
||||
setTimeout(() => { |
||||
marker.setAnimation(null); |
||||
}, 750); |
||||
} |
||||
} |
||||
|
||||
// Check if Google Maps API is loaded |
||||
window.addEventListener('load', function() { |
||||
if (typeof google === 'undefined' || typeof google.maps === 'undefined') { |
||||
console.error('Google Maps API failed to load'); |
||||
document.getElementById('map').innerHTML = '<div style="padding: 20px; text-align: center;">Map loading error. Please check your internet connection and refresh the page.</div>'; |
||||
} else { |
||||
console.log('Google Maps API loaded successfully'); |
||||
} |
||||
}); |
||||
</script> |
||||
|
||||
<!-- Google Maps API connection with your key --> |
||||
<script async defer |
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDQVXQyGsqWmUdJ84UgKOPymFlISaKoiuw&callback=initMap&libraries=places"> |
||||
</script> |
||||
</div> |
||||
<br><br> |
||||
<!-- Find us --> |
||||
<section class="find-us"> |
||||
<div class="container"> |
||||
<h2>📍 Find us at:</h2> |
||||
<ul> |
||||
<?php |
||||
$items = get_field('location_markers'); |
||||
foreach($items as $item): |
||||
?> |
||||
<li> |
||||
<h3> |
||||
<?php if($item['website']): ?> |
||||
<a href="<?php echo $item['website'];?>"><?php echo $item['title'];?></a>
|
||||
<?php endif; ?> |
||||
<?php if(!$item['website']): ?> |
||||
<?php echo $item['title'];?> |
||||
<?php endif; ?> |
||||
</h3> |
||||
<p><?php echo $item['address'];?></p>
|
||||
</li> |
||||
<?php endforeach; ?> |
||||
</ul> |
||||
</div> |
||||
</section> |
||||
<!-- Find us end --> |
||||
|
||||
|
||||
<style> |
||||
.sell-form-form:not(.submited) + .thx-text{ |
||||
display:none; |
||||
} |
||||
.sell-form-form.submited{ |
||||
display:none; |
||||
} |
||||
</style> |
||||
<!-- Sell form --> |
||||
|
||||
<div class="container"> |
||||
<?php |
||||
// Получаем изображения из галереи ACF |
||||
$images = get_field('partners_logos'); |
||||
if ($images): ?> |
||||
<!-- Бегущая строка (слайдер) --> |
||||
<div class="partners-slider-section"> |
||||
<h3 style="font-size:36px;">Our partners</h3> |
||||
<div class="partners-swiper swiper"> |
||||
<div class="swiper-wrapper"> |
||||
<?php
|
||||
// Повторяем логотипы больше раз для создания эффекта бесконечности |
||||
for ($i = 0; $i < 5; $i++) { |
||||
foreach($images as $image): ?> |
||||
<div class="swiper-slide"> |
||||
<a href="<?php echo esc_url($image['title']); ?>" target="_blank">
|
||||
<img src="<?php echo esc_url($image['sizes']['medium']); ?>" alt="<?php echo esc_attr($image['alt']); ?>">
|
||||
</a> |
||||
</div> |
||||
<?php endforeach;
|
||||
} ?> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
document.addEventListener('DOMContentLoaded', function() { |
||||
const swiper = new Swiper('.partners-swiper', { |
||||
slidesPerView: 'auto', |
||||
spaceBetween: 30, |
||||
loop: true, |
||||
loopedSlides: 999, |
||||
loopAdditionalSlides: 999, |
||||
centeredSlides: false, |
||||
autoplay: { |
||||
delay: 1, // Почти нулевая задержка |
||||
disableOnInteraction: false, // Автоплей не отключается при взаимодействии |
||||
}, |
||||
speed: 8000, // Медленная скорость для плавности |
||||
allowTouchMove: false, // Отключаем свайп вручную |
||||
freeMode: false, // Свободный скроллинг |
||||
cssMode: false, |
||||
watchSlidesProgress: true, |
||||
simulateTouch: false, |
||||
observer: true, |
||||
observeParents: true, |
||||
resistanceRatio: 0, |
||||
breakpoints: { |
||||
320: { |
||||
slidesPerView: 2, |
||||
}, |
||||
768: { |
||||
slidesPerView: 4, |
||||
}, |
||||
1024: { |
||||
slidesPerView: 5, |
||||
} |
||||
} |
||||
}); |
||||
|
||||
// Принудительно перезапускаем автоплей после касания |
||||
swiper.el.addEventListener('touchend', function() { |
||||
if (!swiper.autoplay.running) { |
||||
swiper.autoplay.start(); // Перезапускаем автоплей, если он остановлен |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
<style> |
||||
/* Стили для слайдера */ |
||||
.partners-slider-section, |
||||
.partners-grid-section { |
||||
margin: 50px 0; |
||||
} |
||||
.partners-slider-section { |
||||
overflow: hidden; /* Скрываем переполнение */ |
||||
} |
||||
.partners-swiper { |
||||
width: 100%; |
||||
padding: 20px 0; |
||||
} |
||||
.swiper-slide { |
||||
text-align: center; |
||||
height: auto; |
||||
width: auto !important; /* Позволяем слайдам быть разной ширины */ |
||||
} |
||||
.swiper-slide img { |
||||
max-height: 60px; |
||||
width: auto; |
||||
filter: grayscale(100%); |
||||
transition: filter 0.3s; |
||||
object-fit: contain; |
||||
} |
||||
.swiper-slide img:hover { |
||||
filter: grayscale(0%); |
||||
} |
||||
/* Убираем анимацию трансформации для устранения рывков */ |
||||
.swiper-wrapper { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100px; |
||||
z-index: 1; |
||||
display: flex; |
||||
box-sizing: content-box; |
||||
transition-timing-function: linear !important; |
||||
} |
||||
/* Стили для плиток */ |
||||
.partners-grid { |
||||
display: grid; |
||||
grid-template-columns: repeat(4, 1fr); |
||||
gap: 20px; |
||||
} |
||||
.grid-item { |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
padding: 20px; |
||||
/* border: 1px solid #eee; */ |
||||
border-radius: 24px; |
||||
transition: 0.3s; |
||||
} |
||||
.grid-item:hover { |
||||
box-shadow: 0 10px 20px rgba(0,0,0,0.1); |
||||
} |
||||
.grid-item img { |
||||
max-height: 60px; |
||||
max-width: 100%; |
||||
filter: grayscale(100%); |
||||
transition: filter 0.3s; |
||||
} |
||||
.grid-item img:hover { |
||||
filter: grayscale(0%); |
||||
} |
||||
h3 { |
||||
font-size: 26px; |
||||
color: #fff; |
||||
text-transform: uppercase; |
||||
font-weight: bold; |
||||
} |
||||
@media (max-width: 768px) { |
||||
.partners-grid { |
||||
grid-template-columns: repeat(2, 1fr); |
||||
} |
||||
.grid-item { |
||||
width: 80%; |
||||
margin: 0 auto; |
||||
} |
||||
} |
||||
@media (max-width: 480px) { |
||||
.partners-grid { |
||||
grid-template-columns: 1fr; |
||||
} |
||||
} |
||||
</style> |
||||
<?php endif; ?> |
||||
</div> |
||||
|
||||
<section class="sell-form"> |
||||
<div class="container sell-form__container"> |
||||
|
||||
<h2>Want to sell Cosmopet in your store?</h2> |
||||
<p>Join our growing network of retailers! Fill out the contact form below, and we’ll get in touch to discuss the details.</p> |
||||
<form action="" class="form--contact sell-form-form"> |
||||
|
||||
<input type="hidden" name="action" value="message" > |
||||
<input type="text" placeholder="Your Name" name="name" class="form-inp"> |
||||
<input type="tel" placeholder="Your Phone" name="phone" class="form-inp" id=""> |
||||
<input type="email" placeholder="E-mail" name="email" class="form-inp" id=""> |
||||
<textarea placeholder="Message" class="form-textarea" name="msg" id=""></textarea> |
||||
<button type="submit">SUBMIT</button> |
||||
|
||||
|
||||
</form> |
||||
<div class="thx-text"> |
||||
<h2>Thanks for request!</h2> |
||||
<p>We will answer your message as soon as possible</p> |
||||
|
||||
</div> |
||||
|
||||
|
||||
|
||||
</div> |
||||
</section> |
||||
<!-- Sell form end --> |
||||
|
||||
</main> |
||||
</div> |
||||
|
||||
<?php get_footer('gp_eng'); ?> |
@ -1,19 +1,46 @@ |
||||
<?php |
||||
/** |
||||
* Checkout Form |
||||
* Checkout Order Receipt Template |
||||
* |
||||
* @see https://docs.woocommerce.com/document/template-structure/ |
||||
* @package WooCommerce/Templates |
||||
* @version 3.5.0 |
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/order-receipt.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 3.2.0 |
||||
*/ |
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) { |
||||
exit; |
||||
} |
||||
?> |
||||
|
||||
// Get Timber context |
||||
$context = Timber::context(); |
||||
<ul class="order_details"> |
||||
<li class="order"> |
||||
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?> |
||||
<strong><?php echo esc_html( $order->get_order_number() ); ?></strong>
|
||||
</li> |
||||
<li class="date"> |
||||
<?php esc_html_e( 'Date:', 'woocommerce' ); ?> |
||||
<strong><?php echo esc_html( wc_format_datetime( $order->get_date_created() ) ); ?></strong>
|
||||
</li> |
||||
<li class="total"> |
||||
<?php esc_html_e( 'Total:', 'woocommerce' ); ?> |
||||
<strong><?php echo wp_kses_post( $order->get_formatted_order_total() ); ?></strong>
|
||||
</li> |
||||
<?php if ( $order->get_payment_method_title() ) : ?> |
||||
<li class="method"> |
||||
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?> |
||||
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
|
||||
</li> |
||||
<?php endif; ?> |
||||
</ul> |
||||
|
||||
<?php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order->get_id() ); ?> |
||||
|
||||
// Render the Twig template |
||||
Timber::render('shop/review-order.twig', $context); |
||||
<div class="clear"></div> |
||||
|
@ -1,90 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* Thankyou page |
||||
* |
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.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 8.1.0 |
||||
* |
||||
* @var WC_Order $order |
||||
*/ |
||||
|
||||
defined( 'ABSPATH' ) || exit; |
||||
?> |
||||
|
||||
<div class="woocommerce-order"> |
||||
|
||||
<?php |
||||
if ( $order ) : |
||||
|
||||
do_action( 'woocommerce_before_thankyou', $order->get_id() ); |
||||
?> |
||||
|
||||
<?php if ( $order->has_status( 'failed' ) ) : ?> |
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> |
||||
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
|
||||
<?php if ( is_user_logged_in() ) : ?> |
||||
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?> |
||||
</p> |
||||
|
||||
<?php else : ?> |
||||
|
||||
<?php wc_get_template( 'checkout/order-received.php', array( 'order' => $order ) ); ?> |
||||
|
||||
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details"> |
||||
|
||||
<li class="woocommerce-order-overview__order order"> |
||||
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<li class="woocommerce-order-overview__date date"> |
||||
<?php esc_html_e( 'Date:', 'woocommerce' ); ?> |
||||
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?> |
||||
<li class="woocommerce-order-overview__email email"> |
||||
<?php esc_html_e( 'Email:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
<?php endif; ?> |
||||
|
||||
<li class="woocommerce-order-overview__total total"> |
||||
<?php esc_html_e( 'Total:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<?php if ( $order->get_payment_method_title() ) : ?> |
||||
<li class="woocommerce-order-overview__payment-method method"> |
||||
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?> |
||||
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
|
||||
</li> |
||||
<?php endif; ?> |
||||
|
||||
</ul> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> |
||||
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> |
||||
|
||||
<?php else : ?> |
||||
|
||||
<?php wc_get_template( 'checkout/order-received.php', array( 'order' => false ) ); ?> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
</div> |
@ -1,108 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* Thankyou page |
||||
* |
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.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://docs.woocommerce.com/document/template-structure/ |
||||
* @package WooCommerce/Templates |
||||
* @version 3.7.0 |
||||
*/ |
||||
|
||||
defined( 'ABSPATH' ) || exit; |
||||
|
||||
$wrapper_classes = ''; |
||||
|
||||
if ( woodmart_get_opt( 'thank_you_page_extra_content' ) ) { |
||||
$wrapper_classes .= ' wd-with-extra-content'; |
||||
} |
||||
|
||||
?> |
||||
|
||||
<div class="woocommerce-order<?php echo esc_attr( $wrapper_classes ); ?>">
|
||||
|
||||
<?php if ( $order ) : ?> |
||||
|
||||
<?php do_action( 'woocommerce_before_thankyou', $order->get_id() ); ?> |
||||
|
||||
<?php if ( $order->has_status( 'failed' ) ) : ?> |
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> |
||||
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
|
||||
<?php if ( is_user_logged_in() ) : ?> |
||||
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?> |
||||
</p> |
||||
|
||||
<?php else : ?> |
||||
<?php if ( woodmart_get_opt( 'thank_you_page_extra_content' ) || woodmart_get_opt( 'thank_you_page_html_block' ) ) : ?> |
||||
<div class="wd-order-extra-content"> |
||||
<?php if ( 'text' === woodmart_get_opt( 'thank_you_page_content_type', 'text' ) ) : ?> |
||||
<?php echo do_shortcode( woodmart_get_opt( 'thank_you_page_extra_content' ) ); ?> |
||||
<?php else : ?> |
||||
<?php echo woodmart_get_html_block( woodmart_get_opt( 'thank_you_page_html_block' ) ); ?> |
||||
<?php endif; ?> |
||||
</div> |
||||
<?php endif; ?> |
||||
|
||||
<?php if ( woodmart_get_opt( 'thank_you_page_default_content' ) ) : ?> |
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
|
||||
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details"> |
||||
|
||||
<li class="woocommerce-order-overview__order order"> |
||||
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<li class="woocommerce-order-overview__date date"> |
||||
<?php esc_html_e( 'Date:', 'woocommerce' ); ?> |
||||
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?> |
||||
<li class="woocommerce-order-overview__email email"> |
||||
<?php esc_html_e( 'Email:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
<?php endif; ?> |
||||
|
||||
<li class="woocommerce-order-overview__total total"> |
||||
<?php esc_html_e( 'Total:', 'woocommerce' ); ?> |
||||
<strong><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li> |
||||
|
||||
<?php if ( $order->get_payment_method_title() ) : ?> |
||||
<li class="woocommerce-order-overview__payment-method method"> |
||||
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?> |
||||
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
|
||||
</li> |
||||
<?php endif; ?> |
||||
|
||||
</ul> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<?php endif; ?> |
||||
|
||||
<?php if ( woodmart_get_opt( 'thank_you_page_default_content' ) ) : ?> |
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> |
||||
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> |
||||
<?php endif; ?> |
||||
|
||||
<?php else : ?> |
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
|
||||
<?php endif; ?> |
||||
|
||||
</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; |