Initial commit: orgsteklo WordPress theme

Custom WooCommerce theme for orgsteklo.ru including:
- Product catalog with category/subcategory hierarchy
- Custom checkout with delivery calculation
- Price calculator
- Admin settings panel
- Search functionality
- User account pages
This commit is contained in:
Jamil-Abdullayev 2026-03-05 00:48:06 +04:00
commit b8246597d4
227 changed files with 30832 additions and 0 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
# Ignore everything
/*
!/.gitignore
# Except the theme
!/wp-content/
/wp-content/*
!/wp-content/themes/
/wp-content/themes/*
!/wp-content/themes/orgsteklo/
# Inside theme - ignore node_modules if any
wp-content/themes/orgsteklo/node_modules/
# OS files
.DS_Store
Thumbs.db
*.swp
*~
~$*
*.tmp.*

View File

@ -0,0 +1,36 @@
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p>Ошибка 404</p></li>
</ul>
</nav>
<section class="page_404">
<div class="page_404-container container">
<div class="page_404-main">
<h2>404</h2>
<h3>Похоже такой страницы не существует</h3>
<?php
function plural_form($number, $forms) {
$n = abs($number) % 100;
$n1 = $n % 10;
if ($n > 10 && $n < 20) return $forms[2];
if ($n1 > 1 && $n1 < 5) return $forms[1];
if ($n1 == 1) return $forms[0];
return $forms[2];
}
$product_count = wp_count_posts('product')->publish;
$word = plural_form($product_count, ['товар', 'товара', 'товаров']);
echo '<p>Но зато у нас есть более ' . number_format_i18n($product_count, 0) . ' ' . $word . '.</p>';
?>
<a href="/catalog" class="page_404-link">
Перейти в каталог
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.3242 4.44727L15.8767 8.99977L11.3242 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.125 9H15.7475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,895 @@
body.compensate-for-scrollbar {
overflow: hidden;
}
.fancybox-active {
height: auto;
}
.fancybox-is-hidden {
left: -9999px;
margin: 0;
position: absolute !important;
top: -9999px;
visibility: hidden;
}
.fancybox-container {
-webkit-backface-visibility: hidden;
height: 100%;
left: 0;
outline: none;
position: fixed;
-webkit-tap-highlight-color: transparent;
top: 0;
-ms-touch-action: manipulation;
touch-action: manipulation;
transform: translateZ(0);
width: 100%;
z-index: 99992;
}
.fancybox-container * {
box-sizing: border-box;
}
.fancybox-outer,
.fancybox-inner,
.fancybox-bg,
.fancybox-stage {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.fancybox-outer {
-webkit-overflow-scrolling: touch;
overflow-y: auto;
}
.fancybox-bg {
background: rgb(30, 30, 30);
opacity: 0;
transition-duration: inherit;
transition-property: opacity;
transition-timing-function: cubic-bezier(.47, 0, .74, .71);
}
.fancybox-is-open .fancybox-bg {
opacity: .9;
transition-timing-function: cubic-bezier(.22, .61, .36, 1);
}
.fancybox-infobar,
.fancybox-toolbar,
.fancybox-caption,
.fancybox-navigation .fancybox-button {
direction: ltr;
opacity: 0;
position: absolute;
transition: opacity .25s ease, visibility 0s ease .25s;
visibility: hidden;
z-index: 99997;
}
.fancybox-show-infobar .fancybox-infobar,
.fancybox-show-toolbar .fancybox-toolbar,
.fancybox-show-caption .fancybox-caption,
.fancybox-show-nav .fancybox-navigation .fancybox-button {
opacity: 1;
transition: opacity .25s ease 0s, visibility 0s ease 0s;
visibility: visible;
}
.fancybox-infobar {
color: #ccc;
font-size: 13px;
-webkit-font-smoothing: subpixel-antialiased;
height: 44px;
left: 0;
line-height: 44px;
min-width: 44px;
mix-blend-mode: difference;
padding: 0 10px;
pointer-events: none;
top: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.fancybox-toolbar {
right: 0;
top: 0;
}
.fancybox-stage {
direction: ltr;
overflow: visible;
transform: translateZ(0);
z-index: 99994;
}
.fancybox-is-open .fancybox-stage {
overflow: hidden;
}
.fancybox-slide {
-webkit-backface-visibility: hidden;
/* Using without prefix would break IE11 */
display: none;
height: 100%;
left: 0;
outline: none;
overflow: auto;
-webkit-overflow-scrolling: touch;
padding: 44px;
position: absolute;
text-align: center;
top: 0;
transition-property: transform, opacity;
white-space: normal;
width: 100%;
z-index: 99994;
}
.fancybox-slide::before {
content: '';
display: inline-block;
font-size: 0;
height: 100%;
vertical-align: middle;
width: 0;
}
.fancybox-is-sliding .fancybox-slide,
.fancybox-slide--previous,
.fancybox-slide--current,
.fancybox-slide--next {
display: block;
}
.fancybox-slide--image {
overflow: hidden;
padding: 44px 0;
}
.fancybox-slide--image::before {
display: none;
}
.fancybox-slide--html {
padding: 6px;
}
.fancybox-content {
background: #fff;
display: inline-block;
margin: 0;
max-width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
padding: 44px;
position: relative;
text-align: left;
vertical-align: middle;
}
.fancybox-slide--image .fancybox-content {
animation-timing-function: cubic-bezier(.5, 0, .14, 1);
-webkit-backface-visibility: hidden;
background: transparent;
background-repeat: no-repeat;
background-size: 100% 100%;
left: 0;
max-width: none;
overflow: visible;
padding: 0;
position: absolute;
top: 0;
-ms-transform-origin: top left;
transform-origin: top left;
transition-property: transform, opacity;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 99995;
}
.fancybox-can-zoomOut .fancybox-content {
cursor: zoom-out;
}
.fancybox-can-zoomIn .fancybox-content {
cursor: zoom-in;
}
.fancybox-can-swipe .fancybox-content,
.fancybox-can-pan .fancybox-content {
cursor: -webkit-grab;
cursor: grab;
}
.fancybox-is-grabbing .fancybox-content {
cursor: -webkit-grabbing;
cursor: grabbing;
}
.fancybox-container [data-selectable='true'] {
cursor: text;
}
.fancybox-image,
.fancybox-spaceball {
background: transparent;
border: 0;
height: 100%;
left: 0;
margin: 0;
max-height: none;
max-width: none;
padding: 0;
position: absolute;
top: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100%;
}
.fancybox-spaceball {
z-index: 1;
}
.fancybox-slide--video .fancybox-content,
.fancybox-slide--map .fancybox-content,
.fancybox-slide--pdf .fancybox-content,
.fancybox-slide--iframe .fancybox-content {
height: 100%;
overflow: visible;
padding: 0;
width: 100%;
}
.fancybox-slide--video .fancybox-content {
background: #000;
}
.fancybox-slide--map .fancybox-content {
background: #e5e3df;
}
.fancybox-slide--iframe .fancybox-content {
background: #fff;
}
.fancybox-video,
.fancybox-iframe {
background: transparent;
border: 0;
display: block;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
}
/* Fix iOS */
.fancybox-iframe {
left: 0;
position: absolute;
top: 0;
}
.fancybox-error {
background: #fff;
cursor: default;
max-width: 400px;
padding: 40px;
width: 100%;
}
.fancybox-error p {
color: #444;
font-size: 16px;
line-height: 20px;
margin: 0;
padding: 0;
}
/* Buttons */
.fancybox-button {
background: rgba(30, 30, 30, .6);
border: 0;
border-radius: 0;
box-shadow: none;
cursor: pointer;
display: inline-block;
height: 44px;
margin: 0;
padding: 10px;
position: relative;
transition: color .2s;
vertical-align: top;
visibility: inherit;
width: 44px;
}
.fancybox-button,
.fancybox-button:visited,
.fancybox-button:link {
color: #ccc;
}
.fancybox-button:hover {
color: #fff;
}
.fancybox-button:focus {
outline: none;
}
.fancybox-button.fancybox-focus {
outline: 1px dotted;
}
.fancybox-button[disabled],
.fancybox-button[disabled]:hover {
color: #888;
cursor: default;
outline: none;
}
/* Fix IE11 */
.fancybox-button div {
height: 100%;
}
.fancybox-button svg {
display: block;
height: 100%;
overflow: visible;
position: relative;
width: 100%;
}
.fancybox-button svg path {
fill: currentColor;
stroke-width: 0;
}
.fancybox-button--play svg:nth-child(2),
.fancybox-button--fsenter svg:nth-child(2) {
display: none;
}
.fancybox-button--pause svg:nth-child(1),
.fancybox-button--fsexit svg:nth-child(1) {
display: none;
}
.fancybox-progress {
background: #ff5268;
height: 2px;
left: 0;
position: absolute;
right: 0;
top: 0;
-ms-transform: scaleX(0);
transform: scaleX(0);
-ms-transform-origin: 0;
transform-origin: 0;
transition-property: transform;
transition-timing-function: linear;
z-index: 99998;
}
/* Close button on the top right corner of html content */
.fancybox-close-small {
background: transparent;
border: 0;
border-radius: 0;
color: #ccc;
cursor: pointer;
opacity: .8;
padding: 8px;
position: absolute;
right: -12px;
top: -44px;
z-index: 401;
}
.fancybox-close-small:hover {
color: #fff;
opacity: 1;
}
.fancybox-slide--html .fancybox-close-small {
color: currentColor;
padding: 10px;
right: 0;
top: 0;
}
.fancybox-slide--image.fancybox-is-scaling .fancybox-content {
overflow: hidden;
}
.fancybox-is-scaling .fancybox-close-small,
.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {
display: none;
}
/* Navigation arrows */
.fancybox-navigation .fancybox-button {
background-clip: content-box;
height: 100px;
opacity: 0;
position: absolute;
top: calc(50% - 50px);
width: 70px;
}
.fancybox-navigation .fancybox-button div {
padding: 7px;
}
.fancybox-navigation .fancybox-button--arrow_left {
left: 0;
left: env(safe-area-inset-left);
padding: 31px 26px 31px 6px;
}
.fancybox-navigation .fancybox-button--arrow_right {
padding: 31px 6px 31px 26px;
right: 0;
right: env(safe-area-inset-right);
}
/* Caption */
.fancybox-caption {
background: linear-gradient(to top,
rgba(0, 0, 0, .85) 0%,
rgba(0, 0, 0, .3) 50%,
rgba(0, 0, 0, .15) 65%,
rgba(0, 0, 0, .075) 75.5%,
rgba(0, 0, 0, .037) 82.85%,
rgba(0, 0, 0, .019) 88%,
rgba(0, 0, 0, 0) 100%);
bottom: 0;
color: #eee;
font-size: 14px;
font-weight: 400;
left: 0;
line-height: 1.5;
padding: 75px 44px 25px 44px;
pointer-events: none;
right: 0;
text-align: center;
z-index: 99996;
}
@supports (padding: max(0px)) {
.fancybox-caption {
padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
}
}
.fancybox-caption--separate {
margin-top: -50px;
}
.fancybox-caption__body {
max-height: 50vh;
overflow: auto;
pointer-events: all;
}
.fancybox-caption a,
.fancybox-caption a:link,
.fancybox-caption a:visited {
color: #ccc;
text-decoration: none;
}
.fancybox-caption a:hover {
color: #fff;
text-decoration: underline;
}
/* Loading indicator */
.fancybox-loading {
animation: fancybox-rotate 1s linear infinite;
background: transparent;
border: 4px solid #888;
border-bottom-color: #fff;
border-radius: 50%;
height: 50px;
left: 50%;
margin: -25px 0 0 -25px;
opacity: .7;
padding: 0;
position: absolute;
top: 50%;
width: 50px;
z-index: 99999;
}
@keyframes fancybox-rotate {
100% {
transform: rotate(360deg);
}
}
/* Transition effects */
.fancybox-animated {
transition-timing-function: cubic-bezier(0, 0, .25, 1);
}
/* transitionEffect: slide */
.fancybox-fx-slide.fancybox-slide--previous {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.fancybox-fx-slide.fancybox-slide--next {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.fancybox-fx-slide.fancybox-slide--current {
opacity: 1;
transform: translate3d(0, 0, 0);
}
/* transitionEffect: fade */
.fancybox-fx-fade.fancybox-slide--previous,
.fancybox-fx-fade.fancybox-slide--next {
opacity: 0;
transition-timing-function: cubic-bezier(.19, 1, .22, 1);
}
.fancybox-fx-fade.fancybox-slide--current {
opacity: 1;
}
/* transitionEffect: zoom-in-out */
.fancybox-fx-zoom-in-out.fancybox-slide--previous {
opacity: 0;
transform: scale3d(1.5, 1.5, 1.5);
}
.fancybox-fx-zoom-in-out.fancybox-slide--next {
opacity: 0;
transform: scale3d(.5, .5, .5);
}
.fancybox-fx-zoom-in-out.fancybox-slide--current {
opacity: 1;
transform: scale3d(1, 1, 1);
}
/* transitionEffect: rotate */
.fancybox-fx-rotate.fancybox-slide--previous {
opacity: 0;
-ms-transform: rotate(-360deg);
transform: rotate(-360deg);
}
.fancybox-fx-rotate.fancybox-slide--next {
opacity: 0;
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
.fancybox-fx-rotate.fancybox-slide--current {
opacity: 1;
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
/* transitionEffect: circular */
.fancybox-fx-circular.fancybox-slide--previous {
opacity: 0;
transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
}
.fancybox-fx-circular.fancybox-slide--next {
opacity: 0;
transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
}
.fancybox-fx-circular.fancybox-slide--current {
opacity: 1;
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
}
/* transitionEffect: tube */
.fancybox-fx-tube.fancybox-slide--previous {
transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);
}
.fancybox-fx-tube.fancybox-slide--next {
transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);
}
.fancybox-fx-tube.fancybox-slide--current {
transform: translate3d(0, 0, 0) scale(1);
}
/* Styling for Small-Screen Devices */
@media all and (max-height: 576px) {
.fancybox-slide {
padding-left: 6px;
padding-right: 6px;
}
.fancybox-slide--image {
padding: 6px 0;
}
.fancybox-close-small {
right: -6px;
}
.fancybox-slide--image .fancybox-close-small {
background: #4e4e4e;
color: #f2f4f6;
height: 36px;
opacity: 1;
padding: 6px;
right: 0;
top: 0;
width: 36px;
}
.fancybox-caption {
padding-left: 12px;
padding-right: 12px;
}
@supports (padding: max(0px)) {
.fancybox-caption {
padding-left: max(12px, env(safe-area-inset-left));
padding-right: max(12px, env(safe-area-inset-right));
}
}
}
/* Share */
.fancybox-share {
background: #f4f4f4;
border-radius: 3px;
max-width: 90%;
padding: 30px;
text-align: center;
}
.fancybox-share h1 {
color: #222;
font-size: 35px;
font-weight: 700;
margin: 0 0 20px 0;
}
.fancybox-share p {
margin: 0;
padding: 0;
}
.fancybox-share__button {
border: 0;
border-radius: 3px;
display: inline-block;
font-size: 14px;
font-weight: 700;
line-height: 40px;
margin: 0 5px 10px 5px;
min-width: 130px;
padding: 0 15px;
text-decoration: none;
transition: all .2s;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
}
.fancybox-share__button:visited,
.fancybox-share__button:link {
color: #fff;
}
.fancybox-share__button:hover {
text-decoration: none;
}
.fancybox-share__button--fb {
background: #3b5998;
}
.fancybox-share__button--fb:hover {
background: #344e86;
}
.fancybox-share__button--pt {
background: #bd081d;
}
.fancybox-share__button--pt:hover {
background: #aa0719;
}
.fancybox-share__button--tw {
background: #1da1f2;
}
.fancybox-share__button--tw:hover {
background: #0d95e8;
}
.fancybox-share__button svg {
height: 25px;
margin-right: 7px;
position: relative;
top: -1px;
vertical-align: middle;
width: 25px;
}
.fancybox-share__button svg path {
fill: #fff;
}
.fancybox-share__input {
background: transparent;
border: 0;
border-bottom: 1px solid #d7d7d7;
border-radius: 0;
color: #5d5b5b;
font-size: 14px;
margin: 10px 0 0 0;
outline: none;
padding: 10px 15px;
width: 100%;
}
/* Thumbs */
.fancybox-thumbs {
background: #ddd;
bottom: 0;
display: none;
margin: 0;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
padding: 2px 2px 4px 2px;
position: absolute;
right: 0;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
top: 0;
width: 212px;
z-index: 99995;
}
.fancybox-thumbs-x {
overflow-x: auto;
overflow-y: hidden;
}
.fancybox-show-thumbs .fancybox-thumbs {
display: block;
}
.fancybox-show-thumbs .fancybox-inner {
right: 212px;
}
.fancybox-thumbs__list {
font-size: 0;
height: 100%;
list-style: none;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
padding: 0;
position: absolute;
position: relative;
white-space: nowrap;
width: 100%;
}
.fancybox-thumbs-x .fancybox-thumbs__list {
overflow: hidden;
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {
width: 7px;
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {
background: #fff;
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {
background: #2a2a2a;
border-radius: 10px;
}
.fancybox-thumbs__list a {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
background-color: rgba(0, 0, 0, .1);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
cursor: pointer;
float: left;
height: 75px;
margin: 2px;
max-height: calc(100% - 8px);
max-width: calc(50% - 4px);
outline: none;
overflow: hidden;
padding: 0;
position: relative;
-webkit-tap-highlight-color: transparent;
width: 100px;
}
.fancybox-thumbs__list a::before {
border: 6px solid #ff5268;
bottom: 0;
content: '';
left: 0;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transition: all .2s cubic-bezier(.25, .46, .45, .94);
z-index: 99991;
}
.fancybox-thumbs__list a:focus::before {
opacity: .5;
}
.fancybox-thumbs__list a.fancybox-thumbs-active::before {
opacity: 1;
}
/* Styling for Small-Screen Devices */
@media all and (max-width: 576px) {
.fancybox-thumbs {
width: 110px;
}
.fancybox-show-thumbs .fancybox-inner {
right: 110px;
}
.fancybox-thumbs__list a {
max-width: calc(100% - 10px);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,279 @@
/**
* Калькулятор цен на оргстекло (с поддержкой скидок)
*/
(function($) {
'use strict';
if (typeof orgstekloCalc === 'undefined') {
return;
}
var calculator = {
productId: orgstekloCalc.productId,
ajaxUrl: orgstekloCalc.ajaxUrl,
nonce: orgstekloCalc.nonce,
$thicknessField: null,
$widthField: null,
$lengthField: null,
$quantityField: null,
currentThickness: null,
currentWidth: null,
currentLength: null,
currentQuantity: 1,
init: function() {
this.cacheElements();
this.bindEvents();
this.initializeFields();
},
cacheElements: function() {
this.$thicknessField = $('#orgsteklo_thickness');
this.$widthField = $('#orgsteklo_width');
this.$lengthField = $('#orgsteklo_length');
this.$quantityField = $('#orgsteklo_quantity');
},
bindEvents: function() {
var self = this;
this.$thicknessField.on('change', function() {
self.onThicknessChange();
});
this.$widthField.on('input change', function() {
self.onDimensionsChange();
});
this.$lengthField.on('input change', function() {
self.onDimensionsChange();
});
this.$quantityField.on('input change', function() {
self.onQuantityChange();
});
$('#orgsteklo_qty_plus').on('click', function(e) {
e.preventDefault();
self.$quantityField.val((parseInt(self.$quantityField.val()) || 1) + 1).trigger('change');
});
$('#orgsteklo_qty_minus').on('click', function(e) {
e.preventDefault();
var val = parseInt(self.$quantityField.val()) || 1;
if (val > 1) {
self.$quantityField.val(val - 1).trigger('change');
}
});
},
initializeFields: function() {
if (this.$thicknessField.length === 0) {
console.error('ОШИБКА: Поле толщины #orgsteklo_thickness не найдено!');
return;
}
// Если толщина не выбрана, автоматически выбираем первую из списка
var currentVal = this.$thicknessField.val();
if (!currentVal) {
var firstThickness = this.$thicknessField.find('option:not([value=""])').first().val();
if (firstThickness) {
this.$thicknessField.val(firstThickness);
}
}
// Если теперь есть выбранная толщина, запускаем расчет
var finalVal = this.$thicknessField.val();
if (finalVal) {
this.onThicknessChange();
}
},
onThicknessChange: function() {
var thickness = parseFloat(this.$thicknessField.val());
if (!thickness) return;
this.currentThickness = thickness;
this.loadStandardDimensions(thickness);
},
onDimensionsChange: function() {
this.currentWidth = parseFloat(this.$widthField.val()) || null;
this.currentLength = parseFloat(this.$lengthField.val()) || null;
this.calculate();
},
onQuantityChange: function() {
this.currentQuantity = parseInt(this.$quantityField.val()) || 1;
this.calculate();
},
loadStandardDimensions: function(thickness) {
var self = this;
$.post(this.ajaxUrl, {
action: 'orgsteklo_get_standard_dimensions',
nonce: this.nonce,
product_id: this.productId,
thickness: thickness
}, function(response) {
if (response.success) {
// Обновляем стандартные размеры (ТОЛЬКО здесь!)
$('#orgsteklo_standard_width').text(self.formatPrice(Math.round(response.data.width)));
$('#orgsteklo_standard_length').text(self.formatPrice(Math.round(response.data.length)));
// Заполняем поля ввода
self.$widthField.val(response.data.width);
self.$lengthField.val(response.data.length);
self.currentWidth = response.data.width;
self.currentLength = response.data.length;
self.calculate();
} else {
console.error('Ошибка get_standard_dimensions:', response.data);
alert('ОШИБКА: ' + (response.data?.message || 'неизвестная ошибка'));
}
}).fail(function(xhr, status, error) {
console.error('AJAX FAIL get_standard_dimensions:', status, error);
alert('AJAX ОШИБКА: ' + error);
});
},
calculate: function() {
var self = this;
if (!this.currentThickness) return;
this.showLoading();
$.post(this.ajaxUrl, {
action: 'orgsteklo_calculate',
nonce: this.nonce,
product_id: this.productId,
thickness: this.currentThickness,
width: this.currentWidth,
length: this.currentLength,
quantity: this.currentQuantity
}, function(response) {
if (response.success) {
self.displayResults(response.data);
} else {
console.error('Ошибка calculate:', response.data);
alert('ОШИБКА: ' + (response.data?.message || 'неизвестная ошибка'));
}
}).fail(function(xhr, status, error) {
console.error('AJAX FAIL calculate:', status, error, xhr.responseText);
alert('AJAX ОШИБКА: ' + error);
}).always(function() {
self.hideLoading();
});
},
displayResults: function(data) {
// ВАЖНО: Стандартные размеры обновляются ТОЛЬКО в loadStandardDimensions()
// и НЕ должны меняться при изменении пользовательских размеров!
// ===== ОСНОВНЫЕ ЦЕНЫ =====
$('#orgsteklo_price_standard_sheet').text(this.formatPrice(data.price_standard_sheet));
// ШАГ 5: Для заданных размеров показываем price_per_kg_current (Ст. кг ЛЗР),
// для стандартных - price_per_kg_standard (Ст. кг ЛСР)
var pricePerKg = data.price_per_kg_current || data.price_per_kg_standard;
$('#orgsteklo_price_per_kg_standard').text(this.formatPrice(pricePerKg));
$('#orgsteklo_price_sqm').text(this.formatPrice(data.price_sqm));
$('#orgsteklo_current_sheet_price').text(this.formatPrice(data.price_current_sheet));
// ВАЖНО: Вычисляем стоимость заказа как ценаа_единицу * количество
// чтобы совпадало с расчетом в корзине WooCommerce
$('#orgsteklo_order_price').text(this.formatPrice(data.price_current_sheet * this.currentQuantity));
// ===== ВЕС =====
$('#orgsteklo_weight_standard_sheet').text(this.formatWeight(data.weight_standard_sheet));
$('#orgsteklo_weight_sqm').text(this.formatWeight(data.weight_sqm));
// Вес заказа также вычисляем как веса_единицу * количество
$('#orgsteklo_order_weight').text(this.formatWeight(data.weight_current_sheet * this.currentQuantity));
// ===== СБРОС СТАРЫХ ЦЕН =====
$('.orgsteklo-old-price').hide().text('');
$('#orgsteklo_order_price_old').hide();
// ===== СКИДКИ =====
if (data.has_discount) {
if (data.price_standard_sheet_old) {
$('#orgsteklo_price_standard_sheet_old')
.text(this.formatPrice(data.price_standard_sheet_old) + ' ₽')
.show();
}
// ШАГ 5: Для старой цены также используем правильное значение
var pricePerKgOld = data.price_per_kg_current_old || data.price_per_kg_standard_old;
if (pricePerKgOld) {
$('#orgsteklo_price_per_kg_standard_old')
.text(this.formatPrice(pricePerKgOld) + ' ₽')
.show();
}
if (data.price_sqm_old) {
$('#orgsteklo_price_sqm_old')
.text(this.formatPrice(data.price_sqm_old) + ' ₽')
.show();
}
if (data.price_current_sheet_old) {
$('#orgsteklo_current_sheet_price_old')
.text(this.formatPrice(data.price_current_sheet_old) + ' ₽')
.show();
}
if (data.price_current_sheet_old) {
// Старая цена заказа = старая цена за единицу * количество
$('#orgsteklo_order_price_old span:first')
.text(this.formatPrice(data.price_current_sheet_old * this.currentQuantity));
$('#orgsteklo_order_price_old').show();
}
}
},
resetOldPrices: function() {
$('.orgsteklo-old-price').hide().text('');
$('#orgsteklo_order_price_old').hide();
},
showOldPrice: function(selector, value, wrapper) {
if (!value) return;
$(selector).text(this.formatPrice(value)).show();
if (wrapper) $(wrapper).show();
},
formatPrice: function(price) {
return new Intl.NumberFormat('ru-RU', {
minimumFractionDigits: 0,
maximumFractionDigits: 0
}).format(price);
},
formatWeight: function(weight) {
// Используем 'en-US' для точки как разделителя дробной части
return new Intl.NumberFormat('en-US', {
minimumFractionDigits: 3,
maximumFractionDigits: 3
}).format(weight);
},
showLoading: function() {
$('.orgsteklo-calculator-results').addClass('loading');
},
hideLoading: function() {
$('.orgsteklo-calculator-results').removeClass('loading');
}
};
$(document).ready(function() {
calculator.init();
});
})(jQuery);

View File

@ -0,0 +1,53 @@
<?php
$consult_title = get_field('consult_title', 'option');
$consult_description = get_field('consult_description', 'option');
if($consult_title) {
?>
<section class="consult">
<div class="consult-container container">
<div class="consult-main">
<div class="consult-name">
<?php
if($consult_title) {
echo '<h2>' . $consult_title . '</h2>';
}
if($consult_description) {
echo '<p>' . $consult_description . '</p>';
}
?>
</div>
<form class="consult-form" method="post" id="consult-form">
<input name="consult-url" type="hidden" value="<?php echo esc_url( home_url( add_query_arg( null, null ) ) ); ?>">
<div class="consult-form__row">
<input type="text" name="consult-name" placeholder="ФИО*" autocomplete="name" required>
<input type="tel" name="consult-phone" class="phone" placeholder="+7 (999) 999-99-99*" autocomplete="tel" required>
</div>
<input type="email" name="consult-email" placeholder="E-mail*" autocomplete="email" required>
<input type="text" name="consult-comment" placeholder="Комментарий...">
<div class="consult-checkbox">
<input type="checkbox" id="consult-checkbox">
<label for="consult-checkbox">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy">политикой конфиденциальности</a></label>
</div>
<button class="consult-submit" name="consult-form-submit" type="submit">Отправить заявку</button>
</form>
</div>
</div>
</section>
<?php
}
?>
<?php
$email_form = get_field('email_form', 'option');
$to = $email_form;
$subject = 'Получить индивидуальную консультацию';
$headers = array('Content-Type: text/html; charset=UTF-8');
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['consult-form-submit'])) {
$name = sanitize_text_field($_POST['consult-name']);
$phone = sanitize_text_field($_POST['consult-phone']);
$email = sanitize_text_field($_POST['consult-email']);
$comment = sanitize_text_field($_POST['consult-comment']);
$url = esc_url_raw($_POST['consult-url']);
$message = "Имя: $name<br>Телефон: $phone<br>Email: $email<br>Комментарий: $comment<br>Страница: $url";
if(wp_mail($to, $subject, $message, $headers)) {}
}
?>

View File

@ -0,0 +1,41 @@
<?php
$info_title = get_field('info_title', 'option');
$info_repeats = get_field('info_repeat', 'option');
if($info_repeats) {
?>
<section class="info">
<div class="info-container container">
<?php
if($info_title) {
echo '<h2>' . $info_title . '</h2>';
}
if($info_title) {
echo '<div class="info-main">';
foreach ($info_repeats as $info_repeat) {
$info_repeat_icon = $info_repeat['info_repeat_icon'];
$info_repeat_title = $info_repeat['info_repeat_title'];
$info_repeat_description = $info_repeat['info_repeat_description'];
$info_repeat_link = $info_repeat['info_repeat_link'];
echo '<div class="info-item">';
if($info_repeat_icon) {
echo '<img src="' . esc_url($info_repeat_icon['url']) . '" alt="' . esc_attr($info_repeat_icon['alt']) . '">';
}
if($info_repeat_title) {
echo '<h3>' . $info_repeat_title . '</h3>';
}
if($info_repeat_description) {
echo '<p>' . $info_repeat_description . '</p>';
}
if($info_repeat_link) {
echo '<a href="' . $info_repeat_link . '" class="link-more">Узнать подробнее<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.9997 10C14.9956 9.56159 14.819 9.14243 14.508 8.83335L10.933 5.25002C10.7769 5.09481 10.5657 5.00769 10.3455 5.00769C10.1254 5.00769 9.91414 5.09481 9.75801 5.25002C9.6799 5.32749 9.61791 5.41965 9.5756 5.5212C9.53329 5.62275 9.51151 5.73167 9.51151 5.84168C9.51151 5.95169 9.53329 6.06061 9.5756 6.16216C9.61791 6.26371 9.6799 6.35588 9.75801 6.43335L12.4997 9.16668H4.16634C3.94533 9.16668 3.73337 9.25448 3.57709 9.41076C3.42081 9.56704 3.33301 9.779 3.33301 10C3.33301 10.221 3.42081 10.433 3.57709 10.5893C3.73337 10.7455 3.94533 10.8333 4.16634 10.8333H12.4997L9.75801 13.575C9.60109 13.7308 9.51249 13.9426 9.51171 14.1637C9.51093 14.3849 9.59803 14.5973 9.75384 14.7542C9.90966 14.9111 10.1214 14.9997 10.3426 15.0005C10.5637 15.0013 10.7761 14.9142 10.933 14.7583L14.508 11.175C14.821 10.8639 14.9978 10.4413 14.9997 10Z" fill="#02ADEF"/></svg></a>';
}
echo '</div>';
}
echo '</div>';
}
?>
</div>
</section>
<?php
}
?>

View File

@ -0,0 +1,33 @@
<?php
$why_title = get_field('why_title', 'option');
$why_repeats = get_field('why_repeat', 'option');
if($why_repeats) {
?>
<section class="why">
<div class="why-container container">
<?php
if($why_title) {
echo '<h2>' . $why_title . '</h2>';
}
if($why_repeats) {
echo '<div class="why-main">';
foreach ($why_repeats as $why_repeat) {
$why_repeat_title = $why_repeat['why_repeat_title'];
$why_repeat_description = $why_repeat['why_repeat_description'];
echo '<div class="why-item">';
if($why_repeat_title) {
echo '<h3>' . $why_repeat_title . '</h3>';
}
if($why_repeat_description) {
echo '<p>' . $why_repeat_description . '</p>';
}
echo '</div>';
}
echo '</div>';
}
?>
</div>
</section>
<?php
}
?>

View File

@ -0,0 +1,156 @@
<footer>
<div class="footer-container container">
<div class="footer-main">
<div class="footer-col">
<?php
$logo_footer = get_field('logo_footer', 'option');
if ($logo_footer) {
echo '<a href="/" class="footer-logo">';
echo '<img src="' . esc_url($logo_footer['url']) . '" alt="' . esc_attr($logo_footer['alt']) . '">';
echo '</a>';
}
?>
<?php
$address = get_field('address', 'option');
if($address) {
echo '<div class="footer-address"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.6663 4.66666L8.68634 8.46666C8.48052 8.59561 8.24255 8.664 7.99967 8.664C7.7568 8.664 7.51883 8.59561 7.31301 8.46666L1.33301 4.66666M2.66634 2.66666H13.333C14.0694 2.66666 14.6663 3.26362 14.6663 4V12C14.6663 12.7364 14.0694 13.3333 13.333 13.3333H2.66634C1.92996 13.3333 1.33301 12.7364 1.33301 12V4C1.33301 3.26362 1.92996 2.66666 2.66634 2.66666Z" stroke="#868D96" stroke-linecap="round" stroke-linejoin="round"/></svg><p>' . $address . '</p></div>';
}
?>
</div>
<?php
$menu_list = wp_get_nav_menu_items('Подвал Каталог');
if ($menu_list) {
echo '<div class="footer-menu"><h4 class="footer-menu__title">Каталог</h4><nav><ul>';
foreach ($menu_list as $menu_item) {
$class = '';
if (is_page($menu_item->object_id)) {
$class = ' class="active"';
}
echo '<li><a href="' . esc_url($menu_item->url) . '"' . $class . '>' . esc_html($menu_item->title) . '</a></li>';
}
echo '</ul></nav></div>';
}
?>
<?php
$menu_list = wp_get_nav_menu_items('Подвал Покупателям');
if ($menu_list) {
echo '<div class="footer-menu"><h4 class="footer-menu__title">Покупателям</h4><nav><ul>';
foreach ($menu_list as $menu_item) {
$class = '';
if (is_page($menu_item->object_id)) {
$class = ' class="active"';
}
echo '<li><a href="' . esc_url($menu_item->url) . '"' . $class . '>' . esc_html($menu_item->title) . '</a></li>';
}
echo '</ul></nav></div>';
}
?>
<div class="footer-contacts">
<div class="footer-contacts__col">
<?php
$phone = get_field('phone', 'option');
$email = get_field('email', 'option');
$main_site = get_field('main_site', 'option');
if($phone) {
echo '<div class="footer-contacts__item"><a href="tel:' . $phone . '">' . $phone . '</a></div>';
}
if($email) {
echo '<div class="footer-contacts__item"><a href="mailto:' . $email . '">' . $email . '</a></div>';
}
if($main_site) {
echo '<div class="footer-contacts__item"><a href="https://' . $main_site . '" target="_blank">' . $main_site . '</a><p>Основной сайт компании</p></div>';
}
?>
</div>
<?php
$footer_payment_title = get_field('footer_payment_title', 'option');
$footer_payment_repeats = get_field('footer_payment_repeat', 'option');
if($footer_payment_repeats) {
echo '<div class="footer-contacts__payment">';
if($footer_payment_title) {
echo '<p>' . $footer_payment_title . '</p>';
}
if($footer_payment_repeats) {
echo '<div class="footer-contacts__payment-row">';
foreach ($footer_payment_repeats as $footer_payment_repeat) {
$footer_payment_repeat_logo = $footer_payment_repeat['footer_payment_repeat_logo'];
echo '<img src="' . esc_url($footer_payment_repeat_logo['url']) . '" alt="' . esc_attr($footer_payment_repeat_logo['alt']) . '">';
}
echo '</div>';
}
echo '</div>';
}
?>
</div>
<div class="footer-button">
<button class="footer-callback popup-callback__open">Заказать звонок</button>
</div>
</div>
<div class="footer-copyright">
<?php
$footer_copyright = get_field('footer_copyright', 'option');
if($footer_copyright) {
echo '<p>' . $footer_copyright . '</p>';
}
?>
<div class="footer-copyright__row">
<a href="/privacy-policy">Политика конфиденциальности</a>
<a href="/agreement">Публичная оферта</a>
</div>
<?php
$footer_dev_link = get_field('footer_dev_link', 'option');
$footer_dev_logo = get_field('footer_dev_logo', 'option');
if($footer_dev_link) {
echo '<a href="' . $footer_dev_link . '" target="_blank">Сайт разработан:';
if($footer_dev_logo) {
echo '<img src="' . esc_url($footer_dev_logo['url']) . '" alt="' . esc_attr($footer_dev_logo['alt']) . '">';
}
echo '</a>';
}
?>
</div>
</div>
</footer>
<div class="popup popup-callback">
<div class="popup-fon popup-callback__fon"></div>
<div class="popup-main">
<button class="popup-close popup-callback__close"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1269_41481)"><path d="M23.7068 0.293275C23.5193 0.105804 23.2649 0.000488281 22.9998 0.000488281C22.7346 0.000488281 22.4803 0.105804 22.2928 0.293275L11.9998 10.5863L1.70679 0.293275C1.51926 0.105804 1.26495 0.000488281 0.999786 0.000488281C0.734622 0.000488281 0.480314 0.105804 0.292786 0.293275C0.105315 0.480802 0 0.735111 0 1.00027C0 1.26544 0.105315 1.51975 0.292786 1.70727L10.5858 12.0003L0.292786 22.2933C0.105315 22.4808 0 22.7351 0 23.0003C0 23.2654 0.105315 23.5197 0.292786 23.7073C0.480314 23.8947 0.734622 24.0001 0.999786 24.0001C1.26495 24.0001 1.51926 23.8947 1.70679 23.7073L11.9998 13.4143L22.2928 23.7073C22.4803 23.8947 22.7346 24.0001 22.9998 24.0001C23.2649 24.0001 23.5193 23.8947 23.7068 23.7073C23.8943 23.5197 23.9996 23.2654 23.9996 23.0003C23.9996 22.7351 23.8943 22.4808 23.7068 22.2933L13.4138 12.0003L23.7068 1.70727C23.8943 1.51975 23.9996 1.26544 23.9996 1.00027C23.9996 0.735111 23.8943 0.480802 23.7068 0.293275Z" fill="#808080"></path></g><defs><clipPath id="clip0_1269_41481"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></button>
<div class="popup-registration__col">
<div class="popup-registration__name">
<h4>Заказать обратный звонок</h4>
</div>
<form class="consult-form" method="post" id="callback-form">
<input name="callback-url" type="hidden" value="<?php echo esc_url( home_url( add_query_arg( null, null ) ) ); ?>">
<div class="consult-form__row">
<input type="text" name="callback-name" placeholder="ФИО*" autocomplete="name" required>
<input type="tel" name="callback-phone" class="phone" placeholder="+7 (999) 999-99-99*" autocomplete="tel" required>
</div>
<input type="email" name="callback-email" placeholder="E-mail*" autocomplete="email" required>
<input type="text" name="callback-comment" placeholder="Комментарий...">
<div class="consult-checkbox">
<input type="checkbox" id="callback-checkbox">
<label for="callback-checkbox">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy">политикой конфиденциальности</a></label>
</div>
<button class="consult-submit" name="callback-form-submit" type="submit">Отправить заявку</button>
</form>
</div>
</div>
</div>
<?php
$email_form = get_field('email_form', 'option');
$to = $email_form;
$subject = 'аказать обратный звонок';
$headers = array('Content-Type: text/html; charset=UTF-8');
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['callback-form-submit'])) {
$name = sanitize_text_field($_POST['callback-name']);
$phone = sanitize_text_field($_POST['callback-phone']);
$email = sanitize_text_field($_POST['callback-email']);
$comment = sanitize_text_field($_POST['callback-comment']);
$url = esc_url_raw($_POST['callback-url']);
$message = "Имя: $name<br>Телефон: $phone<br>Email: $email<br>Комментарий: $comment<br>Страница: $url";
if(wp_mail($to, $subject, $message, $headers)) {}
}
?>
<?php wp_footer() ?>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,466 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
<?php
if (is_category()) {
single_cat_title();
} elseif (is_tag()) {
single_tag_title();
} elseif (is_tax()) {
single_term_title();
} elseif (is_post_type_archive()) {
post_type_archive_title();
} elseif (is_archive()) {
the_archive_title();
} elseif (is_search()) {
echo 'Результаты поиска: ' . get_search_query();
} elseif (is_404()) {
echo 'Страница не найдена';
} elseif (is_home()) {
bloginfo('name');
} elseif (is_singular()) {
echo get_the_title();
} else {
wp_title('');
}
?>
</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
<link rel="icon" href="/wp-content/uploads/2025/04/vector.svg">
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header>
<div class="header-top">
<div class="header-top__container container">
<?php
$logo = get_field('logo', 'option');
if ($logo) {
echo '<a href="/" class="logo">';
echo '<img src="' . esc_url($logo['url']) . '" alt="' . esc_attr($logo['alt']) . '">';
echo '</a>';
}
?>
<div class="header-top__row">
<?php
$menu_items = wp_get_nav_menu_items('Основное меню');
if ($menu_items) {
$menu_tree = [];
foreach ($menu_items as $item) {
$parent_id = $item->menu_item_parent ? $item->menu_item_parent : 0;
$menu_tree[$parent_id][] = $item;
}
function render_menu($parent_id, $menu_tree) {
if (!isset($menu_tree[$parent_id])) {
return;
}
echo '<ul' . ($parent_id === 0 ? ' class="topmenu"' : ' class="submenu"') . '>';
foreach ($menu_tree[$parent_id] as $item) {
$has_children = isset($menu_tree[$item->ID]);
$is_active = is_page($item->object_id) ? ' class="active"' : '';
echo '<li>';
echo '<a href="' . esc_url($item->url) . '"' . $is_active . '>' . esc_html($item->title);
if ($has_children) {
echo ' <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.96036 4.08984H5.84536H3.04036C2.56036 4.08984 2.32036 4.66984 2.66036 5.00984L5.25036 7.59984C5.66536 8.01484 6.34036 8.01484 6.75536 7.59984L7.74036 6.61484L9.34536 5.00984C9.68036 4.66984 9.44036 4.08984 8.96036 4.08984Z" fill="#808080"/</svg>';
}
echo '</a>';
if ($has_children) {
render_menu($item->ID, $menu_tree);
}
echo '</li>';
}
echo '</ul>';
}
echo '<nav>';
render_menu(0, $menu_tree);
echo '</nav>';
}
?>
<div class="header-contacts">
<?php
$phone = get_field('phone', 'option');
if ($phone) {
echo '<a href="tel:' . $phone . '"><svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3001_6929)"><path d="M7.02375 1.00005C8.04288 1.10743 8.99483 1.55945 9.72218 2.28134C10.4495 3.00323 10.9087 3.95175 11.0237 4.97005M7.02375 3.00005C7.5155 3.09702 7.96675 3.33956 8.31894 3.6962C8.67112 4.05284 8.90797 4.50711 8.99875 5.00005M10.9987 8.46005V9.96005C10.9993 10.0993 10.9708 10.2371 10.915 10.3647C10.8592 10.4923 10.7774 10.6068 10.6748 10.701C10.5722 10.7951 10.451 10.8668 10.3191 10.9114C10.1872 10.956 10.0474 10.9726 9.90875 10.96C8.37016 10.7929 6.89225 10.2671 5.59375 9.42505C4.38566 8.65738 3.36141 7.63313 2.59375 6.42505C1.74873 5.12065 1.22287 3.63555 1.05875 2.09005C1.04625 1.95178 1.06268 1.81243 1.107 1.68086C1.15131 1.54929 1.22253 1.42839 1.31613 1.32586C1.40973 1.22332 1.52365 1.1414 1.65064 1.08531C1.77763 1.02922 1.91492 1.00018 2.05375 1.00005H3.55375C3.7964 0.99766 4.03164 1.08359 4.21563 1.24181C4.39961 1.40004 4.51978 1.61977 4.55375 1.86005C4.61706 2.34008 4.73447 2.81141 4.90375 3.26505C4.97102 3.44401 4.98558 3.63851 4.9457 3.82549C4.90582 4.01247 4.81318 4.1841 4.67875 4.32005L4.04375 4.95505C4.75552 6.20682 5.79197 7.24327 7.04375 7.95505L7.67875 7.32005C7.81469 7.18562 7.98632 7.09297 8.17331 7.0531C8.36029 7.01322 8.55478 7.02778 8.73375 7.09505C9.18738 7.26432 9.65871 7.38174 10.1387 7.44505C10.3816 7.47931 10.6034 7.60165 10.762 7.7888C10.9206 7.97594 11.0048 8.21484 10.9987 8.46005Z" stroke="#808080" stroke-linecap="round" stroke-linejoin="round"/></g><defs><clipPath id="clip0_3001_6929"><rect width="12" height="12" fill="white"/></clipPath></defs></svg>' . $phone . '</a>';
}
?>
<?php
$email = get_field('email', 'option');
if ($email) {
echo '<a href="mailto:' . $email . '"><svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 3.5L6.515 6.35C6.36064 6.44671 6.18216 6.49801 6 6.49801C5.81784 6.49801 5.63936 6.44671 5.485 6.35L1 3.5M2 2H10C10.5523 2 11 2.44772 11 3V9C11 9.55228 10.5523 10 10 10H2C1.44772 10 1 9.55228 1 9V3C1 2.44772 1.44772 2 2 2Z" stroke="#808080" stroke-linecap="round" stroke-linejoin="round"/></svg>' . $email . '</a>';
}
?>
</div>
</div>
<div class="header-top__mob">
<?php
$phone = get_field('phone', 'option');
if ($phone) {
echo '<a href="tel:' . $phone . '"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3008_21213)"><path d="M9.36499 1.33356C10.7238 1.47674 11.9931 2.07943 12.9629 3.04195C13.9327 4.00447 14.5449 5.26917 14.6983 6.62689M9.36499 4.00023C10.0207 4.12952 10.6223 4.45291 11.0919 4.92843C11.5615 5.40395 11.8773 6.00965 11.9983 6.66689M14.665 11.2802V13.2802C14.6657 13.4659 14.6277 13.6497 14.5533 13.8198C14.479 13.9899 14.3699 14.1426 14.233 14.2681C14.0962 14.3937 13.9347 14.4892 13.7588 14.5487C13.5829 14.6082 13.3966 14.6303 13.2117 14.6136C11.1602 14.3907 9.18966 13.6897 7.45833 12.5669C5.84755 11.5433 4.48189 10.1777 3.45833 8.56689C2.33165 6.8277 1.63049 4.84756 1.41166 2.78689C1.395 2.60254 1.41691 2.41673 1.47599 2.24131C1.53508 2.06589 1.63004 1.90469 1.75484 1.76797C1.87964 1.63126 2.03153 1.52203 2.20086 1.44724C2.37018 1.37245 2.55322 1.33374 2.73833 1.33356H4.73833C5.06187 1.33038 5.37552 1.44495 5.62084 1.65592C5.86615 1.86689 6.02638 2.15986 6.07166 2.48023C6.15608 3.12027 6.31263 3.74871 6.53833 4.35356C6.62802 4.59218 6.64744 4.8515 6.59427 5.10081C6.54109 5.35012 6.41757 5.57897 6.23833 5.76023L5.39166 6.60689C6.3407 8.27592 7.72263 9.65786 9.39166 10.6069L10.2383 9.76023C10.4196 9.58099 10.6484 9.45746 10.8977 9.40429C11.1471 9.35112 11.4064 9.37053 11.645 9.46023C12.2498 9.68593 12.8783 9.84248 13.5183 9.92689C13.8422 9.97258 14.1379 10.1357 14.3493 10.3852C14.5608 10.6348 14.6731 10.9533 14.665 11.2802Z" stroke="#C4C4C4" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></g><defs><clipPath id="clip0_3008_21213"><rect width="16" height="16" fill="white"/></clipPath></defs></svg></a>';
}
?>
<?php
$email = get_field('email', 'option');
if ($email) {
echo '<a href="mailto:' . $email . '"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.6663 4.6665L8.68634 8.4665C8.48052 8.59545 8.24255 8.66384 7.99967 8.66384C7.7568 8.66384 7.51883 8.59545 7.31301 8.4665L1.33301 4.6665M2.66634 2.6665H13.333C14.0694 2.6665 14.6663 3.26346 14.6663 3.99984V11.9998C14.6663 12.7362 14.0694 13.3332 13.333 13.3332H2.66634C1.92996 13.3332 1.33301 12.7362 1.33301 11.9998V3.99984C1.33301 3.26346 1.92996 2.6665 2.66634 2.6665Z" stroke="#C4C4C4" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg></a>';
}
?>
<button class="minicart-open"><span>00</span><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3008_21223)"><path d="M1.36621 1.36719H2.69954L4.47288 9.64719C4.53793 9.95043 4.70666 10.2215 4.95002 10.4138C5.19338 10.606 5.49615 10.7074 5.80621 10.7005H12.3262C12.6297 10.7 12.9239 10.596 13.1602 10.4057C13.3966 10.2154 13.561 9.95021 13.6262 9.65385L14.7262 4.70052H3.41288M5.99954 14.0005C5.99954 14.3687 5.70107 14.6672 5.33288 14.6672C4.96469 14.6672 4.66621 14.3687 4.66621 14.0005C4.66621 13.6323 4.96469 13.3339 5.33288 13.3339C5.70107 13.3339 5.99954 13.6323 5.99954 14.0005ZM13.3329 14.0005C13.3329 14.3687 13.0344 14.6672 12.6662 14.6672C12.298 14.6672 11.9995 14.3687 11.9995 14.0005C11.9995 13.6323 12.298 13.3339 12.6662 13.3339C13.0344 13.3339 13.3329 13.6323 13.3329 14.0005Z" stroke="#C4C4C4" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></g><defs><clipPath id="clip0_3008_21223"><rect width="16" height="16" fill="white"/></clipPath></defs></svg></button>
<a href=""><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00033 8.66667C9.84127 8.66667 11.3337 7.17428 11.3337 5.33333C11.3337 3.49238 9.84127 2 8.00033 2C6.15938 2 4.66699 3.49238 4.66699 5.33333C4.66699 7.17428 6.15938 8.66667 8.00033 8.66667ZM8.00033 8.66667C9.41481 8.66667 10.7714 9.22857 11.7716 10.2288C12.7718 11.229 13.3337 12.5855 13.3337 14M8.00033 8.66667C6.58584 8.66667 5.22928 9.22857 4.22909 10.2288C3.2289 11.229 2.66699 12.5855 2.66699 14" stroke="#C4C4C4" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg></a>
</div>
</div>
</div>
<div class="header-bottom">
<div class="header-bottom__container container">
<button class="header-catalog__button-mob" onclick="toggleMenu2(this)">
<div class="header-catalog__button-icon">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</button>
<div class="header-bottom__row">
<button class="header-catalog__button <?php if ( is_front_page() ) echo 'change'; ?>" onclick="toggleMenu(this)">
<div class="header-catalog__button-icon">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
<p>Каталог товаров</p>
</button>
<form role="search" method="get" class="header-search" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label class="screen-reader-text" for="s"><?php _e( 'Результат поиска:', 'woocommerce' ); ?></label>
<input type="search" id="s" placeholder="Я ищу..." value="<?php echo get_search_query(); ?>" name="s" required>
<button class="header-search__submit" type="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'woocommerce' ); ?>">
<p>Найти</p>
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3001_6954)"><path d="M13.8292 13.0049L10.3473 9.52294C11.2961 8.36245 11.7627 6.88166 11.6504 5.38685C11.538 3.89204 10.8555 2.49758 9.74388 1.49191C8.63226 0.486236 7.17663 -0.0537076 5.67807 -0.0162391C4.17952 0.0212295 2.75269 0.633244 1.69272 1.69321C0.632756 2.75318 0.0207412 4.18001 -0.0167273 5.67856C-0.0541959 7.17712 0.485748 8.63275 1.49142 9.74436C2.49709 10.856 3.89155 11.5385 5.38636 11.6508C6.88117 11.7632 8.36197 11.2966 9.52245 10.3478L13.0044 13.8297C13.1144 13.9359 13.2617 13.9947 13.4147 13.9934C13.5676 13.9921 13.7139 13.9307 13.8221 13.8226C13.9303 13.7144 13.9916 13.5681 13.9929 13.4152C13.9943 13.2622 13.9355 13.1149 13.8292 13.0049ZM5.83345 10.5006C4.91047 10.5006 4.00822 10.2269 3.24079 9.71413C2.47336 9.20135 1.87522 8.47252 1.52201 7.61979C1.1688 6.76707 1.07639 5.82876 1.25645 4.92352C1.43652 4.01827 1.88097 3.18675 2.53362 2.53411C3.18626 1.88146 4.01778 1.437 4.92303 1.25694C5.82827 1.07688 6.76658 1.16929 7.61931 1.5225C8.47203 1.87571 9.20086 2.47385 9.71364 3.24128C10.2264 4.00871 10.5001 4.91096 10.5001 5.83394C10.4987 7.07119 10.0066 8.25737 9.13175 9.13224C8.25688 10.0071 7.0707 10.4992 5.83345 10.5006Z" fill="white"/></g><defs><clipPath id="clip0_3001_6954"><rect width="14" height="14" fill="white"/></clipPath></defs></svg>
</button>
<input type="hidden" name="post_type" value="product" />
</form>
</div>
<div class="header-bottom__buttons">
<button class="header-cart minicart-open">
<div class="header-cart__icon">
<span class="header-cart__count"><?php echo WC()->cart->get_cart_contents_count(); ?></span>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.7334 2.73438H5.40007L8.94673 19.2944C9.07684 19.9009 9.41429 20.443 9.90101 20.8275C10.3877 21.212 10.9933 21.4148 11.6134 21.401H24.6534C25.2603 21.4001 25.8487 21.1921 26.3214 20.8115C26.7942 20.4309 27.1229 19.9004 27.2534 19.3077L29.4534 9.40104H6.82673M12.0001 28.001C12.0001 28.7374 11.4031 29.3344 10.6667 29.3344C9.93035 29.3344 9.3334 28.7374 9.3334 28.001C9.3334 27.2647 9.93035 26.6677 10.6667 26.6677C11.4031 26.6677 12.0001 27.2647 12.0001 28.001ZM26.6667 28.001C26.6667 28.7374 26.0698 29.3344 25.3334 29.3344C24.597 29.3344 24.0001 28.7374 24.0001 28.001C24.0001 27.2647 24.597 26.6677 25.3334 26.6677C26.0698 26.6677 26.6667 27.2647 26.6667 28.001Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</div>
Корзина
</button>
<?php if ( is_user_logged_in() ) : ?>
<a href="/account" class="header-login"><svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.9997 17.3333C19.6816 17.3333 22.6663 14.3486 22.6663 10.6667C22.6663 6.98477 19.6816 4 15.9997 4C12.3178 4 9.33301 6.98477 9.33301 10.6667C9.33301 14.3486 12.3178 17.3333 15.9997 17.3333ZM15.9997 17.3333C18.8286 17.3333 21.5418 18.4571 23.5421 20.4575C25.5425 22.4579 26.6663 25.171 26.6663 28M15.9997 17.3333C13.1707 17.3333 10.4576 18.4571 8.4572 20.4575C6.45681 22.4579 5.33301 25.171 5.33301 28" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>Аккаунт</a>
<?php else : ?>
<a href="/login" class="header-login"><svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.9997 17.3333C19.6816 17.3333 22.6663 14.3486 22.6663 10.6667C22.6663 6.98477 19.6816 4 15.9997 4C12.3178 4 9.33301 6.98477 9.33301 10.6667C9.33301 14.3486 12.3178 17.3333 15.9997 17.3333ZM15.9997 17.3333C18.8286 17.3333 21.5418 18.4571 23.5421 20.4575C25.5425 22.4579 26.6663 25.171 26.6663 28M15.9997 17.3333C13.1707 17.3333 10.4576 18.4571 8.4572 20.4575C6.45681 22.4579 5.33301 25.171 5.33301 28" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>Войти</a>
<?php endif; ?>
</div>
</div>
</div>
</header>
<div class="minicart__fon"></div>
<div class="minicart">
<h4>Товары в корзине (<span class="header-cart__count"><?php echo WC()->cart->get_cart_contents_count(); ?></span>)</h4>
<?php $cart_count = WC()->cart->get_cart_contents_count();?>
<div class="minicart-products">
<?php
foreach ( WC()->cart->get_cart() as $cart_item ) :
$product = $cart_item['data'];
if ( ! $product || ! $product->exists() ) continue;
// Получаем название товара без вариаций
$product_name = $product->get_name();
if ( $product->is_type('variation') ) {
$parent_product = wc_get_product( $cart_item['product_id'] );
if ( $parent_product ) {
$product_name = $parent_product->get_name();
}
}
?>
<div class="minicart-product" data-product-id="<?php echo $cart_item['product_id']; ?>">
<a href="<?php echo get_permalink( $cart_item['product_id'] ); ?>" class="minicart-product__img">
<img src="<?php echo get_the_post_thumbnail_url( $cart_item['product_id'], 'thumbnail' ); ?>" alt="<?php echo esc_attr( $product_name ); ?>">
</a>
<div class="minicart-product__main">
<a href="<?php echo get_permalink( $cart_item['product_id'] ); ?>" class="minicart-product__title">
<?php
echo $product_name;
// Добавляем количество
$unit = 'ШТ';
if ( isset( $cart_item['orgsteklo_calculator'] ) ) {
$unit = 'ЛИСТ';
}
echo ' <span style="color: #666;">(' . $cart_item['quantity'] . $unit . ')</span>';
?>
</a>
<div class="minicart-product__row">
<?php
// Use same logic as cart.php
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $sale_price === '' ) {
$sale_price = $regular_price;
}
$line_regular = $regular_price * $cart_item['quantity'];
$line_sale = $sale_price * $cart_item['quantity'];
if ( $line_regular > $line_sale ) {
echo '<p class="minicart-product__price">' . wc_price( $line_sale ) . ' <del class="minicart-product__oldprice">' . wc_price( $line_regular ) . '</del></p>';
} else {
echo '<p class="minicart-product__price">' . wc_price( $line_sale ) . '</p>';
}
?>
<button class="minicart-product__delete" data-id="<?php echo $cart_item['product_id']; ?>"><svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1149_35638)"><path d="M17.4993 3.83333H14.916C14.7226 2.89284 14.2109 2.04779 13.4671 1.4406C12.7233 0.833408 11.7929 0.501212 10.8327 0.5L9.16602 0.5C8.20584 0.501212 7.27545 0.833408 6.53164 1.4406C5.78783 2.04779 5.2761 2.89284 5.08268 3.83333H2.49935C2.27834 3.83333 2.06637 3.92113 1.91009 4.07741C1.75381 4.23369 1.66602 4.44565 1.66602 4.66667C1.66602 4.88768 1.75381 5.09964 1.91009 5.25592C2.06637 5.4122 2.27834 5.5 2.49935 5.5H3.33268V16.3333C3.33401 17.438 3.77342 18.497 4.55453 19.2782C5.33565 20.0593 6.39469 20.4987 7.49935 20.5H12.4993C13.604 20.4987 14.6631 20.0593 15.4442 19.2782C16.2253 18.497 16.6647 17.438 16.666 16.3333V5.5H17.4993C17.7204 5.5 17.9323 5.4122 18.0886 5.25592C18.2449 5.09964 18.3327 4.88768 18.3327 4.66667C18.3327 4.44565 18.2449 4.23369 18.0886 4.07741C17.9323 3.92113 17.7204 3.83333 17.4993 3.83333ZM9.16602 2.16667H10.8327C11.3496 2.1673 11.8536 2.32781 12.2757 2.6262C12.6978 2.92459 13.0172 3.34624 13.1902 3.83333H6.80852C6.9815 3.34624 7.30093 2.92459 7.723 2.6262C8.14508 2.32781 8.64912 2.1673 9.16602 2.16667ZM14.9993 16.3333C14.9993 16.9964 14.736 17.6323 14.2671 18.1011C13.7983 18.5699 13.1624 18.8333 12.4993 18.8333H7.49935C6.83631 18.8333 6.20042 18.5699 5.73158 18.1011C5.26274 17.6323 4.99935 16.9964 4.99935 16.3333V5.5H14.9993V16.3333Z" fill="#C4C4C4"/><path d="M8.33333 15.4997C8.55434 15.4997 8.76631 15.4119 8.92259 15.2556C9.07887 15.0993 9.16666 14.8873 9.16666 14.6663V9.66634C9.16666 9.44533 9.07887 9.23337 8.92259 9.07709C8.76631 8.92081 8.55434 8.83301 8.33333 8.83301C8.11232 8.83301 7.90036 8.92081 7.74408 9.07709C7.5878 9.23337 7.5 9.44533 7.5 9.66634V14.6663C7.5 14.8873 7.5878 15.0993 7.74408 15.2556C7.90036 15.4119 8.11232 15.4997 8.33333 15.4997Z" fill="#C4C4C4"/><path d="M11.6673 15.4997C11.8883 15.4997 12.1003 15.4119 12.2566 15.2556C12.4129 15.0993 12.5007 14.8873 12.5007 14.6663V9.66634C12.5007 9.44533 12.4129 9.23337 12.2566 9.07709C12.1003 8.92081 11.8883 8.83301 11.6673 8.83301C11.4463 8.83301 11.2343 8.92081 11.0781 9.07709C10.9218 9.23337 10.834 9.44533 10.834 9.66634V14.6663C10.834 14.8873 10.9218 15.0993 11.0781 15.2556C11.2343 15.4119 11.4463 15.4997 11.6673 15.4997Z" fill="#C4C4C4"/></g><defs><clipPath id="clip0_1149_35638"><rect width="20" height="20" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg></button>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="minicart-bottom">
<div class="minicart-prices">
<p class="minicart-price__title">Стоимость заказа:</p>
<?php
// Use same logic as cart.php
$regular_total = 0;
$sale_total = 0;
foreach ( WC()->cart->get_cart() as $cart_item ) {
$product = $cart_item['data'];
if ( ! $product ) continue;
$quantity = $cart_item['quantity'];
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $sale_price === '' ) {
$sale_price = $regular_price;
}
$regular_total += $regular_price * $quantity;
$sale_total += $sale_price * $quantity;
}
// Применяем скидку от суммы заказа (порог проверяется по сумме СО скидками на товары)
$cart_discount = function_exists('orgsteklo_calculate_cart_discount')
? orgsteklo_calculate_cart_discount( $sale_total )
: array( 'percent' => 0, 'amount' => 0 );
$final_total = $sale_total - $cart_discount['amount'];
if ( $regular_total > $final_total ) {
echo '<p class="minicart-price">' . number_format($final_total, 0, ',', ' ') . ' ₽ <del class="minicart-price__old">' . number_format($regular_total, 0, ',', ' ') . ' ₽</del></p>';
} else {
echo '<p class="minicart-price">' . number_format($final_total, 0, ',', ' ') . ' ₽</p>';
}
?>
</div>
<a href="/cart" class="minicart-link">
<p>Перейти в корзину</p>
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8242 4.44727L15.3767 8.99977L10.8242 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.625 9H15.2475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div>
</div>
<div class="pc_menu__fon"></div>
<div class="pc_menu pc_menu-home <?php if ( is_front_page() ) echo 'active'; ?>">
<?php
function render_product_categories_menu($parent_id = 0)
{
$exclude_term = get_term_by('name', 'Misc', 'product_cat');
$exclude_id = $exclude_term ? $exclude_term->term_id : 0;
$args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $parent_id,
'exclude' => array($exclude_id),
'orderby' => 'menu_order',
'order' => 'ASC',
);
$categories = get_terms($args);
foreach ($categories as $category) {
$child_args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $category->term_id,
);
$children = get_terms($child_args);
$has_children = !empty($children);
echo '<li>';
echo '<a href="' . get_term_link($category) . '" class="pc_menu-link">';
echo '<div class="pc_menu-link__row">';
$icon = get_field('category_icon', 'product_cat_' . $category->term_id);
$icon_url = $icon ? $icon['url'] : get_template_directory_uri() . '/assets/images/catalog_icon.png';
echo '<img src="' . esc_url($icon_url) . '" alt="">';
echo esc_html($category->name);
echo '</div>';
if ($has_children) {
echo '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.96036 4.08984H5.84536H3.04036C2.56036 4.08984 2.32036 4.66984 2.66036 5.00984L5.25036 7.59984C5.66536 8.01484 6.34036 8.01484 6.75536 7.59984L7.74036 6.61484L9.34536 5.00984C9.68036 4.66984 9.44036 4.08984 8.96036 4.08984Z" fill="#808080"/></svg>';
}
echo '</a>';
if ($has_children) {
echo '<ul class="submenu">';
render_product_categories_menu($category->term_id);
echo '</ul>';
}
echo '</li>';
}
}
?>
<nav>
<ul class="topmenu">
<?php render_product_categories_menu(); ?>
</ul>
</nav>
</div>
<div class="menu_mob">
<?php
$logo = get_field('logo', 'option');
if ($logo) {
echo '<a href="/" class="menu_mob-logo">';
echo '<img src="' . esc_url($logo['url']) . '" alt="' . esc_attr($logo['alt']) . '">';
echo '</a>';
}
?>
<button class="menu_mob-close"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1163_32333)"><path d="M19.7561 0.244477C19.5999 0.0882511 19.3879 0.000488281 19.167 0.000488281C18.946 0.000488281 18.7341 0.0882511 18.5778 0.244477L10.0003 8.82198L1.42281 0.244477C1.26654 0.0882511 1.05461 0.000488281 0.833644 0.000488281C0.612674 0.000488281 0.40075 0.0882511 0.244477 0.244477C0.0882511 0.40075 0.000488281 0.612674 0.000488281 0.833644C0.000488281 1.05461 0.0882511 1.26654 0.244477 1.42281L8.82198 10.0003L0.244477 18.5778C0.0882511 18.7341 0.000488281 18.946 0.000488281 19.167C0.000488281 19.3879 0.0882511 19.5999 0.244477 19.7561C0.40075 19.9124 0.612674 20.0001 0.833644 20.0001C1.05461 20.0001 1.26654 19.9124 1.42281 19.7561L10.0003 11.1786L18.5778 19.7561C18.7341 19.9124 18.946 20.0001 19.167 20.0001C19.3879 20.0001 19.5999 19.9124 19.7561 19.7561C19.9124 19.5999 20.0001 19.3879 20.0001 19.167C20.0001 18.946 19.9124 18.7341 19.7561 18.5778L11.1786 10.0003L19.7561 1.42281C19.9124 1.26654 20.0001 1.05461 20.0001 0.833644C20.0001 0.612674 19.9124 0.40075 19.7561 0.244477Z" fill="#D2D2D2"/></g><defs><clipPath id="clip0_1163_32333"><rect width="20" height="20" fill="white"/></clipPath></defs></svg></button>
<div class="menu_mob-column">
<?php
function render_mobile_product_categories($parent_id = 0, &$counter = 1, &$buttons_html = '', &$contents_html = '', $level = 0)
{
$exclude_term = get_term_by('name', 'Misc', 'product_cat');
$exclude_id = $exclude_term ? $exclude_term->term_id : 0;
$args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $parent_id,
'exclude' => array($exclude_id),
'orderby' => 'menu_order',
'order' => 'ASC',
);
$categories = get_terms($args);
foreach ($categories as $category) {
$child_args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $category->term_id,
);
$children = get_terms($child_args);
$has_children = !empty($children);
$icon = get_field('category_icon', 'product_cat_' . $category->term_id);
$icon_url = $icon ? $icon['url'] : get_template_directory_uri() . '/assets/images/catalog_icon.png';
// Только верхний уровень (level 0) идёт в кнопки
if ($level === 0) {
$buttons_html .= '<button class="menu_mob-menu__button" data-content="' . esc_attr($counter) . '">';
$buttons_html .= '<div class="menu_mob-button-row">';
$buttons_html .= '<img src="' . esc_url($icon_url) . '" alt="">';
$buttons_html .= '<p>' . esc_html($category->name) . '</p>';
$buttons_html .= '</div>';
if ($has_children) {
$buttons_html .= '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.08984 3.04013V6.15513V8.96013C4.08984 9.44013 4.66984 9.68013 5.00984 9.34013L7.59984 6.75013C8.01484 6.33513 8.01484 5.66013 7.59984 5.24513L6.61484 4.26013L5.00984 2.65513C4.66984 2.32013 4.08984 2.56013 4.08984 3.04013Z" fill="#808080"/></svg>';
}
$buttons_html .= '</button>';
}
// Генерируем контент
$contents_html .= '<div class="menu_mob-menu__content" data-content="' . esc_attr($counter) . '">';
if ($has_children) {
// Заголовок + кнопка назад
$contents_html .= '<div class="menu_mob-menu__content-name">';
$contents_html .= '<button class="menu_mob-menu__content-back">';
$contents_html .= '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.8333 9.16683H7.5L10.2417 6.42517C10.3198 6.3477 10.3818 6.25553 10.4241 6.15398C10.4664 6.05244 10.4882 5.94351 10.4882 5.8335C10.4882 5.72349 10.4664 5.61457 10.4241 5.51302C10.3818 5.41147 10.3198 5.31931 10.2417 5.24184C10.0855 5.08663 9.87432 4.99951 9.65417 4.99951C9.43401 4.99951 9.2228 5.08663 9.06667 5.24184L5.49167 8.82517C5.17868 9.13629 5.00186 9.55885 5 10.0002C5.00406 10.4386 5.1807 10.8578 5.49167 11.1668L9.06667 14.7502C9.14437 14.8273 9.2365 14.8884 9.33781 14.9299C9.43912 14.9715 9.54762 14.9927 9.65711 14.9923C9.76661 14.9919 9.87496 14.97 9.97597 14.9277C10.077 14.8854 10.1687 14.8237 10.2458 14.746C10.323 14.6683 10.3841 14.5762 10.4256 14.4749C10.4672 14.3735 10.4883 14.265 10.488 14.1555C10.4876 14.0461 10.4656 13.9377 10.4234 13.8367C10.3811 13.7357 10.3194 13.644 10.2417 13.5668L7.5 10.8335H15.8333C16.0543 10.8335 16.2663 10.7457 16.4226 10.5894C16.5789 10.4331 16.6667 10.2212 16.6667 10.0002C16.6667 9.77915 16.5789 9.56719 16.4226 9.41091C16.2663 9.25463 16.0543 9.16683 15.8333 9.16683Z" fill="#374957"></path></svg>';
$contents_html .= '</button>';
$contents_html .= '<h4>' . esc_html($category->name) . '</h4>';
$contents_html .= '</div>';
// Кнопки подкатегорий
foreach ($children as $child) {
$sub_children = get_terms([
'taxonomy' => 'product_cat',
'hide_empty' => false,
'parent' => $child->term_id
]);
$has_sub = !empty($sub_children);
$counter++;
$contents_html .= '<button class="menu_mob-menu__button" data-content="' . esc_attr($counter) . '">';
$contents_html .= '<div class="menu_mob-button-row">';
$contents_html .= '<p>' . esc_html($child->name) . '</p>';
$contents_html .= '</div>';
if ($has_sub) {
$contents_html .= '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.08984 3.04013V6.15513V8.96013C4.08984 9.44013 4.66984 9.68013 5.00984 9.34013L7.59984 6.75013C8.01484 6.33513 8.01484 5.66013 7.59984 5.24513L6.61484 4.26013L5.00984 2.65513C4.66984 2.32013 4.08984 2.56013 4.08984 3.04013Z" fill="#808080"/></svg>';
}
$contents_html .= '</button>';
// Рекурсивно отрисуем подменю для подкатегорий
render_mobile_product_categories($child->term_id, $counter, $buttons_html, $contents_html, $level + 1);
}
} else {
// Если детей нет — это конечная ссылка
$contents_html .= '<div class="menu_mob-menu__content-name">';
$contents_html .= '<a href="' . esc_url(get_term_link($category)) . '">' . esc_html($category->name) . '</a>';
$contents_html .= '</div>';
}
$contents_html .= '</div>';
}
}
?>
<?php
$buttons_html = '';
$contents_html = '';
$counter = 1; // ← сначала создаём переменную
render_mobile_product_categories(0, $counter, $buttons_html, $contents_html); // потом передаём по ссылке
?>
<div class="menu_mob-menu">
<?= $buttons_html ?>
</div>
<?php
$menu_list = wp_get_nav_menu_items('Мобильное меню');
if ($menu_list) {
echo '<nav><ul>';
foreach ($menu_list as $menu_item) {
$class = '';
if (is_page($menu_item->object_id)) {
$class = ' class="active"';
}
echo '<li><a href="' . esc_url($menu_item->url) . '"' . $class . '>' . esc_html($menu_item->title) . '</a></li>';
}
echo '</ul></nav>';
}
?>
<div class="menu_mob-bottom">
<div class="menu_mob-contacts">
<?php
$phone = get_field('phone', 'option');
if ($phone) {
echo '<a href="tel:' . $phone . '"><svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3046_6829)"><path d="M7.02375 1.00005C8.04288 1.10743 8.99483 1.55945 9.72218 2.28134C10.4495 3.00323 10.9087 3.95175 11.0237 4.97005M7.02375 3.00005C7.5155 3.09702 7.96675 3.33956 8.31894 3.6962C8.67112 4.05284 8.90797 4.50711 8.99875 5.00005M10.9987 8.46005V9.96005C10.9993 10.0993 10.9708 10.2371 10.915 10.3647C10.8592 10.4923 10.7774 10.6068 10.6748 10.701C10.5722 10.7951 10.451 10.8668 10.3191 10.9114C10.1872 10.956 10.0474 10.9726 9.90875 10.96C8.37016 10.7929 6.89225 10.2671 5.59375 9.42505C4.38566 8.65738 3.36141 7.63313 2.59375 6.42505C1.74873 5.12065 1.22287 3.63555 1.05875 2.09005C1.04625 1.95178 1.06268 1.81243 1.107 1.68086C1.15131 1.54929 1.22253 1.42839 1.31613 1.32586C1.40973 1.22332 1.52365 1.1414 1.65064 1.08531C1.77763 1.02922 1.91492 1.00018 2.05375 1.00005H3.55375C3.7964 0.99766 4.03164 1.08359 4.21563 1.24181C4.39961 1.40004 4.51978 1.61977 4.55375 1.86005C4.61706 2.34008 4.73447 2.81141 4.90375 3.26505C4.97102 3.44401 4.98558 3.63851 4.9457 3.82549C4.90582 4.01247 4.81318 4.1841 4.67875 4.32005L4.04375 4.95505C4.75552 6.20682 5.79197 7.24327 7.04375 7.95505L7.67875 7.32005C7.81469 7.18562 7.98632 7.09297 8.17331 7.0531C8.36029 7.01322 8.55478 7.02778 8.73375 7.09505C9.18738 7.26432 9.65871 7.38174 10.1387 7.44505C10.3816 7.47931 10.6034 7.60165 10.762 7.7888C10.9206 7.97594 11.0048 8.21484 10.9987 8.46005Z" stroke="#808080" stroke-linecap="round" stroke-linejoin="round"/></g><defs><clipPath id="clip0_3046_6829"><rect width="12" height="12" fill="white"/></clipPath></defs></svg>' . $phone . '</a>';
}
?>
<?php
$email = get_field('email', 'option');
if ($email) {
echo '<a href="mailto:' . $email . '"><svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 3.5L6.515 6.35C6.36064 6.44671 6.18216 6.49801 6 6.49801C5.81784 6.49801 5.63936 6.44671 5.485 6.35L1 3.5M2 2H10C10.5523 2 11 2.44772 11 3V9C11 9.55228 10.5523 10 10 10H2C1.44772 10 1 9.55228 1 9V3C1 2.44772 1.44772 2 2 2Z" stroke="#808080" stroke-linecap="round" stroke-linejoin="round"/></svg>' . $email . '</a>';
}
?>
</div>
<div class="menu_mob-buttons">
<button class="menu_mob-button minicart-open">
<div class="menu_mob-button__icon">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3046_28938)"><path d="M1.3667 1.36719H2.70003L4.47337 9.64719C4.53842 9.95043 4.70715 10.2215 4.95051 10.4138C5.19387 10.606 5.49664 10.7074 5.8067 10.7005H12.3267C12.6301 10.7 12.9244 10.596 13.1607 10.4057C13.3971 10.2154 13.5615 9.95021 13.6267 9.65385L14.7267 4.70052H3.41337M6.00003 14.0005C6.00003 14.3687 5.70156 14.6672 5.33337 14.6672C4.96518 14.6672 4.6667 14.3687 4.6667 14.0005C4.6667 13.6323 4.96518 13.3339 5.33337 13.3339C5.70156 13.3339 6.00003 13.6323 6.00003 14.0005ZM13.3334 14.0005C13.3334 14.3687 13.0349 14.6672 12.6667 14.6672C12.2985 14.6672 12 14.3687 12 14.0005C12 13.6323 12.2985 13.3339 12.6667 13.3339C13.0349 13.3339 13.3334 13.6323 13.3334 14.0005Z" stroke="#2C3846" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></g><defs><clipPath id="clip0_3046_28938"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>
<span class="header-cart__count"><?php echo WC()->cart->get_cart_contents_count(); ?></span>
</div>
Корзина
</button>
<?php if ( is_user_logged_in() ) : ?>
<a href="/account" class="menu_mob-button"><div class="menu_mob-button__icon"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.99984 8.66667C9.84079 8.66667 11.3332 7.17428 11.3332 5.33333C11.3332 3.49238 9.84079 2 7.99984 2C6.15889 2 4.6665 3.49238 4.6665 5.33333C4.6665 7.17428 6.15889 8.66667 7.99984 8.66667ZM7.99984 8.66667C9.41432 8.66667 10.7709 9.22857 11.7711 10.2288C12.7713 11.229 13.3332 12.5855 13.3332 14M7.99984 8.66667C6.58535 8.66667 5.22879 9.22857 4.2286 10.2288C3.22841 11.229 2.6665 12.5855 2.6665 14" stroke="#2C3846" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg></div>Аккаунт</a>
<?php else : ?>
<a href="/login" class="menu_mob-button"><div class="menu_mob-button__icon"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.99984 8.66667C9.84079 8.66667 11.3332 7.17428 11.3332 5.33333C11.3332 3.49238 9.84079 2 7.99984 2C6.15889 2 4.6665 3.49238 4.6665 5.33333C4.6665 7.17428 6.15889 8.66667 7.99984 8.66667ZM7.99984 8.66667C9.41432 8.66667 10.7709 9.22857 11.7711 10.2288C12.7713 11.229 13.3332 12.5855 13.3332 14M7.99984 8.66667C6.58535 8.66667 5.22879 9.22857 4.2286 10.2288C3.22841 11.229 2.6665 12.5855 2.6665 14" stroke="#2C3846" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg></div>Войти</a>
<?php endif; ?>
</div>
</div>
</div>
<?= $contents_html ?>
</div>

View File

@ -0,0 +1,669 @@
<?php
/**
* Админ-панель для управления расчетом цен на оргстекло
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Подключаем jQuery UI Sortable для админки
add_action( 'admin_enqueue_scripts', 'orgsteklo_enqueue_admin_scripts' );
function orgsteklo_enqueue_admin_scripts( $hook ) {
if ( $hook !== 'toplevel_page_orgsteklo-price-calculator' ) {
return;
}
wp_enqueue_script( 'jquery-ui-sortable' );
}
// Добавляем страницу в админку
add_action( 'admin_menu', 'orgsteklo_add_price_calculator_page' );
function orgsteklo_add_price_calculator_page() {
add_menu_page(
'Калькулятор цен на оргстекло',
'Калькулятор цен',
'manage_options',
'orgsteklo-price-calculator',
'orgsteklo_price_calculator_page',
'dashicons-calculator',
30
);
}
// Сохранение данных
add_action( 'admin_init', 'orgsteklo_save_price_calculator_settings' );
function orgsteklo_save_price_calculator_settings() {
if ( ! isset( $_POST['orgsteklo_price_calc_nonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( $_POST['orgsteklo_price_calc_nonce'], 'orgsteklo_price_calc_save' ) ) {
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
// Сохраняем базовую стоимость 1 кг
if ( isset( $_POST['base_price_per_kg'] ) ) {
update_option( 'orgsteklo_base_price_per_kg', floatval( $_POST['base_price_per_kg'] ) );
}
// Сохраняем константы формул
if ( isset( $_POST['material_density'] ) ) {
update_option( 'orgsteklo_material_density', floatval( $_POST['material_density'] ) );
}
if ( isset( $_POST['custom_size_coefficient'] ) ) {
update_option( 'orgsteklo_custom_size_coefficient', floatval( $_POST['custom_size_coefficient'] ) );
}
// Сохраняем таблицы (динамическое количество)
$tables = [];
$table_count = isset( $_POST['table_count'] ) ? intval( $_POST['table_count'] ) : 5;
for ( $table_num = 1; $table_num <= $table_count; $table_num++ ) {
if ( ! isset( $_POST["table_{$table_num}_name"] ) ) {
continue;
}
$table_data = [
'name' => sanitize_text_field( $_POST["table_{$table_num}_name"] ),
'rows' => []
];
// Получаем строки таблицы
if ( isset( $_POST["table_{$table_num}_rows"] ) && is_array( $_POST["table_{$table_num}_rows"] ) ) {
foreach ( $_POST["table_{$table_num}_rows"] as $row ) {
$table_data['rows'][] = [
'thickness' => floatval( $row['thickness'] ?? 0 ),
'width' => floatval( $row['width'] ?? 0 ),
'length' => floatval( $row['length'] ?? 0 ),
'k1' => floatval( $row['k1'] ?? 1 ),
'k2' => floatval( $row['k2'] ?? 1 ),
'k3' => floatval( $row['k3'] ?? 1 ),
'k4' => floatval( $row['k4'] ?? 1 ),
'k5' => floatval( $row['k5'] ?? 1 ),
'n' => floatval( $row['n'] ?? 0 ),
];
}
}
$tables[ $table_num ] = $table_data;
}
update_option( 'orgsteklo_price_tables', $tables );
update_option( 'orgsteklo_price_tables_count', $table_count );
// Редирект с сообщением об успехе
wp_redirect( add_query_arg( 'settings-updated', 'true', wp_get_referer() ) );
exit;
}
// Страница админки
function orgsteklo_price_calculator_page() {
// Получаем сохраненные данные
$base_price = get_option( 'orgsteklo_base_price_per_kg', 300 );
$tables = get_option( 'orgsteklo_price_tables', [] );
$table_count = get_option( 'orgsteklo_price_tables_count', 5 );
// Названия таблиц по умолчанию
$default_table_names = [
1 => 'Оргстекло прозрачное, бесцветное',
2 => 'Оргстекло прозрачное, цветное',
3 => 'Оргстекло глухое, сатинированное',
4 => 'Оргстекло флуоресцентное, день/ночь, зеркальное',
5 => 'Оргстекло с особыми свойствами',
];
// Генерируем названия для дополнительных таблиц
for ( $i = 6; $i <= $table_count; $i++ ) {
$default_table_names[$i] = "Таблица {$i}";
}
?>
<div class="wrap">
<h1>Калькулятор цен на оргстекло</h1>
<?php if ( isset( $_GET['settings-updated'] ) ) : ?>
<div class="notice notice-success is-dismissible">
<p>Настройки сохранены!</p>
</div>
<?php endif; ?>
<form method="post" action="">
<?php wp_nonce_field( 'orgsteklo_price_calc_save', 'orgsteklo_price_calc_nonce' ); ?>
<!-- Базовая стоимость и константы -->
<h2>Основные параметры</h2>
<table class="form-table">
<tr>
<th scope="row">
<label for="base_price_per_kg">Базовая стоимость 1 кг (руб.)</label>
</th>
<td>
<input
type="number"
step="0.01"
name="base_price_per_kg"
id="base_price_per_kg"
value="<?php echo esc_attr( $base_price ); ?>"
class="regular-text"
>
<p class="description">При изменении этого значения пересчитываются все цены</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="material_density">Плотность материала (г/см³)</label>
</th>
<td>
<input
type="number"
step="0.01"
name="material_density"
id="material_density"
value="<?php echo esc_attr( get_option( 'orgsteklo_material_density', 1.19 ) ); ?>"
class="regular-text"
>
<p class="description">По умолчанию: 1.19 г/см³</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="custom_size_coefficient">Коэффициент отходов при нарезке</label>
</th>
<td>
<input
type="number"
step="0.01"
name="custom_size_coefficient"
id="custom_size_coefficient"
value="<?php echo esc_attr( get_option( 'orgsteklo_custom_size_coefficient', 1.2 ) ); ?>"
class="regular-text"
>
<p class="description">Множитель для нестандартных размеров. По умолчанию: 1.2</p>
</td>
</tr>
</table>
<hr>
<!-- Таблицы коэффициентов -->
<h2>Таблицы стандартных размеров, коэффициентов и надбавок</h2>
<input type="hidden" name="table_count" id="table_count" value="<?php echo esc_attr( $table_count ); ?>">
<div id="tables-container">
<?php for ( $table_num = 1; $table_num <= $table_count; $table_num++ ) : ?>
<?php
$table_name = $tables[ $table_num ]['name'] ?? $default_table_names[ $table_num ];
$rows = $tables[ $table_num ]['rows'] ?? [];
?>
<div class="orgsteklo-table-section" style="margin-bottom: 40px; padding: 20px; background: #f9f9f9; border: 1px solid #ddd;">
<h3>Таблица <?php echo $table_num; ?></h3>
<table class="form-table">
<tr>
<th scope="row">
<label for="table_<?php echo $table_num; ?>_name">Название таблицы</label>
</th>
<td>
<input
type="text"
name="table_<?php echo $table_num; ?>_name"
id="table_<?php echo $table_num; ?>_name"
value="<?php echo esc_attr( $table_name ); ?>"
class="large-text"
>
</td>
</tr>
</table>
<h4>Строки данных</h4>
<table class="wp-list-table widefat fixed striped" style="margin-top: 10px;">
<thead>
<tr>
<th>Толщина (мм)</th>
<th>Ширина (мм)</th>
<th>Длина (мм)</th>
<th>K1</th>
<th>K2</th>
<th>K3</th>
<th>K4</th>
<th>K5</th>
<th>N (надбавка, руб)</th>
<th>Действия</th>
</tr>
</thead>
<tbody class="table-rows" data-table="<?php echo $table_num; ?>">
<?php if ( ! empty( $rows ) ) : ?>
<?php foreach ( $rows as $index => $row ) : ?>
<tr>
<td><input type="number" step="0.1" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][thickness]" value="<?php echo esc_attr( $row['thickness'] ); ?>" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][width]" value="<?php echo esc_attr( $row['width'] ); ?>" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][length]" value="<?php echo esc_attr( $row['length'] ); ?>" style="width: 80px;"></td>
<td><input type="number" step="0.001" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][k1]" value="<?php echo esc_attr( $row['k1'] ); ?>" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][k2]" value="<?php echo esc_attr( $row['k2'] ); ?>" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][k3]" value="<?php echo esc_attr( $row['k3'] ); ?>" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][k4]" value="<?php echo esc_attr( $row['k4'] ); ?>" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][k5]" value="<?php echo esc_attr( $row['k5'] ); ?>" style="width: 70px;"></td>
<td><input type="number" step="1" name="table_<?php echo $table_num; ?>_rows[<?php echo $index; ?>][n]" value="<?php echo esc_attr( $row['n'] ); ?>" style="width: 80px;"></td>
<td>
<button type="button" class="button copy-row" style="margin-right: 5px;">Копировать</button>
<button type="button" class="button delete-row">Удалить</button>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
<div style="margin-top: 10px;">
<button type="button" class="button add-row" data-table="<?php echo $table_num; ?>">Добавить строку</button>
<button type="button" class="button copy-table" data-table="<?php echo $table_num; ?>" style="margin-left: 10px;">Копировать всю таблицу в буфер</button>
<button type="button" class="button paste-table" data-table="<?php echo $table_num; ?>" style="margin-left: 10px;">Вставить скопированную таблицу</button>
</div>
</div>
<?php endfor; ?>
</div>
<div style="margin: 20px 0;">
<button type="button" id="add-table-btn" class="button button-secondary" style="font-size: 14px; padding: 8px 15px;">+ Добавить таблицу</button>
<p class="description" style="margin-top: 10px;">По умолчанию: 5 таблиц. Нажмите кнопку для добавления новой таблицы.</p>
</div>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="Сохранить изменения">
</p>
</form>
</div>
<script>
jQuery(document).ready(function($) {
// Добавление новой таблицы
$('#add-table-btn').on('click', function() {
var currentCount = parseInt($('#table_count').val());
var newTableNum = currentCount + 1;
var newTableHtml = `
<div class="orgsteklo-table-section" style="margin-bottom: 40px; padding: 20px; background: #f9f9f9; border: 1px solid #ddd;">
<h3>Таблица ${newTableNum}</h3>
<table class="form-table">
<tr>
<th scope="row">
<label for="table_${newTableNum}_name">Название таблицы</label>
</th>
<td>
<input type="text" name="table_${newTableNum}_name" id="table_${newTableNum}_name" value="Таблица ${newTableNum}" class="large-text">
</td>
</tr>
</table>
<h4>Строки данных</h4>
<table class="wp-list-table widefat fixed striped" style="margin-top: 10px;">
<thead>
<tr>
<th>Толщина (мм)</th>
<th>Ширина (мм)</th>
<th>Длина (мм)</th>
<th>K1</th>
<th>K2</th>
<th>K3</th>
<th>K4</th>
<th>K5</th>
<th>N (надбавка, руб)</th>
<th>Действия</th>
</tr>
</thead>
<tbody class="table-rows" data-table="${newTableNum}">
</tbody>
</table>
<div style="margin-top: 10px;">
<button type="button" class="button add-row" data-table="${newTableNum}">Добавить строку</button>
<button type="button" class="button copy-table" data-table="${newTableNum}" style="margin-left: 10px;">Копировать всю таблицу в буфер</button>
<button type="button" class="button paste-table" data-table="${newTableNum}" style="margin-left: 10px;">Вставить скопированную таблицу</button>
</div>
</div>
`;
$('#tables-container').append(newTableHtml);
$('#table_count').val(newTableNum);
// Инициализируем sortable для новой таблицы
$(`.table-rows[data-table="${newTableNum}"]`).sortable({
handle: 'td:first-child',
cursor: 'move',
axis: 'y',
helper: function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index) {
$(this).width($originals.eq(index).width());
});
return $helper;
},
update: function(event, ui) {
$(this).find('tr').each(function(index) {
$(this).find('input').each(function() {
var name = $(this).attr('name');
if (name) {
var newName = name.replace(/\[\d+\]/, '[' + index + ']');
$(this).attr('name', newName);
}
});
});
}
});
alert('Таблица ' + newTableNum + ' добавлена! Не забудьте сохранить изменения.');
});
// Инициализация drag & drop для сортировки строк
$('.table-rows').sortable({
handle: 'td:first-child',
cursor: 'move',
axis: 'y',
helper: function(e, tr) {
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index) {
$(this).width($originals.eq(index).width());
});
return $helper;
},
update: function(event, ui) {
// Обновляем индексы строк после перестановки
$(this).find('tr').each(function(index) {
$(this).find('input').each(function() {
var name = $(this).attr('name');
if (name) {
var newName = name.replace(/\[\d+\]/, '[' + index + ']');
$(this).attr('name', newName);
}
});
});
}
});
// Добавление строки
$('.add-row').on('click', function() {
var tableNum = $(this).data('table');
var tbody = $('.table-rows[data-table="' + tableNum + '"]');
var rowCount = tbody.find('tr').length;
var newRow = `
<tr>
<td><input type="number" step="0.1" name="table_${tableNum}_rows[${rowCount}][thickness]" value="2" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][width]" value="2050" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][length]" value="3050" style="width: 80px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k1]" value="1" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k2]" value="1" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k3]" value="1" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k4]" value="1" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k5]" value="1" style="width: 70px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][n]" value="0" style="width: 80px;"></td>
<td>
<button type="button" class="button copy-row" style="margin-right: 5px;">Копировать</button>
<button type="button" class="button delete-row">Удалить</button>
</td>
</tr>
`;
tbody.append(newRow);
});
// Копирование строки
$(document).on('click', '.copy-row', function() {
var $row = $(this).closest('tr');
var $tbody = $row.closest('tbody');
var tableNum = $tbody.data('table');
var rowCount = $tbody.find('tr').length;
// Получаем значения из текущей строки
var thickness = $row.find('input[name*="[thickness]"]').val();
var width = $row.find('input[name*="[width]"]').val();
var length = $row.find('input[name*="[length]"]').val();
var k1 = $row.find('input[name*="[k1]"]').val();
var k2 = $row.find('input[name*="[k2]"]').val();
var k3 = $row.find('input[name*="[k3]"]').val();
var k4 = $row.find('input[name*="[k4]"]').val();
var k5 = $row.find('input[name*="[k5]"]').val();
var n = $row.find('input[name*="[n]"]').val();
var newRow = `
<tr>
<td><input type="number" step="0.1" name="table_${tableNum}_rows[${rowCount}][thickness]" value="${thickness}" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][width]" value="${width}" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][length]" value="${length}" style="width: 80px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k1]" value="${k1}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k2]" value="${k2}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k3]" value="${k3}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k4]" value="${k4}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${rowCount}][k5]" value="${k5}" style="width: 70px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${rowCount}][n]" value="${n}" style="width: 80px;"></td>
<td>
<button type="button" class="button copy-row" style="margin-right: 5px;">Копировать</button>
<button type="button" class="button delete-row">Удалить</button>
</td>
</tr>
`;
$row.after(newRow);
alert('Строка скопирована! Новая строка добавлена после текущей.');
});
// Копирование всей таблицы в буфер обмена
$(document).on('click', '.copy-table', function() {
var tableNum = $(this).data('table');
var $tbody = $('.table-rows[data-table="' + tableNum + '"]');
var rows = [];
$tbody.find('tr').each(function() {
var $row = $(this);
rows.push({
thickness: $row.find('input[name*="[thickness]"]').val(),
width: $row.find('input[name*="[width]"]').val(),
length: $row.find('input[name*="[length]"]').val(),
k1: $row.find('input[name*="[k1]"]').val(),
k2: $row.find('input[name*="[k2]"]').val(),
k3: $row.find('input[name*="[k3]"]').val(),
k4: $row.find('input[name*="[k4]"]').val(),
k5: $row.find('input[name*="[k5]"]').val(),
n: $row.find('input[name*="[n]"]').val()
});
});
// Сохраняем в localStorage
localStorage.setItem('orgsteklo_copied_table', JSON.stringify(rows));
alert('Таблица скопирована в буфер! Используйте кнопку "Вставить скопированную таблицу" в другой таблице чтобы вставить данные.');
});
// Вставка скопированной таблицы
$(document).on('click', '.paste-table', function() {
var tableNum = $(this).data('table');
var $tbody = $('.table-rows[data-table="' + tableNum + '"]');
var copiedData = localStorage.getItem('orgsteklo_copied_table');
if (!copiedData) {
alert('Буфер пуст! Сначала скопируйте таблицу используя кнопку "Копировать всю таблицу в буфер".');
return;
}
if (!confirm('Это заменит все строки в текущей таблице. Продолжить?')) {
return;
}
var rows = JSON.parse(copiedData);
$tbody.empty();
rows.forEach(function(row, index) {
var newRow = `
<tr>
<td><input type="number" step="0.1" name="table_${tableNum}_rows[${index}][thickness]" value="${row.thickness}" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${index}][width]" value="${row.width}" style="width: 80px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${index}][length]" value="${row.length}" style="width: 80px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${index}][k1]" value="${row.k1}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${index}][k2]" value="${row.k2}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${index}][k3]" value="${row.k3}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${index}][k4]" value="${row.k4}" style="width: 70px;"></td>
<td><input type="number" step="0.001" name="table_${tableNum}_rows[${index}][k5]" value="${row.k5}" style="width: 70px;"></td>
<td><input type="number" step="1" name="table_${tableNum}_rows[${index}][n]" value="${row.n}" style="width: 80px;"></td>
<td>
<button type="button" class="button copy-row" style="margin-right: 5px;">Копировать</button>
<button type="button" class="button delete-row">Удалить</button>
</td>
</tr>
`;
$tbody.append(newRow);
});
alert('Таблица вставлена! Не забудьте сохранить изменения.');
});
// Удаление строки
$(document).on('click', '.delete-row', function() {
if (confirm('Вы уверены что хотите удалить эту строку?')) {
$(this).closest('tr').remove();
}
});
});
</script>
<style>
.orgsteklo-table-section table input[type="number"] {
padding: 3px 5px;
}
/* Стили для drag & drop */
.table-rows tr {
cursor: move;
}
.table-rows tr:hover {
background-color: #f0f0f0;
}
.table-rows tr.ui-sortable-helper {
background-color: #fff;
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.table-rows tr.ui-sortable-placeholder {
background-color: #e3f2fd;
visibility: visible !important;
height: 50px;
}
.table-rows tr td:first-child {
position: relative;
}
.table-rows tr td:first-child::before {
content: '⋮⋮';
position: absolute;
left: -15px;
top: 50%;
transform: translateY(-50%);
color: #999;
font-size: 14px;
line-height: 1;
}
</style>
<?php
}
/**
* Добавляем поле "Номер таблицы" в карточку товара
*/
// Отображение поля в админке товара
add_action( 'woocommerce_product_options_general_product_data', 'orgsteklo_add_price_table_field' );
function orgsteklo_add_price_table_field() {
global $post;
// Получаем названия таблиц
$tables = get_option( 'orgsteklo_price_tables', [] );
$table_count = get_option( 'orgsteklo_price_tables_count', 5 );
$options = [
'' => '-- Не выбрано --'
];
$default_names = [
1 => 'Оргстекло прозрачное, бесцветное',
2 => 'Оргстекло прозрачное, цветное',
3 => 'Оргстекло глухое, сатинированное',
4 => 'Оргстекло флуоресцентное, день/ночь, зеркальное',
5 => 'Оргстекло с особыми свойствами',
];
for ( $i = 1; $i <= $table_count; $i++ ) {
$name = $tables[ $i ]['name'] ?? ( $default_names[$i] ?? "Таблица {$i}" );
$options[ $i ] = "Таблица {$i}: {$name}";
}
echo '<div class="options_group">';
woocommerce_wp_select(
[
'id' => '_orgsteklo_price_table',
'label' => 'Таблица расчета цен',
'description' => 'Выберите таблицу для расчета цен на оргстекло. Данные берутся из "Калькулятор цен" в меню.',
'desc_tip' => true,
'options' => $options,
]
);
woocommerce_wp_textarea_input(
[
'id' => '_orgsteklo_important_text',
'label' => 'Текст "Важно"',
'description' => 'Информационный текст под калькулятором. Оставьте пустым для стандартного текста.',
'desc_tip' => true,
'placeholder' => 'Важно: оргстекло толщиной более 6 мм...',
]
);
echo '</div>';
}
// Сохранение поля
add_action( 'woocommerce_process_product_meta', 'orgsteklo_save_price_table_field' );
function orgsteklo_save_price_table_field( $post_id ) {
$table_number = isset( $_POST['_orgsteklo_price_table'] ) ? sanitize_text_field( $_POST['_orgsteklo_price_table'] ) : '';
update_post_meta( $post_id, '_orgsteklo_price_table', $table_number );
$important_text = isset( $_POST['_orgsteklo_important_text'] ) ? wp_kses_post( $_POST['_orgsteklo_important_text'] ) : '';
update_post_meta( $post_id, '_orgsteklo_important_text', $important_text );
// Автоматически создаем вариации из таблицы калькулятора
if ( ! empty( $table_number ) && function_exists( 'orgsteklo_create_variations_from_table' ) ) {
$result = orgsteklo_create_variations_from_table( $post_id );
// Выводим alert с результатом
add_action( 'admin_notices', function() use ( $result ) {
$class = $result['success'] ? 'notice-success' : 'notice-error';
$message = $result['message'];
echo "<div class='notice $class is-dismissible'><p><strong>Вариации калькулятора:</strong> $message</p></div>";
// Дополнительно выводим JS alert для гарантии
echo "<script>alert('Вариации калькулятора: $message');</script>";
} );
}
}
// Отображение поля в вариациях (если нужно для вариативных товаров)
add_action( 'woocommerce_product_after_variable_attributes', 'orgsteklo_add_variation_price_table_field', 10, 3 );
function orgsteklo_add_variation_price_table_field( $loop, $variation_data, $variation ) {
// Получаем значение для родительского товара (вариации наследуют таблицу от родителя)
$parent_id = wp_get_post_parent_id( $variation->ID );
$parent_table = get_post_meta( $parent_id, '_orgsteklo_price_table', true );
if ( $parent_table ) {
echo '<div style="padding: 10px; background: #f0f0f0; margin: 10px 0;">';
echo '<strong>Таблица расчета цен:</strong> Таблица ' . esc_html( $parent_table ) . ' (наследуется от родительского товара)';
echo '</div>';
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="page">
<div class="page-container container">
<h1><?php echo the_title(); ?></h1>
<div class="page-main">
<?php echo the_content(); ?>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

View File

@ -0,0 +1,232 @@
<!--
Template Name: Шаблон О компании
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<?php
$aboutus_title = get_field('aboutus_title');
$aboutus_subtitle = get_field('aboutus_subtitle');
$aboutus_description = get_field('aboutus_description');
$aboutus_button = get_field('aboutus_button');
$aboutus_link = get_field('aboutus_link');
$aboutus_img = get_field('aboutus_img');
if($aboutus_title) {
?>
<section class="aboutus">
<div class="aboutus-container container">
<?php
if($aboutus_title) {
echo '<h1>' . $aboutus_title . '</h1>';
}
?>
<div class="aboutus-main">
<div class="aboutus-col">
<?php
if($aboutus_subtitle) {
echo '<h3>' . $aboutus_subtitle . '</h3>';
}
if($aboutus_description) {
echo '<p>' . $aboutus_description . '</p>';
}
if($aboutus_link) {
echo '<a href="' . $aboutus_link . '" class="aboutus-link" target="_blank"><p>' . $aboutus_button . '</p><svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8242 4.44727L15.3767 8.99977L10.8242 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.625 9H15.2475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></a>';
}
?>
</div>
<?php
if($aboutus_img) {
echo '<img src="' . esc_url($aboutus_img['url']) . '" alt="' . esc_attr($aboutus_img['alt']) . '">';
}
?>
</div>
</div>
</section>
<?php
}
?>
<?php get_template_part( 'blocks/block', 'why' ); ?>
<?php
$partners_title = get_field('partners_title');
$partners_repeats = get_field('partners_repeat');
if($partners_repeats) {
?>
<section class="partners">
<div class="partners-container">
<?php
if($partners_title) {
echo '<h2 class="container">' . $partners_title . '</h2>';
}
if($partners_repeats) {
echo '<div class="partners-slider"><div class="partners-swiper swiper"><div class="swiper-wrapper">';
foreach ($partners_repeats as $partners_repeat) {
$partners_repeat_title = $partners_repeat['partners_repeat_title'];
$partners_repeat_link = $partners_repeat['partners_repeat_link'];
$partners_repeat_img = $partners_repeat['partners_repeat_img'];
echo '<div class="swiper-slide">';
echo '<div class="partners-slide">';
if($partners_repeat_title) {
echo '<p class="partners-slide__title">' . $partners_repeat_title . '</p>';
}
if($partners_repeat_link) {
echo '<a href="' . $partners_repeat_link . '" class="partners-slide__img" target="_blank">';
if($partners_repeat_img) {
echo '<img src="' . esc_url($partners_repeat_img['url']) . '" alt="' . esc_attr($partners_repeat_img['alt']) . '">';
}
echo '</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div></div><div class="partners-navigation"><button class="partners-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0605 13.28L5.71388 8.9333C5.20055 8.41997 5.20055 7.57997 5.71388 7.06664L10.0605 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="partners-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.93945 13.28L10.2861 8.9333C10.7995 8.41997 10.7995 7.57997 10.2861 7.06664L5.93945 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>';
}
?>
</div>
</section>
<?php
}
?>
<?php
$history_title = get_field('history_title');
$history_repeats = get_field('history_repeat');
if($history_repeats) {
?>
<section class="history">
<div class="history-container container">
<?php
if($history_title) {
echo '<h2>' . $history_title . '</h2>';
}
if($history_repeats) {
echo '<div class="history-slider"><div class="history-swiper swiper"><div class="swiper-wrapper">';
foreach ($history_repeats as $history_repeat) {
$history_repeat_img = $history_repeat['history_repeat_img'];
$history_repeat_title = $history_repeat['history_repeat_title'];
$history_repeat_subtitle = $history_repeat['history_repeat_subtitle'];
$history_repeat_description = $history_repeat['history_repeat_description'];
echo '<div class="swiper-slide">';
echo '<div class="history-slide">';
if($history_repeat_img) {
echo '<img src="' . esc_url($history_repeat_img['url']) . '" alt="' . esc_attr($history_repeat_img['alt']) . '">';
}
echo '<div class="history-slide__col">';
if($history_repeat_title) {
echo '<h2>' . $history_repeat_title . '</h2>';
}
if($history_repeat_subtitle) {
echo '<h4>' . $history_repeat_subtitle . '</h4>';
}
if($history_repeat_description) {
echo '<p>' . $history_repeat_description . '</p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div></div><div class="history-navigation"><button class="history-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0605 13.28L5.71388 8.9333C5.20055 8.41997 5.20055 7.57997 5.71388 7.06664L10.0605 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="history-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.93945 13.28L10.2861 8.9333C10.7995 8.41997 10.7995 7.57997 10.2861 7.06664L5.93945 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>';
}
?>
</div>
</section>
<?php
}
?>
<?php
$projects_title = get_field('projects_title');
$projects_repeats = get_field('projects_repeat');
if($projects_repeats) {
?>
<section class="projects">
<div class="projects-container container">
<?php
if($projects_title) {
echo '<h2>' . $projects_title . '</h2>';
}
if ($projects_repeats) {
$total_projects = count($projects_repeats);
echo '<div class="projects-main"><div class="projects-grid">';
$index = 0;
foreach ($projects_repeats as $projects_repeat) {
$projects_repeat_img = $projects_repeat['projects_repeat_img'];
$projects_repeat_tags = $projects_repeat['projects_repeat_tag'];
$projects_repeat_title = $projects_repeat['projects_repeat_title'];
$projects_repeat_description = $projects_repeat['projects_repeat_description'];
$extra_class = ($index >= 6) ? ' hidden' : '';
echo '<div class="projects-item' . $extra_class . '">';
if ($projects_repeat_img) {
echo '<img src="' . esc_url($projects_repeat_img['url']) . '" alt="' . esc_attr($projects_repeat_img['alt']) . '">';
}
echo '<div class="projects-item__main">';
if ($projects_repeat_tags) {
echo '<div class="projects-item__row">';
foreach ($projects_repeat_tags as $projects_repeat_tag) {
$projects_repeat_tag_p = $projects_repeat_tag['projects_repeat_tag_p'];
echo '<p>' . $projects_repeat_tag_p . '</p>';
}
echo '</div>';
}
if ($projects_repeat_title) {
echo '<h4>' . $projects_repeat_title . '</h4>';
}
if ($projects_repeat_description) {
echo '<p>' . $projects_repeat_description . '</p>';
}
echo '</div>';
echo '</div>';
$index++;
}
echo '</div>';
if ($total_projects >= 6) {
echo '<button class="projects-more projects-more_page"><p>Загрузить еще</p><svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3011_12506)"><path d="M8.00079 1.83333C8.88512 1.83624 9.76011 2.01449 10.5751 2.35779C11.3901 2.70109 12.1289 3.20261 12.7488 3.83333H10.6675C10.4906 3.83333 10.3211 3.90357 10.196 4.0286C10.071 4.15362 10.0008 4.32319 10.0008 4.5C10.0008 4.67681 10.071 4.84638 10.196 4.97141C10.3211 5.09643 10.4906 5.16667 10.6675 5.16667H13.4295C13.7577 5.16649 14.0725 5.036 14.3047 4.80387C14.5368 4.57174 14.6673 4.25695 14.6675 3.92867V1.16667C14.6675 0.989857 14.5972 0.820287 14.4722 0.695263C14.3472 0.570239 14.1776 0.500001 14.0008 0.500001V0.500001C13.824 0.500001 13.6544 0.570239 13.5294 0.695263C13.4044 0.820287 13.3341 0.989857 13.3341 1.16667V2.552C12.2322 1.55964 10.8758 0.893607 9.41685 0.6285C7.95786 0.363393 6.45387 0.509676 5.07331 1.05097C3.69275 1.59226 2.49013 2.50718 1.60013 3.69328C0.710124 4.87939 0.167881 6.28983 0.0341194 7.76667C0.0255083 7.85951 0.0363299 7.95312 0.0658947 8.04155C0.0954594 8.12997 0.143119 8.21127 0.205837 8.28026C0.268555 8.34925 0.344956 8.40442 0.430171 8.44225C0.515387 8.48008 0.60755 8.49975 0.700786 8.5V8.5C0.863845 8.50208 1.02181 8.44323 1.14376 8.33497C1.26571 8.2267 1.34286 8.07682 1.36012 7.91467C1.50853 6.25517 2.2721 4.71114 3.50084 3.58589C4.72958 2.46065 6.33466 1.83553 8.00079 1.83333Z" fill="white"/><path d="M15.3013 8.50018C15.1383 8.4981 14.9803 8.55695 14.8583 8.66521C14.7364 8.77347 14.6592 8.92335 14.642 9.08551C14.5318 10.3543 14.0599 11.5649 13.2824 12.5737C12.5049 13.5824 11.4544 14.3469 10.2554 14.7766C9.05647 15.2062 7.75945 15.2829 6.51822 14.9976C5.27699 14.7123 4.14365 14.0769 3.25265 13.1669H5.33398C5.5108 13.1669 5.68036 13.0966 5.80539 12.9716C5.93041 12.8466 6.00065 12.677 6.00065 12.5002C6.00065 12.3234 5.93041 12.1538 5.80539 12.0288C5.68036 11.9038 5.5108 11.8335 5.33398 11.8335H2.57198C2.40938 11.8334 2.24836 11.8654 2.09812 11.9276C1.94788 11.9898 1.81137 12.0809 1.69639 12.1959C1.58141 12.3109 1.49023 12.4474 1.42804 12.5977C1.36586 12.7479 1.3339 12.9089 1.33398 13.0715V15.8335C1.33398 16.0103 1.40422 16.1799 1.52925 16.3049C1.65427 16.43 1.82384 16.5002 2.00065 16.5002C2.17746 16.5002 2.34703 16.43 2.47206 16.3049C2.59708 16.1799 2.66732 16.0103 2.66732 15.8335V14.4482C3.7692 15.4406 5.12559 16.1066 6.58459 16.3717C8.04358 16.6368 9.54757 16.4905 10.9281 15.9492C12.3087 15.4079 13.5113 14.493 14.4013 13.3069C15.2913 12.1208 15.8336 10.7104 15.9673 9.23351C15.9759 9.14067 15.9651 9.04706 15.9355 8.95863C15.906 8.87021 15.8583 8.78891 15.7956 8.71992C15.7329 8.65093 15.6565 8.59576 15.5713 8.55793C15.4861 8.52009 15.3939 8.50042 15.3007 8.50018H15.3013Z" fill="white"/></g><defs><clipPath id="clip0_3011_12506"><rect width="16" height="16" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg></button>';
}
echo '</div>';
}
if($projects_repeats) {
echo '<div class="projects-slider"><div class="projects-swiper swiper"><div class="swiper-wrapper">';
foreach ($projects_repeats as $projects_repeat) {
$projects_repeat_img = $projects_repeat['projects_repeat_img'];
$projects_repeat_tags = $projects_repeat['projects_repeat_tag'];
$projects_repeat_title = $projects_repeat['projects_repeat_title'];
$projects_repeat_description = $projects_repeat['projects_repeat_description'];
echo '<div class="swiper-slide">';
echo '<div class="projects-item">';
if($projects_repeat_img) {
echo '<img src="' . esc_url($projects_repeat_img['url']) . '" alt="' . esc_attr($projects_repeat_img['alt']) . '">';
}
echo '<div class="projects-item__main">';
if($projects_repeat_tags) {
echo '<div class="projects-item__row">';
foreach ($projects_repeat_tags as $projects_repeat_tag) {
$projects_repeat_tag_p = $projects_repeat_tag['projects_repeat_tag_p'];
echo '<p>' . $projects_repeat_tag_p . '</p>';
}
echo '</div>';
}
if($projects_repeat_title) {
echo '<h4>' . $projects_repeat_title . '</h4>';
}
if($projects_repeat_description) {
echo '<p>' . $projects_repeat_description . '</p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div></div><div class="projects-navigation"><button class="projects-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0605 13.28L5.71388 8.9333C5.20055 8.41997 5.20055 7.57997 5.71388 7.06664L10.0605 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="projects-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.93945 13.28L10.2861 8.9333C10.7995 8.41997 10.7995 7.57997 10.2861 7.06664L5.93945 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div></div>';
}
?>
</div>
</section>
<?php
}
?>
<?php get_template_part( 'blocks/block', 'info' ); ?>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,8 @@
<!--
Template Name: Шаблон Личный кабинет
-->
<?php get_header(); ?>
<main>
<?php echo do_shortcode('[woocommerce_my_account]'); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,126 @@
<!--
Template Name: Шаблон Корзина
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<?php echo do_shortcode('[woocommerce_cart]'); ?>
<?php
// Рекомендуемые товары для корзины
$cart_product_ids = array();
$cart_categories = array();
if ( WC()->cart && ! WC()->cart->is_empty() ) {
foreach ( WC()->cart->get_cart() as $item ) {
$cart_product_ids[] = $item['product_id'];
$terms = wp_get_post_terms( $item['product_id'], 'product_cat', array( 'fields' => 'ids' ) );
$cart_categories = array_merge( $cart_categories, $terms );
}
$cart_categories = array_unique( $cart_categories );
}
$rec_args = array(
'post_type' => 'product',
'posts_per_page' => 8,
'post__not_in' => $cart_product_ids,
'ignore_sticky_posts' => 1,
'post_status' => array( 'publish', 'draft' ),
'orderby' => 'rand',
'meta_query' => array(
array(
'key' => '_is_recommended_product',
'value' => 'yes',
),
),
);
if ( ! empty( $cart_categories ) ) {
$rec_args['tax_query'] = array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $cart_categories,
'operator' => 'IN',
),
);
}
$rec_query = new WP_Query( $rec_args );
$rec_ids = wp_list_pluck( $rec_query->posts, 'ID' );
$remaining = 8 - count( $rec_ids );
$random_products = array();
if ( $remaining > 0 ) {
$exclude = array_merge( $cart_product_ids, $rec_ids );
$rand_args = array(
'post_type' => 'product',
'posts_per_page' => $remaining,
'post__not_in' => $exclude,
'ignore_sticky_posts' => 1,
'post_status' => array( 'publish', 'draft' ),
'orderby' => 'rand',
);
if ( ! empty( $cart_categories ) ) {
$rand_args['tax_query'] = array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $cart_categories,
'operator' => 'IN',
),
);
}
$rand_query = new WP_Query( $rand_args );
$random_products = $rand_query->posts;
}
$all_products = array_merge( $rec_query->posts, $random_products );
if ( ! empty( $all_products ) ) :
global $post;
?>
<section class="cart_more">
<div class="cart_more-container container">
<div class="cart_more-name">
<h2>Рекомендуемые товары</h2>
<a href="/catalog" class="cart_more-link">
Все товары
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0007 9.99989C14.9966 9.56147 14.8199 9.14231 14.509 8.83323L10.934 5.2499C10.7778 5.09469 10.5666 5.00757 10.3465 5.00757C10.1263 5.00757 9.91512 5.09469 9.75898 5.2499C9.68088 5.32736 9.61888 5.41953 9.57657 5.52108C9.53427 5.62263 9.51249 5.73155 9.51249 5.84156C9.51249 5.95157 9.53427 6.06049 9.57657 6.16204C9.61888 6.26359 9.68088 6.35576 9.75898 6.43323L12.5007 9.16656H4.16732C3.9463 9.16656 3.73434 9.25435 3.57806 9.41064C3.42178 9.56692 3.33398 9.77888 3.33398 9.99989C3.33398 10.2209 3.42178 10.4329 3.57806 10.5891C3.73434 10.7454 3.9463 10.8332 4.16732 10.8332H12.5007L9.75898 13.5749C9.60206 13.7307 9.51347 13.9425 9.51269 14.1636C9.51191 14.3847 9.599 14.5971 9.75482 14.7541C9.91063 14.911 10.1224 14.9996 10.3435 15.0003C10.5647 15.0011 10.7771 14.914 10.934 14.7582L14.509 11.1749C14.822 10.8638 14.9988 10.4412 15.0007 9.99989Z" fill="#02ADEF"/></svg>
</a>
</div>
<div class="products-slider">
<div class="products-swiper swiper">
<div class="swiper-wrapper">
<?php foreach ( $all_products as $related_product ) :
$post = $related_product;
setup_postdata( $post ); ?>
<div class="swiper-slide">
<?php wc_get_template_part( 'content', 'product' ); ?>
</div>
<?php endforeach;
wp_reset_postdata(); ?>
</div>
</div>
<button class="products-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0596 13.28L5.7129 8.9333C5.19957 8.41997 5.19957 7.57997 5.7129 7.06664L10.0596 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
<button class="products-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.94043 13.28L10.2871 8.9333C10.8004 8.41997 10.8004 7.57997 10.2871 7.06664L5.94043 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
</div>
<div class="cart_more-mob">
<div class="products-mob">
<?php foreach ( $all_products as $related_product ) :
$post = $related_product;
setup_postdata( $post );
wc_get_template_part( 'content', 'product' );
endforeach;
wp_reset_postdata(); ?>
</div>
<a href="/catalog" class="cart_more-mob__link">Все товары</a>
</div>
</div>
</section>
<?php endif; ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,15 @@
<!--
Template Name: Шаблон Оформление заказа
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<?php echo do_shortcode('[woocommerce_checkout]'); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,112 @@
<!--
Template Name: Шаблон Контакты
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<?php
$contacts_time = get_field('contacts_time');
$contacts_time2 = get_field('contacts_time2');
$contacts_repeats = get_field('contacts_repeat');
$contacts_map = get_field('contacts_map');
$phone = get_field('phone', 'option');
$email = get_field('email', 'option');
?>
<section class="contacts">
<div class="contacts-container container">
<h1><?php echo the_title(); ?></h1>
<div class="contacts-main">
<div class="contacts-grid">
<div class="contacts-row">
<?php
if($phone) {
echo '<div class="contacts-item">';
echo '<p>Телефон:</p>';
echo '<div class="contacts-item__row">';
echo '<img src="/wp-content/uploads/2025/05/contacts-1.svg" alt="">';
echo '<div class="contacts-item__col">';
echo '<a href="tel:' . $phone . '">' . $phone . '</a>';
echo '</div>';
echo '</div>';
echo '</div>';
}
if($email) {
echo '<div class="contacts-item">';
echo '<p>Почта:</p>';
echo '<div class="contacts-item__row">';
echo '<img src="/wp-content/uploads/2025/05/contacts-2.svg" alt="">';
echo '<div class="contacts-item__col">';
echo '<a href="mailto:' . $email . '">' . $email . '</a>';
echo '</div>';
echo '</div>';
echo '</div>';
}
if($contacts_time) {
echo '<div class="contacts-item">';
echo '<p>Часы работы:</p>';
echo '<div class="contacts-item__row">';
echo '<img src="/wp-content/uploads/2025/05/contacts-3.svg" alt="">';
echo '<div class="contacts-item__col">';
if($contacts_time) {
echo '<div class="contacts-time">' . $contacts_time . '</div>';
}
if($contacts_time2) {
echo '<p>' . $contacts_time2 . '</p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
?>
</div>
<?php
if($contacts_repeats) {
echo '<div class="contacts-row2">';
foreach ($contacts_repeats as $contacts_repeat) {
$contacts_repeat_title = $contacts_repeat['contacts_repeat_title'];
$contacts_repeat_address = $contacts_repeat['contacts_repeat_address'];
$contacts_repeat_description = $contacts_repeat['contacts_repeat_description'];
$contacts_repeat_link = $contacts_repeat['contacts_repeat_link'];
echo '<div class="contacts-item">';
if($contacts_repeat_title) {
echo '<p>' . $contacts_repeat_title . '</p>';
}
echo '<div class="contacts-item__row">';
echo '<img src="/wp-content/uploads/2025/05/contacts-4.svg" alt="">';
echo '<div class="contacts-item__col">';
if($contacts_repeat_address) {
echo '<div class="contacts-address">';
echo '<p>' . $contacts_repeat_address . '</p>';
echo '</div>';
}
if($contacts_repeat_description) {
echo '<p>' . $contacts_repeat_description . '</p>';
}
if($contacts_repeat_link) {
echo '<a href="' . $contacts_repeat_link . '" class="link-more" target="_blank">Показать на карте<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.9997 10C14.9956 9.56159 14.819 9.14243 14.508 8.83335L10.933 5.25002C10.7769 5.09481 10.5657 5.00769 10.3455 5.00769C10.1254 5.00769 9.91414 5.09481 9.75801 5.25002C9.6799 5.32749 9.61791 5.41965 9.5756 5.5212C9.53329 5.62275 9.51151 5.73167 9.51151 5.84168C9.51151 5.95169 9.53329 6.06061 9.5756 6.16216C9.61791 6.26371 9.6799 6.35588 9.75801 6.43335L12.4997 9.16668H4.16634C3.94533 9.16668 3.73337 9.25448 3.57709 9.41076C3.42081 9.56704 3.33301 9.779 3.33301 10C3.33301 10.221 3.42081 10.433 3.57709 10.5893C3.73337 10.7455 3.94533 10.8333 4.16634 10.8333H12.4997L9.75801 13.575C9.60109 13.7308 9.51249 13.9426 9.51171 14.1637C9.51093 14.3849 9.59803 14.5973 9.75384 14.7542C9.90966 14.9111 10.1214 14.9997 10.3426 15.0005C10.5637 15.0013 10.7761 14.9142 10.933 14.7583L14.508 11.175C14.821 10.8639 14.9978 10.4413 14.9997 10Z" fill="#02ADEF"></path></svg></a>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div>';
}
?>
</div>
<?php
if($contacts_map) {
echo '<div class="contacts-map">' . $contacts_map . '</div>';
}
?>
</div>
</div>
</section>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,23 @@
<!--
Template Name: Шаблон Доставка
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="payment delivery">
<div class="payment-container container">
<h1><?php echo the_title(); ?></h1>
<div class="payment-main">
<?php echo the_content(); ?>
</div>
</div>
</section>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,121 @@
<!--
Template Name: Шаблон Документация
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<?php
$documentation_title = get_field('documentation_title');
$documentation_repeats = get_field('documentation_repeat');
if($documentation_repeats) {
?>
<section class="documentation">
<div class="documentation-container container">
<?php
if($documentation_title) {
echo '<h1>' . $documentation_title . '</h1>';
}
?>
<?php
if($documentation_repeats) {
?>
<div class="documentation-main">
<div class="documentation-tabs">
<?php
$first_tab = true;
foreach ($documentation_repeats as $documentation_repeat) {
$documentation_repeat_title = $documentation_repeat['documentation_repeat_title'];
$active_tab = $first_tab ? ' active' : '';
echo '<button class="documentation-tab' . $active_tab . '">' . $documentation_repeat_title . '</button>';
$first_tab = false;
}
?>
</div>
<div class="documentation-mob">
<?php $first_title = !empty($documentation_repeats) ? $documentation_repeats[0]['documentation_repeat_title'] : ''; ?>
<button class="documentation-mob__button">
<p><?php echo $first_title; ?></p>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9485 5.45312H7.79512H4.05512C3.41512 5.45312 3.09512 6.22646 3.54845 6.67979L7.00179 10.1331C7.55512 10.6865 8.45512 10.6865 9.00845 10.1331L10.3218 8.81979L12.4618 6.67979C12.9085 6.22646 12.5885 5.45312 11.9485 5.45312Z" fill="#2C3846"/></svg>
</button>
<div class="documentation-mob__content">
<?php
$first_tab2 = true;
foreach ($documentation_repeats as $documentation_repeat) {
$documentation_repeat_title = $documentation_repeat['documentation_repeat_title'];
$active_tab2 = $first_tab2 ? ' active' : '';
echo '<button class="documentation-mob__item' . $active_tab2 . '"><p>' . $documentation_repeat_title . '</p><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.00065 1.3335C4.32732 1.3335 1.33398 4.32683 1.33398 8.00016C1.33398 11.6735 4.32732 14.6668 8.00065 14.6668C11.674 14.6668 14.6673 11.6735 14.6673 8.00016C14.6673 4.32683 11.674 1.3335 8.00065 1.3335ZM11.1873 6.46683L7.40732 10.2468C7.31398 10.3402 7.18732 10.3935 7.05398 10.3935C6.92065 10.3935 6.79398 10.3402 6.70065 10.2468L4.81398 8.36016C4.62065 8.16683 4.62065 7.84683 4.81398 7.6535C5.00732 7.46016 5.32732 7.46016 5.52065 7.6535L7.05398 9.18683L10.4807 5.76016C10.674 5.56683 10.994 5.56683 11.1873 5.76016C11.3807 5.9535 11.3807 6.26683 11.1873 6.46683Z" fill="#02ADEF"/></svg></button>';
$first_tab2 = false;
}
?>
</div>
</div>
<?php
$first_tab3 = true;
foreach ($documentation_repeats as $documentation_repeat) {
$documentation_repeat_title = $documentation_repeat['documentation_repeat_title'];
$documentation_repeat_repeats = $documentation_repeat['documentation_repeat_repeat'];
$active_tab3 = $first_tab3 ? ' active' : '';
echo '<div class="documentation-content' . $active_tab3 . '">';
echo '<h2>' . $documentation_repeat_title . '</h2>';
echo '<div class="documentation-col">';
echo '<div class="documentation-items">';
$count = count($documentation_repeat_repeats);
foreach ($documentation_repeat_repeats as $index => $documentation_repeat_repeat) {
$documentation_repeat_repeat_title = $documentation_repeat_repeat['documentation_repeat_repeat_title'];
$documentation_repeat_repeat_format = $documentation_repeat_repeat['documentation_repeat_repeat_format'];
$documentation_repeat_repeat_razmer = $documentation_repeat_repeat['documentation_repeat_repeat_razmer'];
$documentation_repeat_repeat_file = $documentation_repeat_repeat['documentation_repeat_repeat_file'];
$documentation_repeat_repeat_file_url = $documentation_repeat_repeat_file ? esc_url($documentation_repeat_repeat_file['url']) : '';
$item_class = ($index < 18) ? 'documentation-item' : 'documentation-item hidden';
echo '<div class="' . $item_class . '">';
echo '<a href="' . $documentation_repeat_repeat_file_url . '" class="documentation-item__title">' . $documentation_repeat_repeat_title . '</a>';
echo '<div class="documentation-item__row">';
echo '<div class="documentation-item__info">';
if($documentation_repeat_repeat_format) {
echo '<p>' . $documentation_repeat_repeat_format . '</p>';
}
if($documentation_repeat_repeat_razmer) {
echo '<p>' . $documentation_repeat_repeat_razmer . '</p>';
}
echo '</div>';
echo '<a href="' . $documentation_repeat_repeat_file_url . '" class="documentation-item__download" download=""><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3011_8559)"><path d="M6.58516 12.0813C6.77089 12.2672 6.99143 12.4146 7.23416 12.5152C7.4769 12.6158 7.73707 12.6676 7.99983 12.6676C8.26258 12.6676 8.52275 12.6158 8.76549 12.5152C9.00822 12.4146 9.22876 12.2672 9.41449 12.0813L11.5552 9.94067C11.6699 9.81373 11.7315 9.64752 11.7271 9.47644C11.7227 9.30536 11.6527 9.14253 11.5316 9.02165C11.4104 8.90077 11.2474 8.8311 11.0764 8.82707C10.9053 8.82304 10.7392 8.88496 10.6125 9L8.66182 10.9513L8.66649 0.666667C8.66649 0.489856 8.59625 0.320286 8.47123 0.195262C8.34621 0.0702379 8.17664 0 7.99983 0V0C7.82301 0 7.65344 0.0702379 7.52842 0.195262C7.4034 0.320286 7.33316 0.489856 7.33316 0.666667L7.32716 10.9387L5.38716 9C5.26206 8.875 5.09244 8.8048 4.91559 8.80486C4.73874 8.80493 4.56916 8.87524 4.44416 9.00033C4.31915 9.12543 4.24896 9.29506 4.24902 9.4719C4.24909 9.64875 4.3194 9.81833 4.44449 9.94333L6.58516 12.0813Z" fill="#02ADEF"/><path d="M15.3333 10.6665C15.1565 10.6665 14.987 10.7367 14.8619 10.8618C14.7369 10.9868 14.6667 11.1564 14.6667 11.3332V13.9998C14.6667 14.1766 14.5964 14.3462 14.4714 14.4712C14.3464 14.5963 14.1768 14.6665 14 14.6665H2C1.82319 14.6665 1.65362 14.5963 1.5286 14.4712C1.40357 14.3462 1.33333 14.1766 1.33333 13.9998V11.3332C1.33333 11.1564 1.2631 10.9868 1.13807 10.8618C1.01305 10.7367 0.843478 10.6665 0.666667 10.6665C0.489856 10.6665 0.320286 10.7367 0.195262 10.8618C0.0702379 10.9868 0 11.1564 0 11.3332L0 13.9998C0 14.5303 0.210714 15.039 0.585786 15.414C0.960859 15.7891 1.46957 15.9998 2 15.9998H14C14.5304 15.9998 15.0391 15.7891 15.4142 15.414C15.7893 15.039 16 14.5303 16 13.9998V11.3332C16 11.1564 15.9298 10.9868 15.8047 10.8618C15.6797 10.7367 15.5101 10.6665 15.3333 10.6665Z" fill="#02ADEF"/></g><defs><clipPath id="clip0_3011_8559"><rect width="16" height="16" fill="white"/></clipPath></defs></svg></a>'; // оставить SVG как есть
echo '</div>';
echo '<div class="documentation-item__mob">';
echo '<a href="' . esc_url($documentation_repeat_repeat_file['url']) . '" class="documentation-item__title">' . $documentation_repeat_repeat_title . '</a>';
echo '<div class="documentation-item__info">';
if($documentation_repeat_repeat_format) {
echo '<p>' . $documentation_repeat_repeat_format . '</p>';
}
if($documentation_repeat_repeat_razmer) {
echo '<p>' . $documentation_repeat_repeat_razmer . '</p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div>';
if ($count > 18) {
echo '<button class="categories-more documentation-more">Загрузить еще<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3004_541)"><path d="M7.99981 1.83327C8.88415 1.83617 9.75913 2.01443 10.5741 2.35773C11.3891 2.70103 12.1279 3.20255 12.7478 3.83327H10.6665C10.4897 3.83327 10.3201 3.90351 10.1951 4.02854C10.07 4.15356 9.99981 4.32313 9.99981 4.49994C9.99981 4.67675 10.07 4.84632 10.1951 4.97134C10.3201 5.09637 10.4897 5.16661 10.6665 5.16661H13.4285C13.7568 5.16643 14.0715 5.03594 14.3037 4.80381C14.5358 4.57168 14.6663 4.25689 14.6665 3.92861V1.16661C14.6665 0.989796 14.5962 0.820226 14.4712 0.695202C14.3462 0.570178 14.1766 0.49994 13.9998 0.49994V0.49994C13.823 0.49994 13.6534 0.570178 13.5284 0.695202C13.4034 0.820226 13.3331 0.989796 13.3331 1.16661V2.55194C12.2313 1.55958 10.8749 0.893546 9.41587 0.628439C7.95688 0.363332 6.45289 0.509614 5.07233 1.0509C3.69177 1.5922 2.48915 2.50712 1.59915 3.69322C0.709148 4.87932 0.166904 6.28977 0.0331428 7.76661C0.0245317 7.85945 0.0353533 7.95306 0.0649181 8.04149C0.0944829 8.12991 0.142143 8.21121 0.20486 8.2802C0.267578 8.34919 0.343979 8.40436 0.429195 8.44219C0.514411 8.48002 0.606573 8.49969 0.699809 8.49994V8.49994C0.862868 8.50202 1.02083 8.44317 1.14278 8.3349C1.26473 8.22664 1.34189 8.07676 1.35914 7.91461C1.50755 6.25511 2.27113 4.71108 3.49986 3.58583C4.7286 2.46059 6.33369 1.83547 7.99981 1.83327Z" fill="white"></path><path d="M15.3003 8.50005C15.1373 8.49798 14.9793 8.55683 14.8574 8.66509C14.7354 8.77335 14.6583 8.92323 14.641 9.08539C14.5308 10.3542 14.059 11.5648 13.2814 12.5735C12.5039 13.5823 11.4534 14.3468 10.2544 14.7764C9.0555 15.2061 7.75847 15.2828 6.51724 14.9975C5.27601 14.7122 4.14267 14.0768 3.25167 13.1667H5.33301C5.50982 13.1667 5.67939 13.0965 5.80441 12.9715C5.92944 12.8464 5.99967 12.6769 5.99967 12.5001C5.99967 12.3233 5.92944 12.1537 5.80441 12.0287C5.67939 11.9036 5.50982 11.8334 5.33301 11.8334H2.57101C2.40841 11.8333 2.24738 11.8653 2.09714 11.9275C1.9469 11.9896 1.81039 12.0808 1.69541 12.1958C1.58044 12.3108 1.48925 12.4473 1.42707 12.5975C1.36488 12.7478 1.33292 12.9088 1.33301 13.0714V15.8334C1.33301 16.0102 1.40325 16.1798 1.52827 16.3048C1.65329 16.4298 1.82286 16.5001 1.99967 16.5001C2.17649 16.5001 2.34605 16.4298 2.47108 16.3048C2.5961 16.1798 2.66634 16.0102 2.66634 15.8334V14.4481C3.76823 15.4404 5.12462 16.1065 6.58361 16.3716C8.0426 16.6367 9.54659 16.4904 10.9272 15.9491C12.3077 15.4078 13.5103 14.4929 14.4003 13.3068C15.2903 12.1207 15.8326 10.7102 15.9663 9.23339C15.975 9.14055 15.9641 9.04694 15.9346 8.95851C15.905 8.87008 15.8573 8.78879 15.7946 8.7198C15.7319 8.65081 15.6555 8.59564 15.5703 8.5578C15.4851 8.51997 15.3929 8.5003 15.2997 8.50005H15.3003Z" fill="white"></path></g><defs><clipPath id="clip0_3004_541"><rect width="16" height="16" fill="white" transform="translate(0 0.5)"></rect></clipPath></defs></svg></button>';
}
echo '</div>';
echo '</div>';
$first_tab3 = false;
}
?>
</div>
<?php
}
?>
</div>
</section>
<?php
}
?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,248 @@
<!--
Template Name: Шаблон Главная
-->
<?php get_header(); ?>
<main>
<?php
$home_sliders = get_field('home_slider');
$home_advantages = get_field('home_advantage');
if($home_sliders) {
?>
<section class="banner">
<div class="banner-container container">
<div class="banner-main">
<?php
if($home_sliders) {
echo '<div class="banner-slider"><div class="banner-swiper swiper"><div class="swiper-wrapper">';
foreach ($home_sliders as $home_slider) {
$home_slider_fon = $home_slider['home_slider_fon'];
$home_slider_date = $home_slider['home_slider_date'];
$home_slider_title = $home_slider['home_slider_title'];
$home_slider_text = $home_slider['home_slider_text'];
$home_slider_link = $home_slider['home_slider_link'];
echo '<div class="swiper-slide">';
echo '<div class="banner-slide">';
if($home_slider_fon) {
echo '<img class="banner-slide__img" src="' . esc_url($home_slider_fon['url']) . '" alt="' . esc_attr($home_slider_fon['alt']) . '">';
}
if($home_slider_date) {
echo '<h4>' . $home_slider_date . '</h4>';
}
if($home_slider_title) {
echo '<h2>' . $home_slider_title . '</h2>';
}
if($home_slider_link) {
echo '<a href="' . $home_slider_link . '" class="banner-slide__link">' . $home_slider_text . '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8232 4.44727L15.3757 8.99977L10.8232 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.625 9H15.2475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></a>';
}
echo '</div>';
echo '</div>';
}
echo '</div></div><button class="banner-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0596 13.2802L5.7129 8.93355C5.19957 8.42021 5.19957 7.58021 5.7129 7.06688L10.0596 2.72021" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="banner-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.94043 13.2802L10.2871 8.93355C10.8004 8.42021 10.8004 7.58021 10.2871 7.06688L5.94043 2.72021" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div>';
}
?>
<?php
if($home_advantages) {
echo '<div class="banner-grid">';
foreach ($home_advantages as $home_advantage) {
$home_advantage_icon = $home_advantage['home_advantage_icon'];
$home_advantage_title = $home_advantage['home_advantage_title'];
echo '<div class="banner-item">';
if($home_advantage_icon) {
echo '<img src="' . esc_url($home_advantage_icon['url']) . '" alt="' . esc_attr($home_advantage_icon['alt']) . '">';
}
if($home_advantage_title) {
echo '<p>' . $home_advantage_title . '</p>';
}
echo '</div>';
}
echo '</div>';
}
?>
</div>
</div>
</section>
<?php
}
?>
<?php
$home_production_title = get_field('home_production_title');
if($home_production_title) {
?>
<section class="categories">
<div class="categories-container container">
<?php
if($home_production_title) {
echo '<h2>' . $home_production_title . '</h2>';
}
?>
<div class="categories-main">
<div class="categories-grid">
<?php
$categories = get_terms([
'taxonomy' => 'product_cat',
'parent' => 0,
'hide_empty' => false,
]);
if (!empty($categories) && !is_wp_error($categories)) {
$count = 0;
foreach ($categories as $category) {
if ($category->name === 'Misc') {
continue;
}
$count++;
$is_hidden = $count > 6 ? ' hidden' : '';
$thumb_id = get_term_meta($category->term_id, 'thumbnail_id', true);
$thumb_url = $thumb_id ? wp_get_attachment_image_url($thumb_id, 'full') : '/wp-content/uploads/woocommerce-placeholder.png';
$term_link = get_term_link($category);
?>
<div class="categories-item<?php echo esc_attr($is_hidden); ?>">
<a href="<?php echo esc_url($term_link); ?>" class="categories-item__img">
<img src="<?php echo esc_url($thumb_url); ?>" alt="<?php echo esc_attr($category->name); ?>">
</a>
<div class="categories-item__main">
<a href="<?php echo esc_url($term_link); ?>" class="categories-item__title">
<?php echo esc_html($category->name); ?>
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_305_8960)"><path d="M23.12 10.41L19.25 6.50002C19.157 6.40629 19.0464 6.3319 18.9246 6.28113C18.8027 6.23036 18.672 6.20422 18.54 6.20422C18.408 6.20422 18.2773 6.23036 18.1554 6.28113C18.0336 6.3319 17.923 6.40629 17.83 6.50002C17.6437 6.68738 17.5392 6.94084 17.5392 7.20502C17.5392 7.46921 17.6437 7.72266 17.83 7.91002L21.39 11.5H1C0.734784 11.5 0.48043 11.6054 0.292893 11.7929C0.105357 11.9805 0 12.2348 0 12.5H0C0 12.7652 0.105357 13.0196 0.292893 13.2071C0.48043 13.3947 0.734784 13.5 1 13.5H21.45L17.83 17.11C17.7363 17.203 17.6619 17.3136 17.6111 17.4354C17.5603 17.5573 17.5342 17.688 17.5342 17.82C17.5342 17.952 17.5603 18.0827 17.6111 18.2046C17.6619 18.3265 17.7363 18.4371 17.83 18.53C17.923 18.6238 18.0336 18.6981 18.1554 18.7489C18.2773 18.7997 18.408 18.8258 18.54 18.8258C18.672 18.8258 18.8027 18.7997 18.9246 18.7489C19.0464 18.6981 19.157 18.6238 19.25 18.53L23.12 14.65C23.6818 14.0875 23.9974 13.325 23.9974 12.53C23.9974 11.735 23.6818 10.9725 23.12 10.41Z" fill="#02ADEF"/></g><defs><clipPath id="clip0_305_8960"><rect width="24" height="24" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg>
</a>
</div>
</div>
<?php
}
}
?>
</div>
<?php if (count($categories) > 6): ?>
<button class="categories-more" id="home_categories_more">
Показать еще
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3004_541)"><path d="M7.99981 1.83327C8.88415 1.83617 9.75913 2.01443 10.5741 2.35773C11.3891 2.70103 12.1279 3.20255 12.7478 3.83327H10.6665C10.4897 3.83327 10.3201 3.90351 10.1951 4.02854C10.07 4.15356 9.99981 4.32313 9.99981 4.49994C9.99981 4.67675 10.07 4.84632 10.1951 4.97134C10.3201 5.09637 10.4897 5.16661 10.6665 5.16661H13.4285C13.7568 5.16643 14.0715 5.03594 14.3037 4.80381C14.5358 4.57168 14.6663 4.25689 14.6665 3.92861V1.16661C14.6665 0.989796 14.5962 0.820226 14.4712 0.695202C14.3462 0.570178 14.1766 0.49994 13.9998 0.49994V0.49994C13.823 0.49994 13.6534 0.570178 13.5284 0.695202C13.4034 0.820226 13.3331 0.989796 13.3331 1.16661V2.55194C12.2313 1.55958 10.8749 0.893546 9.41587 0.628439C7.95688 0.363332 6.45289 0.509614 5.07233 1.0509C3.69177 1.5922 2.48915 2.50712 1.59915 3.69322C0.709148 4.87932 0.166904 6.28977 0.0331428 7.76661C0.0245317 7.85945 0.0353533 7.95306 0.0649181 8.04149C0.0944829 8.12991 0.142143 8.21121 0.20486 8.2802C0.267578 8.34919 0.343979 8.40436 0.429195 8.44219C0.514411 8.48002 0.606573 8.49969 0.699809 8.49994V8.49994C0.862868 8.50202 1.02083 8.44317 1.14278 8.3349C1.26473 8.22664 1.34189 8.07676 1.35914 7.91461C1.50755 6.25511 2.27113 4.71108 3.49986 3.58583C4.7286 2.46059 6.33369 1.83547 7.99981 1.83327Z" fill="white"/><path d="M15.3003 8.50005C15.1373 8.49798 14.9793 8.55683 14.8574 8.66509C14.7354 8.77335 14.6583 8.92323 14.641 9.08539C14.5308 10.3542 14.059 11.5648 13.2814 12.5735C12.5039 13.5823 11.4534 14.3468 10.2544 14.7764C9.0555 15.2061 7.75847 15.2828 6.51724 14.9975C5.27601 14.7122 4.14267 14.0768 3.25167 13.1667H5.33301C5.50982 13.1667 5.67939 13.0965 5.80441 12.9715C5.92944 12.8464 5.99967 12.6769 5.99967 12.5001C5.99967 12.3233 5.92944 12.1537 5.80441 12.0287C5.67939 11.9036 5.50982 11.8334 5.33301 11.8334H2.57101C2.40841 11.8333 2.24738 11.8653 2.09714 11.9275C1.9469 11.9896 1.81039 12.0808 1.69541 12.1958C1.58044 12.3108 1.48925 12.4473 1.42707 12.5975C1.36488 12.7478 1.33292 12.9088 1.33301 13.0714V15.8334C1.33301 16.0102 1.40325 16.1798 1.52827 16.3048C1.65329 16.4298 1.82286 16.5001 1.99967 16.5001C2.17649 16.5001 2.34605 16.4298 2.47108 16.3048C2.5961 16.1798 2.66634 16.0102 2.66634 15.8334V14.4481C3.76823 15.4404 5.12462 16.1065 6.58361 16.3716C8.0426 16.6367 9.54659 16.4904 10.9272 15.9491C12.3077 15.4078 13.5103 14.4929 14.4003 13.3068C15.2903 12.1207 15.8326 10.7102 15.9663 9.23339C15.975 9.14055 15.9641 9.04694 15.9346 8.95851C15.905 8.87008 15.8573 8.78879 15.7946 8.7198C15.7319 8.65081 15.6555 8.59564 15.5703 8.5578C15.4851 8.51997 15.3929 8.5003 15.2997 8.50005H15.3003Z" fill="white"/></g><defs><clipPath id="clip0_3004_541"><rect width="16" height="16" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg>
</button>
<?php endif; ?>
</div>
</div>
</section>
<?php
}
?>
<?php
$home_popular_title = get_field('home_popular_title');
if($home_popular_title) {
?>
<section class="products">
<div class="products-container container">
<?php
if($home_popular_title) {
echo '<h2>' . $home_popular_title . '</h2>';
}
?>
<div class="products-slider">
<div class="products-swiper swiper">
<div class="swiper-wrapper">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 4,
'orderby' => 'rand',
'post_status' => array( 'publish', 'draft' ),
'ignore_sticky_posts' => 1,
'tax_query' => array(
array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => 'popular',
),
),
);
$random_products = new WP_Query( $args );
if ( $random_products->have_posts() ) :
while ( $random_products->have_posts() ) : $random_products->the_post();
echo '<div class="swiper-slide">';
wc_get_template_part( 'content', 'product' );
echo '</div>';
endwhile;
wp_reset_postdata();
endif;
?>
</div>
</div>
<button class="products-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0596 13.28L5.7129 8.9333C5.19957 8.41997 5.19957 7.57997 5.7129 7.06664L10.0596 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
<button class="products-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.94043 13.28L10.2871 8.9333C10.8004 8.41997 10.8004 7.57997 10.2871 7.06664L5.94043 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
</div>
<div class="products-mob">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 4,
'orderby' => 'rand',
'post_status' => array( 'publish', 'draft' ),
'ignore_sticky_posts' => 1,
'tax_query' => array(
array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => 'popular',
),
),
);
$random_products = new WP_Query( $args );
if ( $random_products->have_posts() ) :
while ( $random_products->have_posts() ) : $random_products->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
wp_reset_postdata();
endif;
?>
</div>
</div>
</section>
<?php
}
?>
<?php
$home_about_title = get_field('home_about_title');
$home_about_subtitle = get_field('home_about_subtitle');
$home_about_description = get_field('home_about_description');
$home_about_link = get_field('home_about_link');
$home_about_img = get_field('home_about_img');
if($home_about_title) {
?>
<section class="about">
<div class="about-container container">
<?php
if($home_about_img) {
echo '<img src="' . esc_url($home_about_img['url']) . '" alt="' . esc_attr($home_about_img['alt']) . '">';
}
?>
<div class="about-main">
<?php
if($home_about_title) {
echo '<h2>' . $home_about_title . '</h2>';
}
if($home_about_subtitle) {
echo '<p class="about-subtitle">' . $home_about_subtitle . '</p>';
}
if($home_about_description) {
echo '<p class="about-description">' . $home_about_description . '</p>';
}
if($home_about_link) {
echo '<a href="' . $home_about_link . '" class="link-more">Подробнее о нас<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.9997 10C14.9956 9.56159 14.819 9.14243 14.508 8.83335L10.933 5.25002C10.7769 5.09481 10.5657 5.00769 10.3455 5.00769C10.1254 5.00769 9.91414 5.09481 9.75801 5.25002C9.6799 5.32749 9.61791 5.41965 9.5756 5.5212C9.53329 5.62275 9.51151 5.73167 9.51151 5.84168C9.51151 5.95169 9.53329 6.06061 9.5756 6.16216C9.61791 6.26371 9.6799 6.35588 9.75801 6.43335L12.4997 9.16668H4.16634C3.94533 9.16668 3.73337 9.25448 3.57709 9.41076C3.42081 9.56704 3.33301 9.779 3.33301 10C3.33301 10.221 3.42081 10.433 3.57709 10.5893C3.73337 10.7455 3.94533 10.8333 4.16634 10.8333H12.4997L9.75801 13.575C9.60109 13.7308 9.51249 13.9426 9.51171 14.1637C9.51093 14.3849 9.59803 14.5973 9.75384 14.7542C9.90966 14.9111 10.1214 14.9997 10.3426 15.0005C10.5637 15.0013 10.7761 14.9142 10.933 14.7583L14.508 11.175C14.821 10.8639 14.9978 10.4413 14.9997 10Z" fill="#02ADEF"/></svg></a>';
}
?>
</div>
</div>
</section>
<?php
}
?>
<?php get_template_part( 'blocks/block', 'why' ); ?>
<?php get_template_part( 'blocks/block', 'info' ); ?>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<style>
.pc_menu__fon.active {
display: none !important;
}
body.hidden {
overflow: auto;
}
</style>
<?php get_footer(); ?>

View File

@ -0,0 +1,57 @@
<!--
Template Name: Шаблон Вход
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="login">
<div class="login-container container">
<div class="login-name">
<h1>Вход</h1>
<p>Войдите в аккаунт, чтобы управлять своими личными данными и следить за состоянием заказов.</p>
</div>
<div class="login-main">
<form action="" class="login-form" id="login-form">
<div class="login-form__inputs">
<div class="login-form__input">
<input type="tel" class="phone" placeholder="+7 (999) 999-99-99" autocomplete="tel" required>
</div>
<div class="login-form__input">
<input type="password" id="login-password" placeholder="Пароль" autocomplete="current-password" required>
<button class="login-password__button" type="button">
<img src="/wp-content/uploads/2025/05/password-2.svg" alt="">
</button>
</div>
<div class="login-form__row">
<div class="login-form__remember">
<input type="checkbox" id="login-form__remember" name="login-form__remember" checked required>
<label for="login-form__remember">Запомнить меня</label>
</div>
<a href="/password-recovery" class="login-form__link">Забыли пароль?</a>
</div>
</div>
<div class="login-form__actions">
<button class="login-form__submit" type="submit">Войти</button>
<div class="login-form__actions-row">
<p>Еще не зарегистрированы?</p>
<a href="/registration">
Зарегистрироваться
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5013 8.00021C12.4981 7.64947 12.3567 7.31414 12.108 7.06687L9.24797 4.20021C9.12306 4.07604 8.95409 4.00635 8.77797 4.00635C8.60185 4.00635 8.43288 4.07604 8.30797 4.20021C8.24548 4.26218 8.19589 4.33592 8.16204 4.41716C8.1282 4.4984 8.11077 4.58553 8.11077 4.67354C8.11077 4.76155 8.1282 4.84869 8.16204 4.92993C8.19589 5.01117 8.24548 5.0849 8.30797 5.14687L10.5013 7.33354H3.83464C3.65782 7.33354 3.48826 7.40378 3.36323 7.5288C3.23821 7.65383 3.16797 7.82339 3.16797 8.00021C3.16797 8.17702 3.23821 8.34658 3.36323 8.47161C3.48826 8.59663 3.65782 8.66687 3.83464 8.66687H10.5013L8.30797 10.8602C8.18243 10.9849 8.11156 11.1543 8.11093 11.3312C8.11031 11.5081 8.17998 11.678 8.30464 11.8035C8.42929 11.9291 8.5987 11.9999 8.77561 12.0006C8.95252 12.0012 9.12243 11.9315 9.24797 11.8069L12.108 8.9402C12.3584 8.6913 12.4998 8.35326 12.5013 8.00021Z" fill="#02ADEF"/></svg>
</a>
</div>
</div>
</form>
<div class="login-error">
<p>Неверный логин или пароль.</p>
</div>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,23 @@
<!--
Template Name: Шаблон Оплата
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="payment">
<div class="payment-container container">
<h1><?php echo the_title(); ?></h1>
<div class="payment-main">
<?php echo the_content(); ?>
</div>
</div>
</section>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,27 @@
<!--
Template Name: Шаблон Восстановление пароля успешное
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="login password-recovery-complete">
<div class="login-container container">
<div class="login-name">
<h1>Восстановление пароля</h1>
</div>
<div class="login-main">
<div class="password-recovery-complete__block">
<p>Новый пароль для входа в аккаунт был отправлен на e-mail. Пожалуйста, дождитесь письма, так как пароль будет меняться <br> при каждом запросе на восстановление.</p>
</div>
<a href="/login" class="login-form__submit">Войти</a>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,38 @@
<!--
Template Name: Шаблон Восстановление пароля
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="login password-recovery">
<div class="login-container container">
<div class="login-name">
<h1>Восстановление пароля</h1>
<p>Введите e-mail, указанный при регистрации, чтобы восстановить доступ к аккаунту.</p>
</div>
<div class="login-main">
<form action="" class="login-form" id="recovery-form">
<div class="login-form__inputs">
<div class="login-form__input">
<input type="email" name="user_email" placeholder="E-mail" autocomplete="email" required>
</div>
<p>На данный e-mail придет письмо с новым паролем</p>
</div>
<div class="login-form__actions">
<button class="login-form__submit" type="submit">Выслать новый пароль</button>
</div>
</form>
<div class="login-error">
<p>Учетной записи с таким e-mail не найдено.</p>
</div>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,23 @@
<!--
Template Name: Шаблон Возврат
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="payment delivery">
<div class="payment-container container">
<h1><?php echo the_title(); ?></h1>
<div class="payment-main">
<?php echo the_content(); ?>
</div>
</div>
</section>
<?php get_template_part( 'blocks/block', 'consult' ); ?>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,25 @@
<!--
Template Name: Шаблон Регистрация Спасибо
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p>Регистрация</p></li>
</ul>
</nav>
<section class="login password-recovery-complete registration-complete">
<div class="login-container container">
<div class="login-name">
<h1>Спасибо за регистрацию!</h1>
<p>Ваш номер телефона успешно подтвержден.</p>
</div>
<div class="login-main">
<a href="/account" class="login-form__submit">Войти</a>
</div>
</div>
</section>
</main>
<?php get_footer(); ?>

View File

@ -0,0 +1,133 @@
<!--
Template Name: Шаблон Регистрация
-->
<?php get_header(); ?>
<main>
<nav class="breadcumbs container">
<ul>
<li><a href="/">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php echo the_title(); ?></p></li>
</ul>
</nav>
<section class="login registration">
<div class="login-container container">
<div class="login-name">
<h1>Регистрация</h1>
<p>Зарегистрируйтесь, чтобы управлять своими личными данными и следить за состоянием заказов. Мы никогда и ни при каких условиях не разглашаем личные данные клиентов. Контактная информация будет использована только для оформления заказов и более удобной работы с сайтом.</p>
</div>
<div class="registration-main">
<div class="registration-col">
<div class="registration-tabs">
<button class="registration-tab active">Физическое лицо</button>
<button class="registration-tab">Юридическое лицо или ИП</button>
</div>
<div class="registration-content active">
<form action="" class="registration-form">
<input type="hidden" name="registration_type" value="Физическое лицо">
<div class="login-form__inputs">
<div class="login-form__input">
<input type="email" placeholder="E-mail" autocomplete="email" required>
</div>
<div class="login-form__input">
<input type="tel" class="phone" placeholder="+7 (999) 999-99-99" autocomplete="tel" required>
</div>
<div class="login-form__input">
<input type="password" id="login-password" placeholder="Пароль" minlength="6" autocomplete="current-password" required>
<button class="login-password__button" type="button">
<img src="/wp-content/uploads/2025/05/password-2.svg" alt="">
</button>
</div>
<p>Длина пароля не менее 6 символов.</p>
<div class="login-form__row">
<div class="login-form__remember">
<input type="checkbox" id="login-form__remember" name="login-form__remember" checked>
<label for="login-form__remember">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy">политикой конфиденциальности</a></label>
</div>
</div>
</div>
<div class="login-form__actions">
<button class="login-form__submit" type="submit">Зарегистрироваться</button>
<div class="login-form__actions-row">
<p>Уже зарегистрированы?</p>
<a href="/login">
Войти
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5013 8.00021C12.4981 7.64947 12.3567 7.31414 12.108 7.06687L9.24797 4.20021C9.12306 4.07604 8.95409 4.00635 8.77797 4.00635C8.60185 4.00635 8.43288 4.07604 8.30797 4.20021C8.24548 4.26218 8.19589 4.33592 8.16204 4.41716C8.1282 4.4984 8.11077 4.58553 8.11077 4.67354C8.11077 4.76155 8.1282 4.84869 8.16204 4.92993C8.19589 5.01117 8.24548 5.0849 8.30797 5.14687L10.5013 7.33354H3.83464C3.65782 7.33354 3.48826 7.40378 3.36323 7.5288C3.23821 7.65383 3.16797 7.82339 3.16797 8.00021C3.16797 8.17702 3.23821 8.34658 3.36323 8.47161C3.48826 8.59663 3.65782 8.66687 3.83464 8.66687H10.5013L8.30797 10.8602C8.18243 10.9849 8.11156 11.1543 8.11093 11.3312C8.11031 11.5081 8.17998 11.678 8.30464 11.8035C8.42929 11.9291 8.5987 11.9999 8.77561 12.0006C8.95252 12.0012 9.12243 11.9315 9.24797 11.8069L12.108 8.9402C12.3584 8.6913 12.4998 8.35326 12.5013 8.00021Z" fill="#02ADEF"/></svg>
</a>
</div>
</div>
</form>
</div>
<div class="registration-content">
<form action="" class="registration-form">
<input type="hidden" name="registration_type" value="Юридическое лицо или ИП">
<div class="login-form__inputs">
<div class="login-form__input">
<input type="email" placeholder="E-mail" autocomplete="email" required>
</div>
<div class="login-form__input">
<input type="tel" class="phone" placeholder="+7 (999) 999-99-99" autocomplete="tel" required>
</div>
<div class="login-form__input">
<input type="password" id="login-password" placeholder="Пароль" minlength="6" autocomplete="current-password" required>
<button class="login-password__button" type="button">
<img src="/wp-content/uploads/2025/05/password-2.svg" alt="">
</button>
</div>
<p>Длина пароля не менее 6 символов.</p>
<div class="login-form__row">
<div class="login-form__remember">
<input type="checkbox" id="login-form__remember2" name="login-form__remember" checked>
<label for="login-form__remember2">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy">политикой конфиденциальности</a></label>
</div>
</div>
</div>
<div class="login-form__actions">
<button class="login-form__submit" type="submit">Зарегистрироваться</button>
<div class="login-form__actions-row">
<p>Уже зарегистрированы?</p>
<a href="/login">
Войти
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5013 8.00021C12.4981 7.64947 12.3567 7.31414 12.108 7.06687L9.24797 4.20021C9.12306 4.07604 8.95409 4.00635 8.77797 4.00635C8.60185 4.00635 8.43288 4.07604 8.30797 4.20021C8.24548 4.26218 8.19589 4.33592 8.16204 4.41716C8.1282 4.4984 8.11077 4.58553 8.11077 4.67354C8.11077 4.76155 8.1282 4.84869 8.16204 4.92993C8.19589 5.01117 8.24548 5.0849 8.30797 5.14687L10.5013 7.33354H3.83464C3.65782 7.33354 3.48826 7.40378 3.36323 7.5288C3.23821 7.65383 3.16797 7.82339 3.16797 8.00021C3.16797 8.17702 3.23821 8.34658 3.36323 8.47161C3.48826 8.59663 3.65782 8.66687 3.83464 8.66687H10.5013L8.30797 10.8602C8.18243 10.9849 8.11156 11.1543 8.11093 11.3312C8.11031 11.5081 8.17998 11.678 8.30464 11.8035C8.42929 11.9291 8.5987 11.9999 8.77561 12.0006C8.95252 12.0012 9.12243 11.9315 9.24797 11.8069L12.108 8.9402C12.3584 8.6913 12.4998 8.35326 12.5013 8.00021Z" fill="#02ADEF"/></svg>
</a>
</div>
</div>
</form>
</div>
</div>
<div class="login-error">
<p>Учетная запись с таким e-mail уже существует.</p>
</div>
</div>
</div>
</section>
</main>
<div class="popup popup-registration">
<div class="popup-fon popup-registration__fon"></div>
<div class="popup-main">
<button class="popup-close popup-registration__close"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1269_41481)"><path d="M23.7068 0.293275C23.5193 0.105804 23.2649 0.000488281 22.9998 0.000488281C22.7346 0.000488281 22.4803 0.105804 22.2928 0.293275L11.9998 10.5863L1.70679 0.293275C1.51926 0.105804 1.26495 0.000488281 0.999786 0.000488281C0.734622 0.000488281 0.480314 0.105804 0.292786 0.293275C0.105315 0.480802 0 0.735111 0 1.00027C0 1.26544 0.105315 1.51975 0.292786 1.70727L10.5858 12.0003L0.292786 22.2933C0.105315 22.4808 0 22.7351 0 23.0003C0 23.2654 0.105315 23.5197 0.292786 23.7073C0.480314 23.8947 0.734622 24.0001 0.999786 24.0001C1.26495 24.0001 1.51926 23.8947 1.70679 23.7073L11.9998 13.4143L22.2928 23.7073C22.4803 23.8947 22.7346 24.0001 22.9998 24.0001C23.2649 24.0001 23.5193 23.8947 23.7068 23.7073C23.8943 23.5197 23.9996 23.2654 23.9996 23.0003C23.9996 22.7351 23.8943 22.4808 23.7068 22.2933L13.4138 12.0003L23.7068 1.70727C23.8943 1.51975 23.9996 1.26544 23.9996 1.00027C23.9996 0.735111 23.8943 0.480802 23.7068 0.293275Z" fill="#808080"/></g><defs><clipPath id="clip0_1269_41481"><rect width="24" height="24" fill="white"/></clipPath></defs></svg></button>
<div class="popup-registration__col">
<div class="popup-registration__name">
<h4>Подтвердите номер телефона</h4>
<p>Мы отправили вам код на номер <br> <b>+7 (999) 999-99-99</b></p>
</div>
<form action="" class="popup-registration__form">
<div class="popup-registration__inputs">
<div class="popup-registration__input">
<input type="password" placeholder="Код" required>
</div>
<p>Введите код из СМС</p>
</div>
<div class="popup-registration__actions">
<button class="popup-registration__submit" type="submit">Подтвердить код</button>
<p>Отправить код повторно через 01:59</p>
<button class="popup-registration__code-button">
Отправить код повторно
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5013 8.00021C12.4981 7.64947 12.3567 7.31414 12.108 7.06687L9.24797 4.20021C9.12306 4.07604 8.95409 4.00635 8.77797 4.00635C8.60185 4.00635 8.43288 4.07604 8.30797 4.20021C8.24548 4.26218 8.19589 4.33592 8.16204 4.41716C8.1282 4.4984 8.11077 4.58553 8.11077 4.67354C8.11077 4.76155 8.1282 4.84869 8.16204 4.92993C8.19589 5.01117 8.24548 5.0849 8.30797 5.14687L10.5013 7.33354H3.83464C3.65782 7.33354 3.48826 7.40378 3.36323 7.5288C3.23821 7.65383 3.16797 7.82339 3.16797 8.00021C3.16797 8.17702 3.23821 8.34658 3.36323 8.47161C3.48826 8.59663 3.65782 8.66687 3.83464 8.66687H10.5013L8.30797 10.8602C8.18243 10.9849 8.11156 11.1543 8.11093 11.3312C8.11031 11.5081 8.17998 11.678 8.30464 11.8035C8.42929 11.9291 8.5987 11.9999 8.77561 12.0006C8.95252 12.0012 9.12243 11.9315 9.24797 11.8069L12.108 8.9402C12.3584 8.6913 12.4998 8.35326 12.5013 8.00021Z" fill="#02ADEF"/></svg>
</button>
</div>
</form>
</div>
</div>
</div>
<?php get_footer(); ?>

View File

@ -0,0 +1,97 @@
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.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.6.0
*/
defined( 'ABSPATH' ) || exit;
get_header( 'shop' );
/**
* Hook: woocommerce_before_main_content.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
*/
do_action( 'woocommerce_before_main_content' );
/**
* Hook: woocommerce_shop_loop_header.
*
* @since 8.6.0
*
* @hooked woocommerce_product_taxonomy_archive_header - 10
*/
do_action( 'woocommerce_shop_loop_header' );
if ( woocommerce_product_loop() ) {
/**
* Hook: woocommerce_before_shop_loop.
*
* @hooked woocommerce_output_all_notices - 10
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' );
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
/**
* Hook: woocommerce_shop_loop.
*/
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
woocommerce_product_loop_end();
/**
* Hook: woocommerce_after_shop_loop.
*
* @hooked woocommerce_pagination - 10
*/
do_action( 'woocommerce_after_shop_loop' );
} else {
/**
* Hook: woocommerce_no_products_found.
*
* @hooked wc_no_products_found - 10
*/
do_action( 'woocommerce_no_products_found' );
}
/**
* Hook: woocommerce_after_main_content.
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action( 'woocommerce_after_main_content' );
/**
* Hook: woocommerce_sidebar.
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action( 'woocommerce_sidebar' );
get_footer( 'shop' );

View File

@ -0,0 +1,25 @@
<?php
/**
* Auth footer
*
* This template can be overridden by copying it to yourtheme/woocommerce/auth/footer.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\Auth
* @version 2.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
</div>
</body>
</html>

View File

@ -0,0 +1,68 @@
<?php
/**
* Auth form grant access
*
* This template can be overridden by copying it to yourtheme/woocommerce/auth/form-grant-access.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\Auth
* @version 8.8.0
*/
defined( 'ABSPATH' ) || exit;
?>
<?php do_action( 'woocommerce_auth_page_header' ); ?>
<h1>
<?php
/* Translators: %s App name. */
printf( esc_html__( '%s would like to connect to your store', 'woocommerce' ), esc_html( $app_name ) );
?>
</h1>
<?php wc_print_notices(); ?>
<p>
<?php
/* Translators: %1$s App name, %2$s scope. */
printf( esc_html__( 'This will give "%1$s" %2$s access which will allow it to:', 'woocommerce' ), '<strong>' . esc_html( $app_name ) . '</strong>', '<strong>' . esc_html( $scope ) . '</strong>' );
?>
</p>
<ul class="wc-auth-permissions">
<?php foreach ( $permissions as $permission ) : ?>
<li><?php echo esc_html( $permission ); ?></li>
<?php endforeach; ?>
</ul>
<p>
<?php
/* Translators: %s Domain name from the callback URL. */
printf( esc_html__( 'Approving will share credentials with %s. Do not proceed if this looks suspicious in any way.', 'woocommerce' ), '<strong>' . esc_html( wp_parse_url( $callback_url, PHP_URL_HOST ) ) . '</strong>' );
?>
</p>
<div class="wc-auth-logged-in-as">
<?php echo get_avatar( $user->ID, 70 ); ?>
<p>
<?php
/* Translators: %s display name. */
printf( esc_html__( 'Logged in as %s', 'woocommerce' ), esc_html( $user->display_name ) );
?>
<a href="<?php echo esc_url( $logout_url ); ?>" class="wc-auth-logout"><?php esc_html_e( 'Logout', 'woocommerce' ); ?></a>
</p>
</div>
<p class="wc-auth-actions">
<a href="<?php echo esc_url( $granted_url ); ?>" class="button button-primary wc-auth-approve"><?php esc_html_e( 'Approve', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( $return_url ); ?>" class="button wc-auth-deny"><?php esc_html_e( 'Deny', 'woocommerce' ); ?></a>
</p>
<?php do_action( 'woocommerce_auth_page_footer' ); ?>

View File

@ -0,0 +1,54 @@
<?php
/**
* Auth form login
*
* This template can be overridden by copying it to yourtheme/woocommerce/auth/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\Auth
* @version 9.2.0
*/
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_auth_page_header' ); ?>
<h1>
<?php
/* translators: %s: app name */
printf( esc_html__( '%s would like to connect to your store', 'woocommerce' ), esc_html( $app_name ) );
?>
</h1>
<?php wc_print_notices(); ?>
<p>
<?php
/* translators: %1$s: app name, %2$s: URL */
echo wp_kses_post( sprintf( __( 'To connect to %1$s you need to be logged in. Log in to your store below, or <a href="%2$s">cancel and return to %1$s</a>', 'woocommerce' ), esc_html( wc_clean( $app_name ) ), esc_url( $return_url ) ) );
?>
</p>
<form method="post" class="wc-auth-login">
<p class="form-row form-row-wide">
<label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?>&nbsp;<span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
<input type="text" class="input-text" name="username" id="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( $_POST['username'] ) : ''; ?>" required aria-required="true" /><?php //@codingStandardsIgnoreLine ?>
</p>
<p class="form-row form-row-wide">
<label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?>&nbsp;<span class="required" aria-hidden="true">*</span><span class="screen-reader-text"><?php esc_html_e( 'Required', 'woocommerce' ); ?></span></label>
<input class="input-text" type="password" name="password" id="password" required aria-required="true" />
</p>
<p class="wc-auth-actions">
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
<button type="submit" class="button button-large button-primary wc-auth-login-button<?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( 'Login', 'woocommerce' ); ?>"><?php esc_html_e( 'Login', 'woocommerce' ); ?></button>
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect_url ); ?>" />
</p>
</form>
<?php do_action( 'woocommerce_auth_page_footer' ); ?>

View File

@ -0,0 +1,41 @@
<?php
/**
* Auth header
*
* This template can be overridden by copying it to yourtheme/woocommerce/auth/header.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\Auth
* @version 9.6.0
*/
defined( 'ABSPATH' ) || exit;
// phpcs:disable WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<title><?php esc_html_e( 'Application authentication request', 'woocommerce' ); ?></title>
<?php wp_admin_css( 'install', true ); ?>
<link rel="stylesheet" href="<?php echo esc_url( str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/auth.css' ); ?>" type="text/css" />
</head>
<body class="wc-auth wp-core-ui">
<h1 id="wc-logo">
<img src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/woo-logo.svg' ); ?>" alt="
<?php
esc_attr_e(
'WooCommerce',
'woocommerce'
);
?>
" /></h1>
<div class="wc-auth-content">

View File

@ -0,0 +1,51 @@
<?php
/**
* Show error messages
*
* This template can be overridden by copying it to yourtheme/woocommerce/notices/error.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 8.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! $notices ) {
return;
}
$multiple = count( $notices ) > 1;
?>
<div class="wc-block-components-notice-banner is-error" role="alert" <?php echo $multiple ? '' : wc_get_notice_data_attr( $notices[0] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
<path d="M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"></path>
</svg>
<div class="wc-block-components-notice-banner__content">
<?php if ( $multiple ) { ?>
<p class="wc-block-components-notice-banner__summary"><?php esc_html_e( 'The following problems were found:', 'woocommerce' ); ?></p>
<ul>
<?php foreach ( $notices as $notice ) : ?>
<li<?php echo wc_get_notice_data_attr( $notice ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php echo wc_kses_notice( $notice['notice'] ); ?>
</li>
<?php endforeach; ?>
</ul>
<?php
} else {
echo wc_kses_notice( $notices[0]['notice'] );
}
?>
</div>
</div>
<?php

View File

@ -0,0 +1,37 @@
<?php
/**
* Show info messages
*
* This template can be overridden by copying it to yourtheme/woocommerce/notices/notice.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 9.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! $notices ) {
return;
}
?>
<?php foreach ( $notices as $notice ) : ?>
<div class="wc-block-components-notice-banner is-info"<?php echo wc_get_notice_data_attr( $notice ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> role="status">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
<path d="M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"></path>
</svg>
<div class="wc-block-components-notice-banner__content">
<?php echo wc_kses_notice( $notice['notice'] ); ?>
</div>
</div>
<?php endforeach; ?>

View File

@ -0,0 +1,37 @@
<?php
/**
* Show success messages
*
* This template can be overridden by copying it to yourtheme/woocommerce/notices/success.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 8.6.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! $notices ) {
return;
}
?>
<?php foreach ( $notices as $notice ) : ?>
<div class="wc-block-components-notice-banner is-success"<?php echo wc_get_notice_data_attr( $notice ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> role="alert">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
<path d="M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"></path>
</svg>
<div class="wc-block-components-notice-banner__content">
<?php echo wc_kses_notice( $notice['notice'] ); ?>
</div>
</div>
<?php endforeach; ?>

View File

@ -0,0 +1,35 @@
<?php
/**
* Brand description
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/brand-description.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.4.0
*/
declare( strict_types = 1);
$image_size = wc_get_image_size( 'shop_catalog' ); ?>
<div class="term-description brand-description">
<?php if ( $thumbnail ) : ?>
<img src="<?php echo esc_url( $thumbnail ); ?>" alt="Thumbnail" class="wp-post-image alignright fr brand-thumbnail" width="<?php echo esc_attr( $image_size['width'] ); ?>" />
<?php endif; ?>
<div class="text">
<?php echo do_shortcode( wpautop( wptexturize( term_description() ) ) ); ?>
</div>
</div>

View File

@ -0,0 +1,63 @@
<?php
/**
* Brand A-Z listing
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/shortcodes/brands-a-z.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
* @usedby [product_brand_list]
* @version 9.4.0
*/
declare( strict_types = 1);
?>
<div id="brands_a_z">
<ul class="brands_index">
<?php
foreach ( $index as $i ) {
if ( isset( $product_brands[ $i ] ) ) {
echo '<li><a href="#brands-' . esc_attr( $i ) . '">' . esc_html( $i ) . '</a></li>';
} elseif ( $show_empty ) {
echo '<li><span>' . esc_html( $i ) . '</span></li>';
}
}
?>
</ul>
<?php
foreach ( $index as $i ) {
if ( isset( $product_brands[ $i ] ) ) {
?>
<h3 id="brands-<?php echo esc_attr( $i ); ?>"><?php echo esc_html( $i ); ?></h3>
<ul class="brands">
<?php
foreach ( $product_brands[ $i ] as $brand ) {
printf(
'<li><a href="%s">%s</a></li>',
esc_url( get_term_link( $brand->slug, 'product_brand' ) ),
esc_html( $brand->name )
);
}
?>
</ul>
<?php if ( $show_top_links ) { ?>
<a class="top" href="#brands_a_z"><?php esc_html_e( '&uarr; Top', 'woocommerce' ); ?></a>
<?php } ?>
<?php
}
}
?>
</div>

View File

@ -0,0 +1,38 @@
<?php
/**
* Single Brand
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/shortcodes/single-brand.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 WC_Brands::output_product_brand()
*
* @var WP_Term $term The term object.
* @var string $thumbnail The URL to the brand thumbnail.
* @var string $class The class to apply to the thumbnail image.
* @var string $width The width of the image.
* @var string $height The height of the image.
*
* Ignore space indent sniff for this file, as it is used for alignment rather than actual indents.
* phpcs:ignoreFile Generic.WhiteSpace.DisallowSpaceIndent
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @usedby [product_brand]
* @version 9.4.0
*/
declare( strict_types = 1);
?>
<a href="<?php echo esc_url( get_term_link( $term, 'product_brand' ) ); ?>">
<img src="<?php echo esc_url( $thumbnail ); ?>"
alt="<?php echo esc_attr( $term->name ); ?>"
class="<?php echo esc_attr( $class ); ?>"
style="width: <?php echo esc_attr( $width ); ?>; height: <?php echo esc_attr( $height ); ?>;"/>
</a>

View File

@ -0,0 +1,12 @@
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase for backwards compatibility.
/**
* Use the WooCommerce archive template for brand taxonomy pages
*
* @package WooCommerce\Templates
* @version 9.4.0
*/
declare( strict_types = 1);
wc_get_template( 'archive-product.php' );

View File

@ -0,0 +1,27 @@
<?php
/**
* Show a brands description when on a taxonomy page
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/widgets/brand-description.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.4.0
*/
declare( strict_types = 1);
global $woocommerce;
if ( $thumbnail ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo wc_get_brand_thumbnail_image( $brand );
}
echo wp_kses_post( wpautop( wptexturize( term_description() ) ) );

View File

@ -0,0 +1,58 @@
<?php
/**
* Show a grid of thumbnails
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/widgets/brand-thumbnails-description.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.4.0
*/
declare( strict_types = 1);
?>
<ul class="brand-thumbnails-description">
<?php
foreach ( $brands as $index => $brand ) :
/**
* Filter the brand's thumbnail size.
*
* @since 9.4.0
* @param string $size Defaults to 'shop_catalog'
*/
$thumbnail = wc_get_brand_thumbnail_url( $brand->term_id, apply_filters( 'woocommerce_brand_thumbnail_size', 'shop_catalog' ) );
if ( ! $thumbnail ) {
$thumbnail = wc_placeholder_img_src();
}
$class = '';
if ( 0 === $index || 0 === $index % $columns ) {
$class = 'first';
} elseif ( 0 === ( $index + 1 ) % $columns ) {
$class = 'last';
}
$width = floor( ( ( 100 - ( ( $columns - 1 ) * 2 ) ) / $columns ) * 100 ) / 100;
?>
<li class="<?php echo esc_attr( $class ); ?>" style="width: <?php echo esc_attr( $width ); ?>%;">
<a href="<?php echo esc_url( get_term_link( $brand->slug, 'product_brand' ) ); ?>" title="<?php echo esc_attr( $brand->name ); ?>" class="term-thumbnail">
<img src="<?php echo esc_url( $thumbnail ); ?>" alt="<?php echo esc_attr( $brand->name ); ?>" />
</a>
<div id="term-<?php echo esc_attr( $brand->term_id ); ?>" class="term-description">
<?php echo wp_kses_post( wpautop( wptexturize( $brand->description ) ) ); ?>
</div>
</li>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,45 @@
<?php
/**
* Show a grid of thumbnails
*
* This template can be overridden by copying it to yourtheme/woocommerce/brands/widgets/brand-thumbnails.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.4.0
*/
declare( strict_types = 1);
$wrapper_class = 'fluid-columns';
if ( ! $fluid_columns && in_array( $columns, array( 1, 2, 3, 4, 5, 6 ), true ) ) {
$wrapper_class = 'columns-' . $columns;
}
?>
<ul class="brand-thumbnails <?php echo esc_attr( $wrapper_class ); ?>">
<?php
foreach ( array_values( $brands ) as $index => $brand ) :
$class = '';
if ( 0 === $index || 0 === $index % $columns ) {
$class = 'first';
} elseif ( 0 === ( $index + 1 ) % $columns ) {
$class = 'last';
}
?>
<li class="<?php echo esc_attr( $class ); ?>">
<a href="<?php echo esc_url( get_term_link( $brand->slug, 'product_brand' ) ); ?>" title="<?php echo esc_attr( $brand->name ); ?>">
<?php echo wc_get_brand_thumbnail_image( $brand ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
</a>
</li>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,17 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( wc_get_page_id( 'shop' ) > 0 ) : ?>
<section class="cart">
<div class="cart-container container">
<h1>Корзина</h1>
<div class="cart-empty">
<h3>Ваша корзина пока пуста</h3>
<p>Воспользуйтесь каталогом или поиском, чтобы добавить товары в корзину и оформить заказ. Если у вас были товары в корзине <a href="/login">войдите</a> в аккаунт.</p>
<a href="/catalog" class="cart-empty__link">
Перейти в каталог
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8242 4.44727L15.3767 8.99977L10.8242 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.625 9H15.2475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div>
</div>
</section>
<?php endif; ?>

View File

@ -0,0 +1,26 @@
<?php
/**
* Cart item data (when outputting non-flat)
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-item-data.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 2.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<dl class="variation">
<?php foreach ( $item_data as $data ) : ?>
<dt class="<?php echo sanitize_html_class( 'variation-' . $data['key'] ); ?>"><?php echo wp_kses_post( $data['key'] ); ?>:</dt>
<dd class="<?php echo sanitize_html_class( 'variation-' . $data['key'] ); ?>"><?php echo wp_kses_post( wpautop( $data['display'] ) ); ?></dd>
<?php endforeach; ?>
</dl>

View File

@ -0,0 +1,117 @@
<?php
defined( 'ABSPATH' ) || exit;
$formatted_destination = isset( $formatted_destination ) ? $formatted_destination : WC()->countries->get_formatted_address( $package['destination'], ', ' );
$has_calculated_shipping = ! empty( $has_calculated_shipping );
$show_shipping_calculator = ! empty( $show_shipping_calculator );
$calculator_text = '';
?>
<div class="checkout-col">
<div class="checkout-name">
<span>2</span>
<h3>Способ доставки</h3>
</div>
<div class="checkout-block">
<?php if ( ! empty( $available_methods ) && is_array( $available_methods ) ) : ?>
<ul id="shipping_method" class="woocommerce-shipping-methods checkout-delivery">
<?php foreach ( $available_methods as $method ) : ?>
<li>
<div class="checkout-delivery__item">
<?php
$method_id = esc_attr( $method->id );
$method_title = $method->get_label();
$method_name = sanitize_title( $method_title );
$is_checked = checked( $method_id, $chosen_method, false );
$input_type = ( count( $available_methods ) > 1 ) ? 'radio' : 'hidden';
$cost = floatval( $method->cost );
// Общий префикс <input>
$input = sprintf(
'<input type="%1$s" name="shipping_method[%2$d]" data-index="%2$d" id="shipping_method_%2$d_%3$s" value="%4$s" class="shipping_method" data-cost="%6$s" %5$s>',
$input_type,
$index,
$method_name,
$method_id,
$is_checked,
esc_attr( $cost )
);
// Маппинг названий к ключам настроек
$label_keys = array(
'Самовывоз' => 'samovyvoz_label',
'Доставка по Москве' => 'moscow_label',
'Доставка по Московской области' => 'moscow_area_label',
'В другой регион' => 'region_label',
'В другой регион Почтой России' => 'pochta_label',
);
echo $input;
if ( isset( $label_keys[ $method_title ] ) ) {
$desc = orgsteklo_get_checkout_setting( $label_keys[ $method_title ] );
// Подставляем {cost} → реальную стоимость из WooCommerce
$desc = str_replace( '{cost}', wc_price( $cost ), $desc );
// Подставляем {km_rate} → стоимость за км от МКАД
$km_rate = orgsteklo_get_checkout_setting( 'moscow_area_km_rate' );
$desc = str_replace( '{km_rate}', esc_html( $km_rate ), $desc );
printf(
'<label for="shipping_method_%1$d_%2$s"><p>%3$s</p><p>%4$s</p></label>',
$index,
$method_name,
esc_html( $method_title ),
wp_kses_post( $desc )
);
} else {
printf(
'<label for="shipping_method_%1$d_%2$s"><p>%3$s</p></label>',
$index,
$method_name,
esc_html( $method_title )
);
}
do_action( 'woocommerce_after_shipping_rate', $method, $index );
?>
</div>
</li>
<?php endforeach; ?>
</ul>
<?php if ( is_cart() ) : ?>
<p class="woocommerce-shipping-destination">
<?php
if ( $formatted_destination ) {
printf( esc_html__( 'Shipping to %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' );
$calculator_text = esc_html__( 'Change address', 'woocommerce' );
} else {
echo wp_kses_post( apply_filters( 'woocommerce_shipping_estimate_html', __( 'Shipping options will be updated during checkout.', 'woocommerce' ) ) );
}
?>
</p>
<?php endif; ?>
<?php
elseif ( ! $has_calculated_shipping || ! $formatted_destination ) :
if ( is_cart() && 'no' === get_option( 'woocommerce_enable_shipping_calc' ) ) {
echo wp_kses_post( apply_filters( 'woocommerce_shipping_not_enabled_on_cart_html', __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) ) );
} else {
echo wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) );
}
elseif ( ! is_cart() ) :
echo wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) );
else :
echo wp_kses_post(
apply_filters(
'woocommerce_cart_no_shipping_available_html',
sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ),
$formatted_destination
)
);
$calculator_text = esc_html__( 'Enter a different address', 'woocommerce' );
endif;
?>
<?php if ( $show_package_details ) : ?>
<?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html( $package_details ) . '</small></p>'; ?>
<?php endif; ?>
<?php if ( $show_shipping_calculator ) : ?>
<?php woocommerce_shipping_calculator( $calculator_text ); ?>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,112 @@
<?php
/**
* Cart totals
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-totals.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 2.3.6
*/
defined( 'ABSPATH' ) || exit;
?>
<div class="cart_totals <?php echo ( WC()->customer->has_calculated_shipping() ) ? 'calculated_shipping' : ''; ?>">
<?php do_action( 'woocommerce_before_cart_totals' ); ?>
<h2><?php esc_html_e( 'Cart totals', 'woocommerce' ); ?></h2>
<table cellspacing="0" class="shop_table shop_table_responsive">
<tr class="cart-subtotal">
<th><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
<td data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>"><?php wc_cart_totals_subtotal_html(); ?></td>
</tr>
<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
<tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
<th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
<td data-title="<?php echo esc_attr( wc_cart_totals_coupon_label( $coupon, false ) ); ?>"><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
</tr>
<?php endforeach; ?>
<?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
<?php do_action( 'woocommerce_cart_totals_before_shipping' ); ?>
<?php wc_cart_totals_shipping_html(); ?>
<?php do_action( 'woocommerce_cart_totals_after_shipping' ); ?>
<?php elseif ( WC()->cart->needs_shipping() && 'yes' === get_option( 'woocommerce_enable_shipping_calc' ) ) : ?>
<tr class="shipping">
<th><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></th>
<td data-title="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>"><?php woocommerce_shipping_calculator(); ?></td>
</tr>
<?php endif; ?>
<?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
<tr class="fee">
<th><?php echo esc_html( $fee->name ); ?></th>
<td data-title="<?php echo esc_attr( $fee->name ); ?>"><?php wc_cart_totals_fee_html( $fee ); ?></td>
</tr>
<?php endforeach; ?>
<?php
if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) {
$taxable_address = WC()->customer->get_taxable_address();
$estimated_text = '';
if ( WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ) {
/* translators: %s location. */
$estimated_text = sprintf( ' <small>' . esc_html__( '(estimated for %s)', 'woocommerce' ) . '</small>', WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] );
}
if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
foreach ( WC()->cart->get_tax_totals() as $code => $tax ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
?>
<tr class="tax-rate tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
<th><?php echo esc_html( $tax->label ) . $estimated_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></th>
<td data-title="<?php echo esc_attr( $tax->label ); ?>"><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
</tr>
<?php
}
} else {
?>
<tr class="tax-total">
<th><?php echo esc_html( WC()->countries->tax_or_vat() ) . $estimated_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></th>
<td data-title="<?php echo esc_attr( WC()->countries->tax_or_vat() ); ?>"><?php wc_cart_totals_taxes_total_html(); ?></td>
</tr>
<?php
}
}
?>
<?php do_action( 'woocommerce_cart_totals_before_order_total' ); ?>
<tr class="order-total">
<th><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
<td data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php wc_cart_totals_order_total_html(); ?></td>
</tr>
<?php do_action( 'woocommerce_cart_totals_after_order_total' ); ?>
</table>
<div class="wc-proceed-to-checkout">
<?php do_action( 'woocommerce_proceed_to_checkout' ); ?>
</div>
<?php do_action( 'woocommerce_after_cart_totals' ); ?>
</div>

View File

@ -0,0 +1,588 @@
<?php
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_before_cart' );
?>
<section class="cart">
<div class="cart-container container">
<h1>Корзина</h1>
<div class="cart-main">
<div class="cart-left">
<div class="cart-top">
<div class="cart-checkbox__all">
<input type="checkbox" id="cart-checkbox__all" name="cart-checkbox__all">
<label for="cart-checkbox__all">Выбрать все</label>
</div>
<button class="cart-delete-all">
Удалить выбранное
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.46875 13.5356L13.5398 6.46458" stroke="#F02E13" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M13.5398 13.5354L6.46875 6.46436" stroke="#F02E13" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
</div>
<form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
<input type="hidden" name="update_checkout_cart" value="1">
<?php do_action( 'woocommerce_before_cart_table' ); ?>
<div class="cart-products">
<?php do_action( 'woocommerce_before_cart_contents' ); ?>
<?php
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
// Получаем название товара без вариаций
$product_name = $_product->get_name();
if ( $_product->is_type('variation') ) {
$parent_product = wc_get_product( $cart_item['product_id'] );
if ( $parent_product ) {
$product_name = $parent_product->get_name();
}
}
$product_name = apply_filters( 'woocommerce_cart_item_name', $product_name, $cart_item, $cart_item_key );
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
?>
<?php
$sku = $_product->get_sku();
$weight = $_product->get_weight();
$qty = $cart_item['quantity'];
$price = $_product->get_price();
$regular_price = $_product->get_regular_price();
$sale_price = $_product->get_sale_price();
$total_price = $price * $qty;
$total_regular_price = $regular_price * $qty;
$total_weight = $weight * $qty;
?>
<div class="cart-product">
<div class="cart-product__checkbox">
<input
type="checkbox"
data-cart_item_key="<?php echo esc_attr($cart_item_key); ?>"
name="cart_product_keys[]"
value="<?php echo esc_attr($cart_item_key); ?>"
id="cart-product__checkbox-<?php echo esc_attr($cart_item_key); ?>"
>
</div>
<?php
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
if ( ! $product_permalink ) {
echo $thumbnail;
}
else {
printf( '<a href="%s" class="cart-product__img">%s</a>', esc_url( $product_permalink ), $thumbnail ); // PHPCS: XSS ok.
}
?>
<div class="cart-product__main">
<div class="cart-product__col">
<div class="cart-product__sku">
<p>Код товара:</p>
<p><?php echo esc_html($sku); ?></p>
</div>
<a href="<?php echo esc_url($product_permalink); ?>" class="cart-product__title"><?php echo esc_html($product_name); ?></a>
<?php
// Отображаем параметры заказа для разных типов товаров
if ( isset( $cart_item['orgsteklo_calculator'] ) ) {
// Для товаров с калькулятором (оргстекло)
$calc = $cart_item['orgsteklo_calculator'];
echo '<div class="cart-product__params">';
echo '<p>Толщина: <strong>' . esc_html( $calc['thickness'] ) . ' мм</strong></p>';
echo '<p>Ширина: <strong>' . esc_html( $calc['width'] ) . ' мм</strong></p>';
echo '<p>Длина: <strong>' . esc_html( $calc['length'] ) . ' мм</strong></p>';
// Итоговая цена за 1 лист после Длины
echo '<p>Итоговая цена за 1 лист: <strong>' . wc_price($price) . '</strong>';
if ($regular_price > $price) {
echo ' <span style="text-decoration: line-through; color: #999;">' . wc_price($regular_price) . '</span>';
}
echo '</p>';
echo '</div>';
} elseif ( $_product->is_type('variation') ) {
$variation = wc_get_product( $cart_item['variation_id'] );
if ( $variation ) {
// Проверяем ширину и длину для определения листового материала
$width_meta = get_post_meta( $cart_item['variation_id'], '_variation_width', true );
if ( empty( $width_meta ) ) {
$width_meta = $variation->get_width();
}
$length_meta = get_post_meta( $cart_item['variation_id'], '_variation_length', true );
if ( empty( $length_meta ) ) {
$length_meta = $variation->get_length();
}
if ( $width_meta && $length_meta ) {
// Листовые материалы — отображение как у оргстекла
$attributes = $variation->get_variation_attributes();
$thickness_value = '';
foreach ( $attributes as $attr_key => $attr_value ) {
$attr_slug = str_replace( 'attribute_pa_', '', $attr_key );
$attr_slug = str_replace( 'attribute_', '', $attr_slug );
if ( stripos( $attr_slug, 'ves' ) !== false ) {
continue;
}
$taxonomy_name = str_replace( 'attribute_', '', $attr_key );
$term = get_term_by( 'slug', $attr_value, $taxonomy_name );
$thickness_value = $term ? $term->name : $attr_value;
break;
}
echo '<div class="cart-product__params">';
if ( $thickness_value ) {
$thickness_clean = preg_replace( '/\s*мм\s*$/u', '', $thickness_value );
$thickness_clean = preg_replace( '/\s*mm\s*$/i', '', $thickness_clean );
echo '<p>Толщина: <strong>' . esc_html( trim( $thickness_clean ) ) . ' мм</strong></p>';
}
echo '<p>Ширина: <strong>' . esc_html( $width_meta ) . ' мм</strong></p>';
echo '<p>Длина: <strong>' . esc_html( $length_meta ) . ' мм</strong></p>';
echo '</div>';
} else {
// Для остальных вариативных товаров (трубы/стержни/клей)
$attributes = $variation->get_variation_attributes();
$has_params = false;
$params_html = '';
foreach ( $attributes as $attr_key => $attr_value ) {
$attr_slug = str_replace( 'attribute_pa_', '', $attr_key );
$attr_slug = str_replace( 'attribute_', '', $attr_slug );
if ( $attr_slug === 'ves' || $attr_slug === 'pa_ves' || stripos( $attr_slug, 'ves' ) !== false ) {
continue;
}
$taxonomy_name = str_replace( 'attribute_', '', $attr_key );
$attr_name = '';
$attr_slug_clean = str_replace( 'pa_', '', $taxonomy_name );
$all_attr_taxonomies = wc_get_attribute_taxonomies();
foreach ( $all_attr_taxonomies as $tax ) {
if ( $tax->attribute_name === $attr_slug_clean ) {
$attr_name = $tax->attribute_label;
break;
}
}
if ( empty( $attr_name ) ) {
$best_label = '';
$best_dist = PHP_INT_MAX;
foreach ( $all_attr_taxonomies as $tax ) {
$dist = levenshtein( $attr_slug_clean, $tax->attribute_name );
if ( $dist < $best_dist && $dist <= 3 ) {
$best_dist = $dist;
$best_label = $tax->attribute_label;
}
}
if ( ! empty( $best_label ) ) {
$attr_name = $best_label;
}
}
if ( empty( $attr_name ) ) {
$attr_name = wc_attribute_label( $taxonomy_name );
}
$term = get_term_by( 'slug', $attr_value, $taxonomy_name );
$attr_value_display = $term ? $term->name : $attr_value;
$attr_value_display = str_replace( array( ' mm', 'mm' ), ' мм', $attr_value_display );
$params_html .= '<p>' . esc_html( $attr_name ) . ': <strong style="color: var(--Black);">' . esc_html( $attr_value_display ) . '</strong></p>';
$has_params = true;
}
$length_only = get_post_meta( $cart_item['variation_id'], '_variation_length', true );
if ( empty( $length_only ) ) {
$length_only = $variation->get_length();
}
if ( $length_only ) {
$params_html .= '<p>Длина: <strong style="color: var(--Black);">' . esc_html( $length_only ) . ' мм</strong></p>';
$has_params = true;
}
if ( $has_params ) {
echo '<div class="cart-product__params">' . $params_html . '</div>';
}
}
}
}
// Для простых товаров (клей) - НЕ показываем вес здесь, он уже есть в cart-product__chars
?>
<div class="cart-product__chars">
<?php
// Определяем единицу измерения для отображения
$is_orgsteklo = isset( $cart_item['orgsteklo_calculator'] );
$unit_label = $is_orgsteklo ? 'лист' : 'шт';
?>
<?php if ( $is_orgsteklo ) : ?>
<?php
// Для оргстекла: Итоговая цена за 1 кг
$price_per_kg = isset( $cart_item['orgsteklo_calculator']['price_per_kg'] )
? $cart_item['orgsteklo_calculator']['price_per_kg']
: ( $weight > 0 ? $price / $weight : 0 );
?>
<div class="cart-product__chars-row">
<p>Итоговая цена за 1 кг:</p>
<p class="cart-product__chars-price"><?php echo wc_price( $price_per_kg ); ?></p>
</div>
<div class="cart-product__chars-row">
<p>Вес:</p>
<p><?php echo number_format($weight, 3, '.', ' '); ?> кг</p>
</div>
<?php else : ?>
<div class="cart-product__chars-row">
<p>Вес 1 <?php echo $unit_label; ?>:</p>
<p><?php echo number_format($weight, 3, '.', ' '); ?> кг</p>
</div>
<div class="cart-product__chars-row">
<p>Итоговая цена за 1 <?php echo $unit_label; ?>:</p>
<p class="cart-product__chars-price"><?php echo wc_price($price); ?></p>
<?php if ($regular_price > $price): ?>
<p class="cart-product__chars-oldprice"><?php echo wc_price($regular_price); ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<div class="cart-product__quantity">
<p>Количество</p>
<?php
if ( $_product->is_sold_individually() ) {
$min_quantity = 1;
$max_quantity = 1;
}
else {
$min_quantity = 0;
$max_quantity = $_product->get_max_purchase_quantity();
}
$product_quantity = woocommerce_quantity_input(
array(
'input_name' => "cart[{$cart_item_key}][qty]",
'input_value' => $cart_item['quantity'],
'max_value' => $max_quantity,
'min_value' => $min_quantity,
'product_name' => $product_name,
),
$_product,
false
);
echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );
?>
</div>
<a href="#" class="cart-product__delete" data-cart_item_key="<?php echo esc_attr($cart_item_key); ?>" data-product_name="<?php echo esc_attr($product_name); ?>" data-remove_url="<?php echo esc_url( wc_get_cart_remove_url( $cart_item_key ) ); ?>" aria-label="<?php echo esc_attr( sprintf( __( 'Remove %s from cart', 'woocommerce' ), wp_strip_all_tags( $product_name ) ) ); ?>">Удалить<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.46875 13.5356L13.5398 6.46458" stroke="#C4C4C4" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M13.5398 13.5354L6.46875 6.46436" stroke="#C4C4C4" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg></a>
</div>
<div class="cart-product__info">
<?php
$product_id_for_tags = $_product->is_type('variation') ? $_product->get_parent_id() : $_product->get_id();
// Показываем статусные теги (не скидки)
if ( function_exists('get_sorted_product_tags') && function_exists('is_discount_tag') ) {
$sorted_tags = get_sorted_product_tags( $product_id_for_tags );
foreach ( $sorted_tags as $tag ) {
if ( ! is_discount_tag( $tag->name ) ) {
echo '<p class="cart-product__popular">' . esc_html( $tag->name ) . '</p>';
}
}
}
// Получаем процент скидки из тегов товара
$discount_percent = 0;
if ( function_exists('get_sorted_product_tags') && function_exists('is_discount_tag') && function_exists('get_discount_from_tag_name') ) {
$tags = get_sorted_product_tags( $product_id_for_tags );
foreach ( $tags as $tag ) {
if ( is_discount_tag( $tag->name ) ) {
$discount_percent = get_discount_from_tag_name( $tag->name );
break;
}
}
}
if ( $discount_percent > 0 ) :
?>
<p class="cart-product__discount">-<?php echo $discount_percent; ?>%</p>
<?php endif; ?>
<div class="cart-product__info-col">
<p class="cart-product__info-label">Итоговая стоимость:</p>
<div class="cart-product__info-block">
<div class="cart-product__price-row">
<p class="cart-product__price"><?php echo wc_price($total_price); ?></p>
<?php if ($total_regular_price > $total_price): ?>
<p class="cart-product__oldprice"><?php echo wc_price($total_regular_price); ?></p>
<?php endif; ?>
</div>
</div>
<div class="cart-product__info-block">
<p>Итоговый вес:</p>
<p><?php echo number_format($total_weight, 3, '.', ' '); ?> кг</p>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
?>
<?php do_action( 'woocommerce_cart_contents' ); ?>
<?php do_action( 'woocommerce_after_cart_contents' ); ?>
</div>
<?php do_action( 'woocommerce_after_cart_table' ); ?>
</form>
</div>
<div class="cart-right">
<div class="cart-total">
<h3>Ваш заказ</h3>
<div class="cart-total__col">
<div class="cart-total__info">
<?php
$count = WC()->cart->get_cart_contents_count();
function plural_form($number, $forms) {
$n = abs($number) % 100;
$n1 = $n % 10;
if ($n > 10 && $n < 20) return $forms[2];
if ($n1 > 1 && $n1 < 5) return $forms[1];
if ($n1 == 1) return $forms[0];
return $forms[2];
}
$word = plural_form($count, ['товар', 'товара', 'товаров']);
?>
<div class="cart-total__info-row">
<p>Количество товаров:</p>
<p><?php echo $count . ' ' . $word; ?></p>
</div>
<?php
$cart = WC()->cart;
$total_weight = 0;
foreach ( $cart->get_cart() as $item ) {
$product = $item['data'];
$qty = $item['quantity'];
$weight = (float) $product->get_weight();
$total_weight += $weight * $qty;
}
?>
<div class="cart-total__info-row">
<p>Вес заказа:</p>
<p><?php echo number_format($total_weight, 3, '.', ' '); ?> кг</p>
</div>
<?php
$cart = WC()->cart;
$items = $cart->get_cart();
$regular_total = 0;
$sale_total = 0;
foreach ( $items as $item ) {
$product = $item['data'];
$quantity = $item['quantity'];
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $sale_price === '' ) {
$sale_price = $regular_price;
}
$regular_total += $regular_price * $quantity;
$sale_total += $sale_price * $quantity;
}
// Округляем суммы
$regular_total = round($regular_total);
$sale_total = round($sale_total);
// Скидка на товары
$product_discount = $regular_total - $sale_total;
// Скидка от суммы заказа (порог проверяется по сумме СО скидками на товары)
$cart_discount = function_exists('orgsteklo_calculate_cart_discount')
? orgsteklo_calculate_cart_discount( $sale_total )
: array( 'percent' => 0, 'amount' => 0 );
$discount_from_total = $cart_discount['amount'];
// Итоговая сумма
$final_total = $sale_total - $discount_from_total;
?>
<div class="cart-total__info-row">
<p>Стоимость товара без скидки:</p>
<p><?php echo wc_price($regular_total); ?></p>
</div>
<div class="cart-total__info-row">
<p>Скидка на товар:</p>
<p><?php echo wc_price($product_discount); ?></p>
</div>
<?php if ( $discount_from_total > 0 ) : ?>
<div class="cart-total__info-row">
<p>Скидка от суммы заказа (<?php echo $cart_discount['percent']; ?>%):</p>
<p><?php echo wc_price($discount_from_total); ?></p>
</div>
<?php endif; ?>
</div>
<div class="cart-total__bottom">
<?php
// Используем уже рассчитанные значения выше
?>
<div class="cart-total__price-col">
<p>Стоимость заказа:</p>
<div class="cart-total__price-row">
<p class="cart-total__price"><?php echo number_format($final_total, 0, ',', ' '); ?> <span>₽</span></p>
<?php if ( $regular_total > $final_total ) : ?>
<p class="cart-total__oldprice"><?php echo number_format($regular_total, 0, ',', ' '); ?> <span>₽</span></p>
<?php endif; ?>
</div>
</div>
<a href="/checkout" class="cart-submit">
Перейти к оформлению заказа
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.3242 4.44727L15.8767 8.99977L11.3242 13.5523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.125 9H15.7475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
<p>Доступные способы доставки и оплаты можно выбрать при оформлении заказа.</p>
<p><a href="/login" style="color: var(--Blue);">Войти</a>, чтобы отслеживать статус заказа.</p>
</div>
</div>
</div>
</div>
<?php do_action( 'woocommerce_after_cart' ); ?>
</div>
</div>
</section>
<script>
document.addEventListener("DOMContentLoaded", function () {
const cartForm = document.querySelector(".woocommerce-cart-form");
const quantityInputs = document.querySelectorAll(".cart-product__quantity-row input");
if (cartForm && quantityInputs.length) {
quantityInputs.forEach((input) => {
input.addEventListener("change", function () {
document.querySelector("input[name='update_checkout_cart']").value = "1";
cartForm.submit();
});
});
document.querySelectorAll(".cart-product__quantity-plus, .cart-product__quantity-minus").forEach((button) => {
button.addEventListener("click", function () {
setTimeout(() => {
document.querySelector("input[name='update_checkout_cart']").value = "1";
cartForm.submit();
}, 300);
});
});
}
});
document.addEventListener('DOMContentLoaded', function() {
const popup = document.querySelector('.popup-cart-product');
const popupName = popup.querySelector('.popup-cart__name h4');
const popupDeleteBtn = popup.querySelector('.popup-cart__delete');
const popupCancelBtns = popup.querySelectorAll('.popup-cart__close');
let removeUrl = null; // сюда будем сохранять ссылку удаления
// Открываем popup по клику на "Удалить"
document.querySelectorAll('.cart-product__delete').forEach(button => {
button.addEventListener('click', function(e) {
e.preventDefault();
const productName = this.getAttribute('data-product_name');
removeUrl = this.getAttribute('data-remove_url');
popupName.textContent = productName;
popup.style.display = 'flex';
});
});
// Закрываем popup по кнопкам "Отмена" и крестик
popupCancelBtns.forEach(btn => {
btn.addEventListener('click', () => {
popup.style.display = 'none';
removeUrl = null;
});
});
// При подтверждении удаляем товар — просто переходим по ссылке удаления
popupDeleteBtn.addEventListener('click', () => {
if (removeUrl) {
window.location.href = removeUrl;
}
});
});
document.addEventListener('DOMContentLoaded', function() {
const checkboxAll = document.getElementById('cart-checkbox__all');
const productCheckboxes = document.querySelectorAll('.cart-product__checkbox input[type="checkbox"]');
const btnDeleteSelected = document.querySelector('.cart-delete-all');
const popup = document.querySelector('.popup-cart');
const popupCancelBtns = popup.querySelectorAll('.popup-cart__close');
const popupDeleteBtn = popup.querySelector('.popup-cart__delete');
const form = document.querySelector('.woocommerce-cart-form');
// Выбор/снятие выбора всех
checkboxAll.addEventListener('change', function() {
productCheckboxes.forEach(chk => {
chk.checked = checkboxAll.checked;
});
});
// Обновляем чекбокс "выбрать все"
productCheckboxes.forEach(chk => {
chk.addEventListener('change', function() {
const allChecked = Array.from(productCheckboxes).every(chk => chk.checked);
checkboxAll.checked = allChecked;
});
});
// Открываем попап подтверждения удаления
btnDeleteSelected.addEventListener('click', function(e) {
e.preventDefault();
const anyChecked = Array.from(productCheckboxes).some(chk => chk.checked);
if (!anyChecked) {
alert('Выберите хотя бы один товар для удаления.');
return;
}
popup.style.display = 'flex';
});
// Закрываем попап
popupCancelBtns.forEach(btn => {
btn.addEventListener('click', () => {
popup.style.display = 'none';
});
});
// При подтверждении удаления
popupDeleteBtn.addEventListener('click', () => {
// Собираем выбранные ключи корзины ПЕРЕД удалением
const selectedKeys = Array.from(productCheckboxes)
.filter(chk => chk.checked)
.map(chk => chk.value);
// Удаляем старые hidden поля (только type=hidden, не чекбоксы)
form.querySelectorAll('input[type="hidden"][name="cart_product_keys[]"]').forEach(el => el.remove());
// Для каждого выбранного создаем hidden input для отправки на сервер
selectedKeys.forEach(key => {
const input = document.createElement('input');
input.type = 'hidden';
input.name = 'cart_product_keys[]';
input.value = key;
form.appendChild(input);
});
// Добавляем поле, сигнализирующее об удалении
let inputDelete = form.querySelector('input[name="delete_selected"]');
if (!inputDelete) {
inputDelete = document.createElement('input');
inputDelete.type = 'hidden';
inputDelete.name = 'delete_selected';
inputDelete.value = '1';
form.appendChild(inputDelete);
}
form.submit();
});
});
</script>
<div class="popup popup-cart">
<div class="popup-fon popup-cart__fon"></div>
<div class="popup-main">
<button class="popup-close popup-cart__close"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1269_41481)"><path d="M23.7068 0.293275C23.5193 0.105804 23.2649 0.000488281 22.9998 0.000488281C22.7346 0.000488281 22.4803 0.105804 22.2928 0.293275L11.9998 10.5863L1.70679 0.293275C1.51926 0.105804 1.26495 0.000488281 0.999786 0.000488281C0.734622 0.000488281 0.480314 0.105804 0.292786 0.293275C0.105315 0.480802 0 0.735111 0 1.00027C0 1.26544 0.105315 1.51975 0.292786 1.70727L10.5858 12.0003L0.292786 22.2933C0.105315 22.4808 0 22.7351 0 23.0003C0 23.2654 0.105315 23.5197 0.292786 23.7073C0.480314 23.8947 0.734622 24.0001 0.999786 24.0001C1.26495 24.0001 1.51926 23.8947 1.70679 23.7073L11.9998 13.4143L22.2928 23.7073C22.4803 23.8947 22.7346 24.0001 22.9998 24.0001C23.2649 24.0001 23.5193 23.8947 23.7068 23.7073C23.8943 23.5197 23.9996 23.2654 23.9996 23.0003C23.9996 22.7351 23.8943 22.4808 23.7068 22.2933L13.4138 12.0003L23.7068 1.70727C23.8943 1.51975 23.9996 1.26544 23.9996 1.00027C23.9996 0.735111 23.8943 0.480802 23.7068 0.293275Z" fill="#808080"/></g><defs><clipPath id="clip0_1269_41481"><rect width="24" height="24" fill="white"/></clipPath></defs></svg></button>
<div class="popup-cart__col">
<div class="popup-cart__name">
<h4>Удалить выбранные товары</h4>
<p>Вы точно хотите удалить выбранные товары из корзины? <br> Отменить данное действие будет невозможно.</p>
</div>
<div class="popup-cart__buttons">
<button class="popup-cart__cancel popup-cart__close">Отмена</button>
<button class="popup-cart__delete">Да, удалить</button>
</div>
</div>
</div>
</div>
<div class="popup popup-cart-product">
<div class="popup-fon popup-cart-product__fon"></div>
<div class="popup-main">
<button class="popup-close popup-cart-product__close"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1269_41481)"><path d="M23.7068 0.293275C23.5193 0.105804 23.2649 0.000488281 22.9998 0.000488281C22.7346 0.000488281 22.4803 0.105804 22.2928 0.293275L11.9998 10.5863L1.70679 0.293275C1.51926 0.105804 1.26495 0.000488281 0.999786 0.000488281C0.734622 0.000488281 0.480314 0.105804 0.292786 0.293275C0.105315 0.480802 0 0.735111 0 1.00027C0 1.26544 0.105315 1.51975 0.292786 1.70727L10.5858 12.0003L0.292786 22.2933C0.105315 22.4808 0 22.7351 0 23.0003C0 23.2654 0.105315 23.5197 0.292786 23.7073C0.480314 23.8947 0.734622 24.0001 0.999786 24.0001C1.26495 24.0001 1.51926 23.8947 1.70679 23.7073L11.9998 13.4143L22.2928 23.7073C22.4803 23.8947 22.7346 24.0001 22.9998 24.0001C23.2649 24.0001 23.5193 23.8947 23.7068 23.7073C23.8943 23.5197 23.9996 23.2654 23.9996 23.0003C23.9996 22.7351 23.8943 22.4808 23.7068 22.2933L13.4138 12.0003L23.7068 1.70727C23.8943 1.51975 23.9996 1.26544 23.9996 1.00027C23.9996 0.735111 23.8943 0.480802 23.7068 0.293275Z" fill="#808080"/></g><defs><clipPath id="clip0_1269_41481"><rect width="24" height="24" fill="white"/></clipPath></defs></svg></button>
<div class="popup-cart__col">
<div class="popup-cart__name">
<h4>Акрил прозрачный 1,5мм (оргстекло) экструдированный, Quinn Plastics</h4>
<p>Вы точно хотите удалить выбранный товар из корзины? <br> Отменить данное действие будет невозможно.</p>
</div>
<div class="popup-cart__buttons">
<button class="popup-cart__cancel popup-cart__close">Отмена</button>
<button class="popup-cart__delete">Да, удалить</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,51 @@
<?php
/**
* Cross-sells
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cross-sells.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.6.0
*/
defined( 'ABSPATH' ) || exit;
if ( $cross_sells ) : ?>
<div class="cross-sells">
<?php
$heading = apply_filters( 'woocommerce_product_cross_sells_products_heading', __( 'You may be interested in&hellip;', 'woocommerce' ) );
if ( $heading ) :
?>
<h2><?php echo esc_html( $heading ); ?></h2>
<?php endif; ?>
<?php woocommerce_product_loop_start(); ?>
<?php foreach ( $cross_sells as $cross_sell ) : ?>
<?php
$post_object = get_post( $cross_sell->get_id() );
setup_postdata( $GLOBALS['post'] = $post_object ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found
wc_get_template_part( 'content', 'product' );
?>
<?php endforeach; ?>
<?php woocommerce_product_loop_end(); ?>
</div>
<?php
endif;
wp_reset_postdata();

View File

@ -0,0 +1,131 @@
<?php
/**
* Mini-cart
*
* Contains the markup for the mini-cart, used by the cart widget.
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/mini-cart.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.4.0
*/
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_before_mini_cart' ); ?>
<?php if ( WC()->cart && ! WC()->cart->is_empty() ) : ?>
<div class="woocommerce-mini-cart-wrapper" style="max-height: 400px; overflow-y: auto; margin-bottom: 15px;">
<ul class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr( $args['list_class'] ); ?>">
<?php
do_action( 'woocommerce_before_mini_cart_contents' );
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
/**
* This filter is documented in woocommerce/templates/cart/cart.php.
*
* @since 2.1.0
*/
$product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key );
$thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
$product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
?>
<li class="woocommerce-mini-cart-item <?php echo esc_attr( apply_filters( 'woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key ) ); ?>">
<?php
echo apply_filters( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'woocommerce_cart_item_remove_link',
sprintf(
'<a href="%s" class="remove remove_from_cart_button" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s" data-success_message="%s">&times;</a>',
esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
/* translators: %s is the product name */
esc_attr( sprintf( __( 'Remove %s from cart', 'woocommerce' ), wp_strip_all_tags( $product_name ) ) ),
esc_attr( $product_id ),
esc_attr( $cart_item_key ),
esc_attr( $_product->get_sku() ),
/* translators: %s is the product name */
esc_attr( sprintf( __( '&ldquo;%s&rdquo; has been removed from your cart', 'woocommerce' ), wp_strip_all_tags( $product_name ) ) )
),
$cart_item_key
);
?>
<?php if ( empty( $product_permalink ) ) : ?>
<?php echo $thumbnail . wp_kses_post( $product_name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<a href="<?php echo esc_url( $product_permalink ); ?>">
<?php echo $thumbnail . wp_kses_post( $product_name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a>
<?php endif; ?>
<?php echo wc_get_formatted_cart_item_data( $cart_item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php
// Check for discount from tags
$discount_percent = 0;
$parent_id = $_product->is_type('variation') ? $_product->get_parent_id() : $_product->get_id();
if ( function_exists('get_sorted_product_tags') && function_exists('is_discount_tag') && function_exists('get_discount_from_tag_name') ) {
$tags = get_sorted_product_tags( $parent_id );
foreach ( $tags as $tag ) {
if ( is_discount_tag( $tag->name ) ) {
$discount_percent = get_discount_from_tag_name( $tag->name );
break;
}
}
}
// Build price HTML with strikethrough original price if discount exists
$price_html = $product_price;
if ( $discount_percent > 0 ) {
// Calculate original price (before discount)
$current_price = floatval( $_product->get_price() );
$original_price = $current_price / (1 - $discount_percent / 100);
$original_price_formatted = wc_price( $original_price );
$price_html = $product_price . ' <del class="mini-cart-old-price">' . $original_price_formatted . '</del>';
}
echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s &times; %s', $cart_item['quantity'], $price_html ) . '</span>', $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</li>
<?php
}
}
do_action( 'woocommerce_mini_cart_contents' );
?>
</ul>
</div>
<p class="woocommerce-mini-cart__total total">
<?php
/**
* Hook: woocommerce_widget_shopping_cart_total.
*
* @hooked woocommerce_widget_shopping_cart_subtotal - 10
*/
do_action( 'woocommerce_widget_shopping_cart_total' );
?>
</p>
<?php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); ?>
<p class="woocommerce-mini-cart__buttons buttons"><?php do_action( 'woocommerce_widget_shopping_cart_buttons' ); ?></p>
<?php do_action( 'woocommerce_widget_shopping_cart_after_buttons' ); ?>
<?php else : ?>
<p class="woocommerce-mini-cart__empty-message"><?php esc_html_e( 'No products in the cart.', 'woocommerce' ); ?></p>
<?php endif; ?>
<?php do_action( 'woocommerce_after_mini_cart' ); ?>

View File

@ -0,0 +1,6 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="checkout-button button alt wc-forward<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php esc_html_e( 'Proceed to checkout', 'woocommerce' ); ?></a>

View File

@ -0,0 +1,96 @@
<?php
/**
* Shipping Calculator
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/shipping-calculator.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
*/
defined( 'ABSPATH' ) || exit;
do_action( 'woocommerce_before_shipping_calculator' ); ?>
<form class="woocommerce-shipping-calculator" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
<?php printf( '<a href="#" class="shipping-calculator-button" aria-expanded="false" aria-controls="shipping-calculator-form" role="button">%s</a>', esc_html( ! empty( $button_text ) ? $button_text : __( 'Calculate shipping', 'woocommerce' ) ) ); ?>
<section class="shipping-calculator-form" id="shipping-calculator-form" style="display:none;">
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_country', true ) ) : ?>
<p class="form-row form-row-wide" id="calc_shipping_country_field">
<label for="calc_shipping_country"><?php esc_html_e( 'Country / region', 'woocommerce' ); ?></label>
<select name="calc_shipping_country" id="calc_shipping_country" class="country_to_state country_select" rel="calc_shipping_state">
<option value="default"><?php esc_html_e( 'Select a country / region&hellip;', 'woocommerce' ); ?></option>
<?php
foreach ( WC()->countries->get_shipping_countries() as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '"' . selected( WC()->customer->get_shipping_country(), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';
}
?>
</select>
</p>
<?php endif; ?>
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_state', true ) ) : ?>
<p class="form-row form-row-wide" id="calc_shipping_state_field">
<?php
$current_cc = WC()->customer->get_shipping_country();
$current_r = WC()->customer->get_shipping_state();
$states = WC()->countries->get_states( $current_cc );
if ( is_array( $states ) && empty( $states ) ) {
?>
<input type="hidden" name="calc_shipping_state" id="calc_shipping_state" />
<?php
} elseif ( is_array( $states ) ) {
?>
<span>
<label for="calc_shipping_state"><?php esc_html_e( 'State / County', 'woocommerce' ); ?></label>
<select name="calc_shipping_state" class="state_select" id="calc_shipping_state">
<option value=""><?php esc_html_e( 'Select an option&hellip;', 'woocommerce' ); ?></option>
<?php
foreach ( $states as $ckey => $cvalue ) {
echo '<option value="' . esc_attr( $ckey ) . '" ' . selected( $current_r, $ckey, false ) . '>' . esc_html( $cvalue ) . '</option>';
}
?>
</select>
</span>
<?php
} else {
?>
<label for="calc_shipping_state"><?php esc_html_e( 'State / County', 'woocommerce' ); ?></label>
<input type="text" class="input-text" value="<?php echo esc_attr( $current_r ); ?>" name="calc_shipping_state" id="calc_shipping_state" />
<?php
}
?>
</p>
<?php endif; ?>
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_city', true ) ) : ?>
<p class="form-row form-row-wide" id="calc_shipping_city_field">
<label for="calc_shipping_city"><?php esc_html_e( 'City:', 'woocommerce' ); ?></label>
<input type="text" class="input-text" value="<?php echo esc_attr( WC()->customer->get_shipping_city() ); ?>" name="calc_shipping_city" id="calc_shipping_city" />
</p>
<?php endif; ?>
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true ) ) : ?>
<p class="form-row form-row-wide" id="calc_shipping_postcode_field">
<label for="calc_shipping_postcode"><?php esc_html_e( 'Postcode / ZIP:', 'woocommerce' ); ?></label>
<input type="text" class="input-text" value="<?php echo esc_attr( WC()->customer->get_shipping_postcode() ); ?>" name="calc_shipping_postcode" id="calc_shipping_postcode" />
</p>
<?php endif; ?>
<p><button type="submit" name="calc_shipping" value="1" class="button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php esc_html_e( 'Update', 'woocommerce' ); ?></button></p>
<?php wp_nonce_field( 'woocommerce-shipping-calculator', 'woocommerce-shipping-calculator-nonce' ); ?>
</section>
</form>
<?php do_action( 'woocommerce_after_shipping_calculator' ); ?>

View File

@ -0,0 +1,25 @@
<?php
/**
* Cart errors page
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/cart-errors.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.5.0
*/
defined( 'ABSPATH' ) || exit;
?>
<p><?php esc_html_e( 'There are some issues with the items in your cart. Please go back to the cart page and resolve these issues before checking out.', 'woocommerce' ); ?></p>
<?php do_action( 'woocommerce_cart_has_errors' ); ?>
<p><a class="button wc-backward" href="<?php echo esc_url( wc_get_cart_url() ); ?>"><?php esc_html_e( 'Return to cart', 'woocommerce' ); ?></a></p>

View File

@ -0,0 +1,89 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<div class="checkout-col">
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<div class="checkout-name">
<span>1</span>
<h3>ваши данные</h3>
</div>
<div class="checkout-block">
<div class="checkout-data">
<div class="checkout-data__tabs">
<button class="checkout-data__tab active" type="button">Физическое лицо</button>
<button class="checkout-data__tab" type="button">Юридическое лицо или ИП</button>
</div>
<div class="checkout-data__content active">
<div class="checkout-data__input">
<input type="text" id="billing_fio" placeholder="ФИО*" autocomplete="name" required>
</div>
<div class="checkout-data__input">
<input type="tel" id="billing_phone_phys" class="phone" placeholder="+7 (999) 999-99-99*" autocomplete="tel" required>
</div>
<div class="checkout-data__input">
<input type="email" id="billing_email_phys" placeholder="E-mail*" autocomplete="email" required>
</div>
</div>
<div class="checkout-data__content">
<div class="checkout-data__input">
<input type="text" id="billing_company_name" placeholder="Наименование организации*" required>
</div>
<div class="checkout-data__input">
<input type="text" id="billing_inn" placeholder="ИНН*" required>
</div>
<div class="checkout-data__input">
<input type="text" id="billing_kpp" placeholder="КПП">
</div>
<div class="checkout-data__input">
<input type="text" id="billing_legal_address" placeholder="Юридический адрес*" required>
</div>
<div class="checkout-data__input">
<input type="text" id="billing_actual_address" placeholder="Фактический адрес*" required>
</div>
<div class="checkout-data__input">
<input type="text" id="billing_contact_person" placeholder="Контактное лицо*" autocomplete="name" required>
</div>
<div class="checkout-data__input">
<input type="tel" id="billing_phone_legal" class="phone" placeholder="+7 (999) 999-99-99*" autocomplete="tel" required>
</div>
<div class="checkout-data__input">
<input type="email" id="billing_email_legal" placeholder="E-mail*" autocomplete="email" required>
</div>
</div>
</div>
</div>
<!-- Скрытые поля для WooCommerce (синхронизируются через JS) -->
<input type="hidden" name="billing_country" id="billing_country" value="RU">
<input type="hidden" name="billing_first_name" id="billing_first_name_hidden" value="">
<input type="hidden" name="billing_email" id="billing_email_hidden" value="">
<input type="hidden" name="billing_phone" id="billing_phone_hidden" value="">
<input type="hidden" name="billing_person_type" id="billing_person_type_hidden" value="physical">
<input type="hidden" name="billing_company_name_val" id="billing_company_name_hidden" value="">
<input type="hidden" name="billing_inn_val" id="billing_inn_hidden" value="">
<input type="hidden" name="billing_kpp_val" id="billing_kpp_hidden" value="">
<input type="hidden" name="billing_legal_address_val" id="billing_legal_address_hidden" value="">
<input type="hidden" name="billing_actual_address_val" id="billing_actual_address_hidden" value="">
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
</div>
<?php
// $fields = $checkout->get_checkout_fields( 'billing' );
// $required_fields = ['billing_first_name', 'billing_phone', 'billing_email'];
// $counter = 1;
// foreach ( $fields as $key => $field ) {
// if (in_array($key, $required_fields)) {
?>
<!-- <div class="checkout-step-1__input">
<label for="checkout-input-<?php echo $counter; ?>"><?php echo $field['label']; ?></label>
<input type="<?php echo ($key === 'billing_email') ? 'email' : 'text'; ?>"
id="checkout-input-<?php echo $counter; ?>"
placeholder="<?php echo ($key === 'billing_phone') ? 'Номер телефона' : ($key === 'billing_first_name' ? 'Ваше имя' : 'Email'); ?>"
name="<?php echo $key; ?>"
value="<?php echo esc_attr($checkout->get_value($key)); ?>"
autocomplete="<?php echo $key === 'billing_email' ? 'email' : 'name'; ?>"
class="<?php echo ($key === 'billing_phone') ? 'phone' : ''; ?>"
required>
</div> -->
<?php
// $counter++;
// }
// }
?>

View File

@ -0,0 +1,474 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
do_action( 'woocommerce_before_checkout_form', $checkout );
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
return;
}
?>
<section class="checkout">
<div class="checkout-container container">
<h1>Оформление заказа</h1>
<form name="checkout" method="post" class="woocommerce-checkout checkout-main" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data" aria-label="<?php echo esc_attr__( 'Checkout', 'woocommerce' ); ?>">
<div class="checkout-left">
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<?php do_action( 'woocommerce_checkout_billing' ); ?>
<?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
<?php do_action( 'woocommerce_review_order_before_shipping' ); ?>
<?php wc_cart_totals_shipping_html(); ?>
<?php do_action( 'woocommerce_review_order_after_shipping' ); ?>
<?php endif; ?>
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php endif; ?>
<?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?>
<div class="checkout-col">
<div class="checkout-name">
<span>4</span>
<h3>Комментарий к заказу</h3>
</div>
<div class="checkout-block">
<div class="checkout-comment">
<div class="checkout-comment__col">
<textarea name="order_comments" id="order_comments" placeholder="Комментарий..."></textarea>
<p class="checkout-data__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'comment_hint' ) ) ); ?></p>
</div>
<div class="checkout-comment__file">
<div class="checkout-comment__file-input">
<input type="file" id="checkout-file" name="checkout-file">
<label for="checkout-file">
<p>Прикрепить файл</p>
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3029_15970)"><path d="M15.2986 6.89996C15.1735 6.77498 15.004 6.70477 14.8272 6.70477C14.6504 6.70477 14.4809 6.77498 14.3559 6.89996L7.09455 14.1926C6.78503 14.5022 6.41756 14.7478 6.01312 14.9153C5.60869 15.0829 5.17522 15.1691 4.73745 15.1692C3.85334 15.1692 3.00542 14.8181 2.38022 14.193C1.75501 13.5678 1.40374 12.72 1.40368 11.8359C1.40362 10.9518 1.75477 10.1038 2.37988 9.47863L9.41255 2.41729C9.78861 2.04722 10.2957 1.84074 10.8233 1.84283C11.3509 1.84491 11.8563 2.0554 12.2294 2.42843C12.6025 2.80147 12.8131 3.30683 12.8154 3.83443C12.8176 4.36204 12.6112 4.86915 12.2412 5.24529L5.20855 12.3066C5.08172 12.4281 4.91286 12.496 4.73722 12.496C4.56157 12.496 4.39272 12.4281 4.26588 12.3066C4.1409 12.1816 4.07069 12.0121 4.07069 11.8353C4.07069 11.6585 4.1409 11.489 4.26588 11.364L10.5272 5.07396C10.6487 4.94823 10.7159 4.77982 10.7143 4.60503C10.7128 4.43023 10.6427 4.26302 10.5191 4.13942C10.3955 4.01581 10.2283 3.9457 10.0535 3.94418C9.87869 3.94266 9.71029 4.00986 9.58455 4.13129L3.32322 10.4213C3.13746 10.607 2.99011 10.8275 2.88958 11.0702C2.78905 11.3129 2.73731 11.573 2.73731 11.8356C2.73731 12.0983 2.78905 12.3584 2.88958 12.6011C2.99011 12.8437 3.13746 13.0642 3.32322 13.25C3.7043 13.6136 4.2108 13.8165 4.73755 13.8165C5.2643 13.8165 5.7708 13.6136 6.15188 13.25L13.1839 6.18796C13.7959 5.56016 14.1359 4.71653 14.1303 3.83981C14.1247 2.96309 13.7739 2.12388 13.1539 1.50398C12.5339 0.884072 11.6946 0.533391 10.8179 0.527898C9.94118 0.522404 9.09759 0.862542 8.46988 1.47463L1.43722 8.53596C0.562003 9.41118 0.0703125 10.5982 0.0703125 11.836C0.0703125 13.0737 0.562003 14.2607 1.43722 15.136C2.31243 16.0112 3.49948 16.5029 4.73722 16.5029C5.97496 16.5029 7.162 16.0112 8.03722 15.136L15.2986 7.84529C15.3608 7.78334 15.4103 7.70969 15.444 7.62858C15.4777 7.54746 15.4951 7.46048 15.4951 7.37263C15.4951 7.28478 15.4777 7.1978 15.444 7.11668C15.4103 7.03556 15.3608 6.96191 15.2986 6.89996V6.89996Z" fill="white"/></g><defs><clipPath id="clip0_3029_15970"><rect width="16" height="16" fill="white" transform="translate(0 0.5)"/></clipPath></defs></svg>
</label>
</div>
<p class="checkout-data__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'file_hint' ) ) ); ?></p>
</div>
</div>
</div>
</div>
<div class="checkout-col">
<div class="checkout-name">
<span>5</span>
<h3>Способ оплаты</h3>
</div>
<div class="checkout-block">
<div class="checkout-payments">
<div class="checkout-payment">
<input type="radio" id="checkout-payment-1" name="checkout-payments" checked="">
<label for="checkout-payment-1">Сформировать счет*</label>
</div>
<div class="checkout-payment">
<input type="radio" id="checkout-payment-2" name="checkout-payments">
<label for="checkout-payment-2">Оплата онлайн</label>
</div>
<p class="checkout-payments__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'payment_description' ) ) ); ?></p>
<p class="checkout-payments__online-description" style="display:none;"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'online_payment_description' ) ) ); ?></p>
</div>
</div>
</div>
</div>
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
<div id="order_review" class="woocommerce-checkout-review-order checkout-right">
<div class="checkout-sidebar">
<h3>Ваша корзина</h3>
<div class="checkout-sidebar__col">
<?php
$count = WC()->cart->get_cart_contents_count();
function plural_form($number, $forms) {
$n = abs($number) % 100;
$n1 = $n % 10;
if ($n > 10 && $n < 20) return $forms[2];
if ($n1 > 1 && $n1 < 5) return $forms[1];
if ($n1 == 1) return $forms[0];
return $forms[2];
}
$word = plural_form($count, ['товар', 'товара', 'товаров']);
?>
<div class="checkout-sidebar__row">
<p>Количество товаров:</p>
<p><?php echo $count . ' ' . $word; ?></p>
</div>
<?php
$cart = WC()->cart;
$total_weight = 0;
foreach ( $cart->get_cart() as $item ) {
$product = $item['data'];
$qty = $item['quantity'];
$weight = (float) $product->get_weight();
$total_weight += $weight * $qty;
}
?>
<div class="checkout-sidebar__row">
<p>Вес заказа:</p>
<p><?php echo number_format($total_weight, 3, '.', ' '); ?> кг</p>
</div>
<?php
$cart = WC()->cart;
$items = $cart->get_cart();
$regular_total = 0;
$sale_total = 0;
foreach ( $items as $item ) {
$product = $item['data'];
$quantity = $item['quantity'];
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $sale_price === '' ) {
$sale_price = $regular_price;
}
$regular_total += $regular_price * $quantity;
$sale_total += $sale_price * $quantity;
}
$discount_total = $regular_total - $sale_total;
?>
<div class="checkout-sidebar__row">
<p>Стоимость товара без скидки:</p>
<p><?php echo wc_price($regular_total); ?></p>
</div>
<div class="checkout-sidebar__row">
<p>Скидка на товар:</p>
<p><?php echo wc_price($discount_total); ?></p>
</div>
<?php
$cart = WC()->cart;
$regular_total = 0;
$sale_total = 0;
foreach ( $cart->get_cart() as $item ) {
$product = $item['data'];
$qty = $item['quantity'];
$regular_price = $product->get_regular_price();
$sale_price = $product->get_sale_price();
if ( $sale_price === '' ) {
$sale_price = $regular_price;
}
$regular_total += $regular_price * $qty;
$sale_total += $sale_price * $qty;
}
$cart_discount = orgsteklo_calculate_cart_discount( $sale_total );
$final_total = $sale_total - $cart_discount['amount'];
?>
<?php if ( $cart_discount['percent'] > 0 ) : ?>
<div class="checkout-sidebar__row">
<p>Скидка от суммы заказа (<?php echo $cart_discount['percent']; ?>%):</p>
<p><?php echo wc_price( $cart_discount['amount'] ); ?></p>
</div>
<?php endif; ?>
<div class="checkout-sidebar__row" id="checkout-sidebar__delivery" style="display:none;">
<p>Стоимость доставки:</p>
<p id="checkout-delivery-price">0 </p>
</div>
</div>
<div class="checkout-sidebar__price-col">
<p class="checkout-sidebar__price-title">Итоговая стоимость заказа:</p>
<div class="cart-total__price-row">
<p class="cart-total__price" id="checkout-final-total" data-base-total="<?php echo esc_attr($final_total); ?>" data-regular-total="<?php echo esc_attr($regular_total); ?>"><?php echo number_format($final_total, 0, ',', ' '); ?> <span>₽</span></p>
<?php if ( $regular_total > $final_total ) : ?>
<p class="cart-total__oldprice" id="checkout-old-total"><?php echo number_format($regular_total, 0, ',', ' '); ?> <span>₽</span></p>
<?php endif; ?>
</div>
</div>
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
</div>
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
</form>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function () {
const deliveryBlock = document.getElementById('checkout-sidebar__delivery');
const deliveryPriceEl = document.getElementById('checkout-delivery-price');
const shippingInputs = document.querySelectorAll('.shipping_method');
const kmRate = <?php echo intval( orgsteklo_get_checkout_setting( 'moscow_area_km_rate' ) ); ?>;
function updateDeliveryVisibility() {
const selected = document.querySelector('.shipping_method:checked');
if (! selected) return;
let cost = parseFloat( selected.dataset.cost || 0 );
const shippingId = selected.id || '';
// Для МО: базовая стоимость + N руб/км от МКАД
if ( shippingId === 'shipping_method_0_dostavka-po-moskovskoj-oblasti' ) {
const kmInput = document.getElementById('shipping_km_mkad');
const km = kmInput ? parseFloat(kmInput.value) || 0 : 0;
cost = cost + (kmRate * km);
}
if ( cost > 0 ) {
deliveryBlock.style.display = 'flex';
deliveryPriceEl.textContent = Math.round(cost).toLocaleString('ru-RU') + ' ₽';
} else {
deliveryBlock.style.display = 'none';
}
// Обновляем итоговую сумму с учётом доставки
const totalEl = document.getElementById('checkout-final-total');
const oldTotalEl = document.getElementById('checkout-old-total');
if ( totalEl ) {
const baseTotal = parseFloat(totalEl.dataset.baseTotal) || 0;
const regularTotal = parseFloat(totalEl.dataset.regularTotal) || 0;
const deliveryCost = cost > 0 ? cost : 0;
const newTotal = Math.round(baseTotal + deliveryCost);
totalEl.innerHTML = newTotal.toLocaleString('ru-RU') + ' <span>₽</span>';
if ( oldTotalEl && regularTotal > baseTotal ) {
const newOldTotal = Math.round(regularTotal + deliveryCost);
oldTotalEl.innerHTML = newOldTotal.toLocaleString('ru-RU') + ' <span>₽</span>';
}
}
}
shippingInputs.forEach(input => {
input.addEventListener('change', updateDeliveryVisibility);
});
// Пересчёт при вводе км от МКАД
document.addEventListener('input', function(e) {
if (e.target && e.target.id === 'shipping_km_mkad') {
updateDeliveryVisibility();
}
});
// Инициализация при загрузке страницы
updateDeliveryVisibility();
jQuery( document.body ).on( 'updated_checkout', updateDeliveryVisibility );
});
jQuery(document).ready(function($) {
function updateDeliveryBlock() {
// Сначала скрываем все возможные блоки
$('#checkout-delivery_pickup, #checkout-delivery_moscow, #checkout-delivery_moscow_area, #checkout-delivery_region, #checkout-delivery_pochta').hide();
// Находим выбранный метод
const selected = $('.shipping_method:checked').attr('id');
// Показываем нужный блок в зависимости от id
switch (selected) {
case 'shipping_method_0_samovyvoz':
$('#checkout-delivery_pickup').show();
break;
case 'shipping_method_0_dostavka-po-moskve':
$('#checkout-delivery_moscow').show();
break;
case 'shipping_method_0_dostavka-po-moskovskoj-oblasti':
$('#checkout-delivery_moscow_area').show();
break;
case 'shipping_method_0_v-drugoj-region':
$('#checkout-delivery_region').show();
break;
case 'shipping_method_0_v-drugoj-region-pochtoj-rossii':
$('#checkout-delivery_pochta').show();
break;
}
}
// При загрузке страницы
updateDeliveryBlock();
// При изменении метода доставки
$(document).on('change', '.shipping_method', function() {
updateDeliveryBlock();
});
// При AJAX-обновлении (если WooCommerce Checkout делает пересчёт)
$(document.body).on('updated_checkout', function() {
updateDeliveryBlock();
});
});
jQuery(document).ready(function($) {
function updateOrderButtonText(method) {
const $orderButton = $('#place_order');
if (method === 'cod') {
$orderButton.text('Отправить заказ для выставления счета');
$orderButton.val('Отправить заказ для выставления счета');
$orderButton.attr('data-value', 'Отправить заказ для выставления счета');
} else {
$orderButton.text('Оплатить заказ');
$orderButton.val('Оплатить заказ');
$orderButton.attr('data-value', 'Оплатить заказ');
}
}
function syncPaymentRadios() {
$('.checkout-payment input[type="radio"]').on('change', function() {
const customID = $(this).attr('id');
$('.wc_payment_methods input[name="payment_method"]').prop('checked', false);
if (customID === 'checkout-payment-1') {
$('#payment_method_cod').prop('checked', true).trigger('change');
updateOrderButtonText('cod');
} else if (customID === 'checkout-payment-2') {
$('#payment_method_bacs').prop('checked', true).trigger('change');
updateOrderButtonText('bacs');
}
});
$('.wc_payment_methods input[name="payment_method"]').on('change', function() {
const method = $(this).val();
if (method === 'cod') {
$('#checkout-payment-1').prop('checked', true);
} else if (method === 'bacs') {
$('#checkout-payment-2').prop('checked', true);
}
updateOrderButtonText(method);
});
}
// Инициализация
syncPaymentRadios();
// При загрузке страницы: установить текст в зависимости от выбранного способа оплаты
const initialMethod = $('.wc_payment_methods input[name="payment_method"]:checked').val();
updateOrderButtonText(initialMethod);
// При ajax-обновлении формы
$(document.body).on('updated_checkout', function() {
syncPaymentRadios();
const updatedMethod = $('.wc_payment_methods input[name="payment_method"]:checked').val();
updateOrderButtonText(updatedMethod);
});
});
/* ===== Управление видимостью способов оплаты ===== */
jQuery(document).ready(function($) {
window.updatePaymentMethodVisibility = function() {
var $paymentCod = $('#checkout-payment-1').closest('.checkout-payment');
var $paymentBacs = $('#checkout-payment-2').closest('.checkout-payment');
var $descCod = $('.checkout-payments__description');
var $descOnline = $('.checkout-payments__online-description');
// Определяем тип покупателя: 0 = физ. лицо, 1 = юр. лицо
var personTab = $('.checkout-data__tab.active').index();
// Определяем способ доставки
var shippingId = $('.shipping_method:checked').attr('id') || '';
var isRemote = (
shippingId === 'shipping_method_0_v-drugoj-region' ||
shippingId === 'shipping_method_0_v-drugoj-region-pochtoj-rossii'
);
if (isRemote) {
// Другой регион / Почта России → только "Сформировать счёт" для всех
$paymentCod.show();
$paymentBacs.hide();
$('#checkout-payment-1').prop('checked', true).trigger('change');
$descCod.show();
$descOnline.hide();
} else if (personTab === 1) {
// Юр. лицо + локальная доставка → оба способа
$paymentCod.show();
$paymentBacs.show();
// Показываем описание в зависимости от выбранного способа
if ($('#checkout-payment-2').is(':checked')) {
$descCod.hide();
$descOnline.show();
} else {
$descCod.show();
$descOnline.hide();
}
} else {
// Физ. лицо + локальная доставка → только "Оплата онлайн"
$paymentCod.hide();
$paymentBacs.show();
$('#checkout-payment-2').prop('checked', true).trigger('change');
$descCod.hide();
$descOnline.show();
}
};
// Переключение описаний при смене радиокнопки оплаты
$(document).on('change', '.checkout-payment input[type="radio"]', function() {
var $descCod = $('.checkout-payments__description');
var $descOnline = $('.checkout-payments__online-description');
if ($('#checkout-payment-2').is(':checked')) {
$descCod.hide();
$descOnline.show();
} else {
$descCod.show();
$descOnline.hide();
}
});
// Привязка к событиям
$(document).on('change', '.shipping_method', function() {
updatePaymentMethodVisibility();
});
$(document.body).on('updated_checkout', function() {
updatePaymentMethodVisibility();
});
// Инициализация при загрузке
updatePaymentMethodVisibility();
// Синхронизация кастомных полей с WooCommerce hidden fields
function syncBillingFields() {
var personTab = $('.checkout-data__tab.active').index();
if ( personTab === 0 ) {
// Физ. лицо
$('#billing_first_name_hidden').val( $('#billing_fio').val() );
$('#billing_phone_hidden').val( $('#billing_phone_phys').val() );
$('#billing_email_hidden').val( $('#billing_email_phys').val() );
$('#billing_person_type_hidden').val('physical');
// Очищаем юр. поля
$('#billing_company_name_hidden, #billing_inn_hidden, #billing_kpp_hidden, #billing_legal_address_hidden, #billing_actual_address_hidden').val('');
} else {
// Юр. лицо
$('#billing_first_name_hidden').val( $('#billing_contact_person').val() );
$('#billing_phone_hidden').val( $('#billing_phone_legal').val() );
$('#billing_email_hidden').val( $('#billing_email_legal').val() );
$('#billing_company_name_hidden').val( $('#billing_company_name').val() );
$('#billing_inn_hidden').val( $('#billing_inn').val() );
$('#billing_kpp_hidden').val( $('#billing_kpp').val() );
$('#billing_legal_address_hidden').val( $('#billing_legal_address').val() );
$('#billing_actual_address_hidden').val( $('#billing_actual_address').val() );
$('#billing_person_type_hidden').val('legal');
}
}
// Синхронизируем при любом вводе
$(document).on('input change', '.checkout-data input', syncBillingFields);
// Синхронизируем перед отправкой заказа
$(document.body).on('checkout_place_order', function() {
syncBillingFields();
});
// Валидация чекбокса согласия перед отправкой
$(document.body).on('checkout_place_order', function() {
if ( !$('#checkout-checkbox').is(':checked') ) {
if ( $('.checkout-checkbox-error').length === 0 ) {
$('.consult-checkbox').append(
'<p class="checkout-checkbox-error" style="color: #F02E13; font-size: 1.2rem; margin-top: 0.4rem;">Необходимо согласиться с политикой конфиденциальности и публичной офертой</p>'
);
}
$('html, body').animate({
scrollTop: $('.consult-checkbox').offset().top - 100
}, 300);
return false;
}
$('.checkout-checkbox-error').remove();
return true;
});
$('#checkout-checkbox').on('change', function() {
if ( $(this).is(':checked') ) {
$('.checkout-checkbox-error').remove();
}
});
});
</script>
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>

View File

@ -0,0 +1,51 @@
<?php
/**
* Checkout coupon form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.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.8.0
*/
defined( 'ABSPATH' ) || exit;
if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
return;
}
?>
<div class="woocommerce-form-coupon-toggle">
<?php
/**
* Filter checkout coupon message.
*
* @param string $message coupon message.
* @return string Filtered message.
*
* @since 1.0.0
*/
wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', esc_html__( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" role="button" aria-label="' . esc_attr__( 'Enter your coupon code', 'woocommerce' ) . '" aria-controls="woocommerce-checkout-form-coupon" aria-expanded="false" class="showcoupon">' . esc_html__( 'Click here to enter your code', 'woocommerce' ) . '</a>' ), 'notice' );
?>
</div>
<form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none" id="woocommerce-checkout-form-coupon">
<p class="form-row form-row-first">
<label for="coupon_code" class="screen-reader-text"><?php esc_html_e( 'Coupon:', 'woocommerce' ); ?></label>
<input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
</p>
<p class="form-row form-row-last">
<button type="submit" class="button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
</p>
<div class="clear"></div>
</form>

View File

@ -0,0 +1,36 @@
<?php
/**
* Checkout login form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/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 3.8.0
*/
defined( 'ABSPATH' ) || exit;
if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) {
return;
}
?>
<div class="woocommerce-form-login-toggle">
<?php wc_print_notice( apply_filters( 'woocommerce_checkout_login_message', esc_html__( 'Returning customer?', 'woocommerce' ) ) . ' <a href="#" class="showlogin">' . esc_html__( 'Click here to login', 'woocommerce' ) . '</a>', 'notice' ); ?>
</div>
<?php
woocommerce_login_form(
array(
'message' => esc_html__( 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'woocommerce' ),
'redirect' => wc_get_checkout_url(),
'hidden' => true,
)
);

View File

@ -0,0 +1,109 @@
<?php
/**
* Pay for order form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-pay.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.2.0
*/
defined( 'ABSPATH' ) || exit;
$totals = $order->get_order_item_totals(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
?>
<form id="order_review" method="post">
<table class="shop_table">
<thead>
<tr>
<th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
<th class="product-quantity"><?php esc_html_e( 'Qty', 'woocommerce' ); ?></th>
<th class="product-total"><?php esc_html_e( 'Totals', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( count( $order->get_items() ) > 0 ) : ?>
<?php foreach ( $order->get_items() as $item_id => $item ) : ?>
<?php
if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
continue;
}
?>
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
<td class="product-name">
<?php
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
wc_display_item_meta( $item );
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
?>
</td>
<td class="product-quantity"><?php echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '&times;&nbsp;%s', esc_html( $item->get_quantity() ) ) . '</strong>', $item ); ?></td><?php // @codingStandardsIgnoreLine ?>
<td class="product-subtotal"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td><?php // @codingStandardsIgnoreLine ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<?php if ( $totals ) : ?>
<?php foreach ( $totals as $total ) : ?>
<tr>
<th scope="row" colspan="2"><?php echo $total['label']; ?></th><?php // @codingStandardsIgnoreLine ?>
<td class="product-total"><?php echo $total['value']; ?></td><?php // @codingStandardsIgnoreLine ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tfoot>
</table>
<?php
/**
* Triggered from within the checkout/form-pay.php template, immediately before the payment section.
*
* @since 8.2.0
*/
do_action( 'woocommerce_pay_order_before_payment' );
?>
<div id="payment">
<?php if ( $order->needs_payment() ) : ?>
<ul class="wc_payment_methods payment_methods methods">
<?php
if ( ! empty( $available_gateways ) ) {
foreach ( $available_gateways as $gateway ) {
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
}
} else {
echo '<li>';
wc_print_notice( apply_filters( 'woocommerce_no_available_payment_methods_message', esc_html__( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) ), 'notice' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
echo '</li>';
}
?>
</ul>
<?php endif; ?>
<div class="form-row">
<input type="hidden" name="woocommerce_pay" value="1" />
<?php wc_get_template( 'checkout/terms.php' ); ?>
<?php do_action( 'woocommerce_pay_order_before_submit' ); ?>
<?php echo apply_filters( 'woocommerce_pay_order_button_html', '<button type="submit" class="button alt' . esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ) . '" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
<?php do_action( 'woocommerce_pay_order_after_submit' ); ?>
<?php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); ?>
</div>
</div>
</form>

View File

@ -0,0 +1,90 @@
<?php defined( 'ABSPATH' ) || exit; ?>
<div class="checkout-col">
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<div class="checkout-name">
<span>3</span>
<h3>Адрес доставки</h3>
</div>
<div class="checkout-block">
<div class="checkout-pickup" id="checkout-delivery_pickup">
<div class="checkout-pickup__block">
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_728_26367)"><path d="M7.9987 4.5C7.47128 4.5 6.95571 4.6564 6.51718 4.94941C6.07865 5.24243 5.73685 5.65891 5.53502 6.14618C5.33319 6.63345 5.28038 7.16962 5.38327 7.68691C5.48617 8.20419 5.74014 8.67935 6.11308 9.05229C6.48602 9.42523 6.96118 9.6792 7.47846 9.78209C7.99574 9.88499 8.53192 9.83218 9.01919 9.63035C9.50646 9.42851 9.92293 9.08672 10.216 8.64819C10.509 8.20966 10.6654 7.69408 10.6654 7.16667C10.6654 6.45942 10.3844 5.78115 9.88432 5.28105C9.38422 4.78095 8.70594 4.5 7.9987 4.5ZM7.9987 8.5C7.73499 8.5 7.4772 8.4218 7.25794 8.27529C7.03867 8.12878 6.86778 7.92055 6.76686 7.67691C6.66594 7.43328 6.63954 7.16519 6.69099 6.90655C6.74243 6.64791 6.86942 6.41033 7.05589 6.22386C7.24236 6.03739 7.47994 5.9104 7.73858 5.85895C7.99722 5.80751 8.26531 5.83391 8.50894 5.93483C8.75258 6.03574 8.96082 6.20664 9.10733 6.42591C9.25383 6.64517 9.33203 6.90296 9.33203 7.16667C9.33203 7.52029 9.19156 7.85943 8.94151 8.10948C8.69146 8.35952 8.35232 8.5 7.9987 8.5Z" fill="#02ADEF"></path><path d="M8.00021 16.5001C7.43884 16.503 6.88495 16.3713 6.38492 16.1161C5.88489 15.861 5.45327 15.4897 5.12621 15.0334C2.58554 11.5288 1.29688 8.89411 1.29688 7.20211C1.29688 5.42428 2.00312 3.71926 3.26024 2.46214C4.51735 1.20502 6.22237 0.498779 8.00021 0.498779C9.77804 0.498779 11.4831 1.20502 12.7402 2.46214C13.9973 3.71926 14.7035 5.42428 14.7035 7.20211C14.7035 8.89411 13.4149 11.5288 10.8742 15.0334C10.5471 15.4897 10.1155 15.861 9.6155 16.1161C9.11547 16.3713 8.56158 16.503 8.00021 16.5001ZM8.00021 1.95411C6.60849 1.9557 5.27422 2.50926 4.29012 3.49336C3.30603 4.47746 2.75246 5.81172 2.75087 7.20345C2.75087 8.54345 4.01287 11.0214 6.30354 14.1808C6.498 14.4486 6.75312 14.6666 7.04802 14.817C7.34291 14.9673 7.66921 15.0456 8.00021 15.0456C8.33121 15.0456 8.6575 14.9673 8.9524 14.817C9.24729 14.6666 9.50241 14.4486 9.69687 14.1808C11.9875 11.0214 13.2495 8.54345 13.2495 7.20345C13.248 5.81172 12.6944 4.47746 11.7103 3.49336C10.7262 2.50926 9.39193 1.9557 8.00021 1.95411Z" fill="#02ADEF"></path></g><defs><clipPath id="clip0_728_26367"><rect width="16" height="16" fill="white" transform="translate(0 0.5)"></rect></clipPath></defs></svg>
<div class="checkout-pickup__block-col">
<h4 class="checkout-pickup__block-title"><?php echo esc_html( orgsteklo_get_checkout_setting( 'pickup_address' ) ); ?></h4>
<p class="checkout-pickup__block-time"><?php echo esc_html( orgsteklo_get_checkout_setting( 'pickup_hours' ) ); ?></p>
<p class="checkout-pickup__block-description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'pickup_description' ) ) ); ?></p>
<?php $map_link = orgsteklo_get_checkout_setting( 'pickup_map_link' ); ?>
<?php if ( $map_link ) : ?>
<a href="<?php echo esc_url( $map_link ); ?>" target="_blank" class="checkout-pickup__block-link">
Показать на карте
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.0013 7.99996C11.9981 7.64922 11.8567 7.31389 11.608 7.06663L8.74797 4.19997C8.62306 4.0758 8.45409 4.0061 8.27797 4.0061C8.10185 4.0061 7.93288 4.0758 7.80797 4.19997C7.74548 4.26194 7.69589 4.33567 7.66204 4.41691C7.6282 4.49815 7.61077 4.58529 7.61077 4.6733C7.61077 4.76131 7.6282 4.84844 7.66204 4.92968C7.69589 5.01092 7.74548 5.08466 7.80797 5.14663L10.0013 7.33329H3.33464C3.15782 7.33329 2.98826 7.40353 2.86323 7.52856C2.73821 7.65358 2.66797 7.82315 2.66797 7.99996C2.66797 8.17677 2.73821 8.34634 2.86323 8.47136C2.98826 8.59639 3.15782 8.66663 3.33464 8.66663H10.0013L7.80797 10.86C7.68243 10.9846 7.61156 11.154 7.61093 11.3309C7.61031 11.5078 7.67998 11.6778 7.80464 11.8033C7.92929 11.9288 8.0987 11.9997 8.27561 12.0003C8.45252 12.001 8.62243 11.9313 8.74797 11.8066L11.608 8.93996C11.8584 8.69106 11.9998 8.35301 12.0013 7.99996Z" fill="#02ADEF"></path></svg>
</a>
<?php endif; ?>
</div>
</div>
<?php $map_iframe = orgsteklo_get_checkout_setting( 'pickup_map_iframe' ); ?>
<?php if ( $map_iframe ) : ?>
<div class="checkout-pickup__map">
<iframe src="<?php echo esc_url( $map_iframe ); ?>" width="500" height="400" frameborder="0"></iframe>
</div>
<?php endif; ?>
</div>
<div class="checkout-data" id="checkout-delivery_moscow">
<div class="checkout-data__input">
<input type="text" placeholder="Улица*" autocomplete="street-address" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Дом*" required>
</div>
</div>
<div class="checkout-data" id="checkout-delivery_moscow_area">
<div class="checkout-data__input">
<input type="text" placeholder="Город*" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Улица*" autocomplete="street-address" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Дом*" required>
</div>
<div class="checkout-data__input">
<input type="number" id="shipping_km_mkad" name="shipping_km_mkad" placeholder="Количество километров от МКАД*" min="0" required>
</div>
<p class="checkout-data__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'moscow_area_warning' ) ) ); ?></p>
</div>
<div class="checkout-data" id="checkout-delivery_region">
<div class="checkout-data__input">
<input type="text" placeholder="Регион*" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Город*" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Улица*" autocomplete="street-address" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Дом*" required>
</div>
<p class="checkout-data__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'region_description' ) ) ); ?></p>
</div>
<div class="checkout-data" id="checkout-delivery_pochta">
<div class="checkout-data__input">
<input type="text" placeholder="Индекс*" autocomplete="postal-code" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Регион*" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Город*" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Улица*" autocomplete="street-address" required>
</div>
<div class="checkout-data__input">
<input type="text" placeholder="Дом*" required>
</div>
<p class="checkout-data__description"><?php echo nl2br( esc_html( orgsteklo_get_checkout_setting( 'pochta_description' ) ) ); ?></p>
</div>
</div>
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
</div>

View File

@ -0,0 +1,53 @@
<?php
/**
* Email verification page.
*
* This displays instead of the thankyou page any time that the customer cannot be identified.
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou-verify-email.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 7.9.0
*
* @var bool $failed_submission Indicates if the last attempt to verify failed.
* @var string $verify_url The URL for the email verification form.
*/
defined( 'ABSPATH' ) || exit;
?>
<form name="checkout" method="post" class="woocommerce-form woocommerce-verify-email" action="<?php echo esc_url( $verify_url ); ?>">
<?php
wp_nonce_field( 'wc_verify_email', 'check_submission' );
if ( $failed_submission ) {
wc_print_notice( esc_html__( 'We were unable to verify the email address you provided. Please try again.', 'woocommerce' ), 'error' );
}
?>
<p>
<?php
printf(
/* translators: 1: opening login link 2: closing login link */
esc_html__( 'To view this page, you must either %1$slogin%2$s or verify the email address associated with the order.', 'woocommerce' ),
'<a href="' . esc_url( wc_get_page_permalink( 'myaccount' ) ) . '">',
'</a>'
);
?>
</p>
<p class="form-row">
<label for="email"><?php esc_html_e( 'Email address', 'woocommerce' ); ?>&nbsp;<span class="required">*</span></label>
<input type="email" class="input-text" name="email" id="email" autocomplete="email" />
</p>
<p class="form-row">
<button type="submit" class="woocommerce-button button <?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ); ?>" name="verify" value="1">
<?php esc_html_e( 'Verify', 'woocommerce' ); ?>
</button>
</p>
</form>

View File

@ -0,0 +1,46 @@
<?php
/**
* Checkout Order Receipt Template
*
* 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;
}
?>
<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() ); ?>
<div class="clear"></div>

View File

@ -0,0 +1,42 @@
<?php
/**
* "Order received" message.
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/order-received.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.8.0
*
* @var WC_Order|false $order
*/
defined( 'ABSPATH' ) || exit;
?>
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received">
<?php
/**
* Filter the message shown after a checkout is complete.
*
* @since 2.2.0
*
* @param string $message The message.
* @param WC_Order|false $order The order created during checkout, or false if order data is not available.
*/
$message = apply_filters(
'woocommerce_thankyou_order_received_text',
esc_html( __( 'Thank you. Your order has been received.', 'woocommerce' ) ),
$order
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $message;
?>
</p>

View File

@ -0,0 +1,33 @@
<?php
/**
* Output a single payment method
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment-method.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.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<li class="wc_payment_method payment_method_<?php echo esc_attr( $gateway->id ); ?>">
<input id="payment_method_<?php echo esc_attr( $gateway->id ); ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />
<label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>">
<?php echo $gateway->get_title(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?> <?php echo $gateway->get_icon(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?>
</label>
<?php if ( $gateway->has_fields() || $gateway->get_description() ) : ?>
<div class="payment_box payment_method_<?php echo esc_attr( $gateway->id ); ?>" <?php if ( ! $gateway->chosen ) : /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>style="display:none;"<?php endif; /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>>
<?php $gateway->payment_fields(); ?>
</div>
<?php endif; ?>
</li>

View File

@ -0,0 +1,50 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( ! wp_doing_ajax() ) {
do_action( 'woocommerce_review_order_before_payment' );
}
?>
<div id="payment" class="woocommerce-checkout-payment">
<?php if ( WC()->cart && WC()->cart->needs_payment() ) : ?>
<ul class="wc_payment_methods payment_methods methods">
<?php
if ( ! empty( $available_gateways ) ) {
foreach ( $available_gateways as $gateway ) {
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
}
} else {
echo '<li>';
wc_print_notice( apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__( 'Sorry, it seems that there are no available payment methods. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) : esc_html__( 'Please fill in your details above to see available payment methods.', 'woocommerce' ) ), 'notice' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
echo '</li>';
}
?>
</ul>
<?php endif; ?>
<div class="form-row place-order">
<noscript>
<?php
/* translators: $1 and $2 opening and closing emphasis tags respectively */
printf( esc_html__( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'woocommerce' ), '<em>', '</em>' );
?>
<br/><button type="submit" class="button alt<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>"><?php esc_html_e( 'Update totals', 'woocommerce' ); ?></button>
</noscript>
<?php do_action( 'woocommerce_review_order_before_submit' ); ?>
<?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button checkout-submit alt' . esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ) . '" name="woocommerce_checkout_place_order" id="place_order" value="Оплатить заказ" data-value="Оплатить заказ">Оплатить заказ</button>' ); ?>
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
<?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
<div class="consult-checkbox">
<input type="checkbox" id="checkout-checkbox">
<label for="checkout-checkbox">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy" target="_blank">политикой конфиденциальности</a> и <a href="/agreement" target="_blank">публичной офертой</a></label>
</div>
<p class="checkout-description">Чтобы оформить заказ, требуется перейти в <a href="/login">профиль</a></p>
</div>
</div>
<?php
if ( ! wp_doing_ajax() ) {
do_action( 'woocommerce_review_order_after_payment' );
}

View File

@ -0,0 +1 @@
<?php defined( 'ABSPATH' ) || exit; ?>

View File

@ -0,0 +1,40 @@
<?php
/**
* Checkout terms and conditions area.
*
* @package WooCommerce\Templates
* @version 3.4.0
*/
defined( 'ABSPATH' ) || exit;
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) ) {
do_action( 'woocommerce_checkout_before_terms_and_conditions' );
?>
<div class="woocommerce-terms-and-conditions-wrapper">
<?php
/**
* Terms and conditions hook used to inject content.
*
* @since 3.4.0.
* @hooked wc_checkout_privacy_policy_text() Shows custom privacy policy text. Priority 20.
* @hooked wc_terms_and_conditions_page_content() Shows t&c page content. Priority 30.
*/
do_action( 'woocommerce_checkout_terms_and_conditions' );
?>
<?php if ( wc_terms_and_conditions_checkbox_enabled() ) : ?>
<p class="form-row validate-required">
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
<input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); // WPCS: input var ok, csrf ok. ?> id="terms" />
<span class="woocommerce-terms-and-conditions-checkbox-text"><?php wc_terms_and_conditions_checkbox_text(); ?></span>&nbsp;<abbr class="required" title="<?php esc_attr_e( 'required', 'woocommerce' ); ?>">*</abbr>
</label>
<input type="hidden" name="terms-field" value="1" />
</p>
<?php endif; ?>
</div>
<?php
do_action( 'woocommerce_checkout_after_terms_and_conditions' );
}

View File

@ -0,0 +1,90 @@
<?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>

View File

@ -0,0 +1,57 @@
<?php
/**
* The template for displaying product category thumbnails within loops
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-product-cat.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 4.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<li <?php wc_product_cat_class( '', $category ); ?>>
<?php
/**
* The woocommerce_before_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_open - 10
*/
do_action( 'woocommerce_before_subcategory', $category );
/**
* The woocommerce_before_subcategory_title hook.
*
* @hooked woocommerce_subcategory_thumbnail - 10
*/
do_action( 'woocommerce_before_subcategory_title', $category );
/**
* The woocommerce_shop_loop_subcategory_title hook.
*
* @hooked woocommerce_template_loop_category_title - 10
*/
do_action( 'woocommerce_shop_loop_subcategory_title', $category );
/**
* The woocommerce_after_subcategory_title hook.
*/
do_action( 'woocommerce_after_subcategory_title', $category );
/**
* The woocommerce_after_subcategory hook.
*
* @hooked woocommerce_template_loop_category_link_close - 10
*/
do_action( 'woocommerce_after_subcategory', $category );
?>
</li>

View File

@ -0,0 +1,152 @@
<?php
defined( 'ABSPATH' ) || exit;
global $product;
if ( empty( $product ) || ! $product->is_visible() ) {
return;
}
$current_product_id = get_the_ID();
?>
<div class="product_item">
<div class="product_item-img">
<?php
$product_id = $product->get_id();
$product_link = get_permalink( $product_id );
echo '<a href="' . esc_url($product_link) . '" class="product_item-img__link">';
$product_image_id = $product->get_image_id();
if ( $product_image_id ) {
$image_url = wp_get_attachment_image_url( $product_image_id, 'full' );
echo '<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $product->get_name() ) . '">';
}
else {
$placeholder_url = wc_placeholder_img_src( 'woocommerce_single' );
echo '<img src="' . esc_url( $placeholder_url ) . '" alt="' . esc_attr( $product->get_name() ) . '">';
}
echo '</a>';
?>
<?php
// Получаем отсортированные теги (сначала статус, потом скидки)
$sorted_tags = get_sorted_product_tags( get_the_ID() );
if ( ! empty( $sorted_tags ) ) {
echo '<div class="product_item-labels">';
// Выводим все метки (статусные и скидки)
// Теперь метки со скидками автоматически применяют скидку к цене через хуки
foreach ( $sorted_tags as $tag ) {
$is_discount = is_discount_tag( $tag->name );
$class = $is_discount ? 'product_item-discount' : 'product_item-popular';
echo '<p class="' . esc_attr( $class ) . '">' . esc_html( $tag->name ) . '</p>';
}
echo '</div>';
}
?>
</div>
<div class="product_item-main">
<a href="<?php echo esc_url( $product_link ); ?>" class="product_item-title"><?php echo esc_html( $product->get_name() ); ?></a>
<?php
$char_1 = get_post_meta( $product->get_id(), '_preview_char_1', true );
$char_2 = get_post_meta( $product->get_id(), '_preview_char_2', true );
if ( $char_1 || $char_2 ) {
echo '<ul class="product_item-chars">';
if ( $char_1 ) {
echo '<li>' . esc_html( $char_1 ) . '</li>';
}
if ( $char_2 ) {
echo '<li>' . esc_html( $char_2 ) . '</li>';
}
echo '</ul>';
}
?>
<div class="product_item-meta">
<?php
// Универсальный вывод цен для всех типов товаров
if ( $product ) {
$display_product = $product;
// Для вариативных товаров берём первую вариацию
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
$variation_id = $available_variations[0]['variation_id'] ?? null;
if ( $variation_id ) {
$display_product = wc_get_product( $variation_id );
}
}
// Получаем цены (с учётом автоматических скидок по меткам)
$price = wc_get_price_to_display( $display_product );
$regular_price = wc_get_price_to_display( $display_product, [ 'price' => $display_product->get_regular_price() ] );
// Проверяем, является ли товар оргстеклом
$is_orgsteklo_product = ! empty( get_post_meta( $product->get_id(), '_orgsteklo_price_table', true ) );
if ( $is_orgsteklo_product && function_exists( 'orgsteklo_get_product_table_data' ) && function_exists( 'orgsteklo_calculate_standard_size' ) ) {
// ОРГСТЕКЛО — цены из таблицы калькулятора
$table_data = orgsteklo_get_product_table_data( $product->get_id() );
if ( $table_data && ! empty( $table_data['rows'] ) ) {
$first_row = $table_data['rows'][0];
$calc_result = orgsteklo_calculate_standard_size( $product->get_id(), $first_row['thickness'], 1 );
if ( ! is_wp_error( $calc_result ) ) {
$sheet_price = $calc_result['price_standard_sheet'];
$kg_price = $calc_result['price_per_kg_standard'];
// Проверяем скидку из тегов
$discount_percent = 0;
if ( function_exists('get_sorted_product_tags') && function_exists('is_discount_tag') && function_exists('get_discount_from_tag_name') ) {
$tags = get_sorted_product_tags( $product->get_id() );
foreach ( $tags as $tag ) {
if ( is_discount_tag( $tag->name ) ) {
$discount_percent = get_discount_from_tag_name( $tag->name );
break;
}
}
}
$regular_sheet_price = $sheet_price;
$regular_kg_price = $kg_price;
if ( $discount_percent > 0 ) {
$sheet_price = round( $regular_sheet_price * ( 1 - $discount_percent / 100 ) );
$kg_price = round( $regular_kg_price * ( 1 - $discount_percent / 100 ) );
}
// Цена за лист
echo '<div class="product_item-prices">';
echo '<p class="product_item-price">' . wc_price( $sheet_price ) . '/лист</p>';
if ( $discount_percent > 0 ) {
echo '<p class="product_item-oldprice">' . wc_price( $regular_sheet_price ) . '</p>';
}
echo '</div>';
// Цена за кг
echo '<div class="product_item-price_weight">';
echo '<p class="product_item-price_weight-new">' . wc_price( $kg_price ) . '/кг</p>';
if ( $discount_percent > 0 ) {
echo '<p class="product_item-price_weight-old">' . wc_price( $regular_kg_price ) . '</p>';
}
echo '</div>';
}
}
} else {
// Остальные товары — цена за штуку
echo '<div class="product_item-prices">';
echo '<p class="product_item-price">' . wc_price( $price ) . '/штука</p>';
if ( $regular_price > $price ) {
echo '<p class="product_item-oldprice">' . wc_price( $regular_price ) . '</p>';
}
echo '</div>';
}
}
?>
<!-- <div class="product_item-prices">
<p class="product_item-price">15 964 /лист</p>
<p class="product_item-oldprice">16 989 </p>
</div>
<div class="product_item-price_weight">
<p class="product_item-price_weight-new">4 589 /кг</p>
<p class="product_item-price_weight-old">5 589 </p>
</div> -->
</div>
<a href="<?php echo esc_url( $product_link ); ?>" class="product_item-link">Подробнее</a>
</div>
</div>

View File

@ -0,0 +1,431 @@
<?php
defined( 'ABSPATH' ) || exit;
global $product;
$status_text = ''; // <-- добавлено: инициализация переменной, чтобы не было Warning
do_action( 'woocommerce_before_single_product' );
if ( post_password_required() ) {
echo get_the_password_form();
return;
}
?>
<nav class="breadcumbs container">
<ul>
<li><a href="<?php echo esc_url(home_url('/')); ?>">Главная</a></li>
<li><p class="breadcumbs-separator">/</p></li>
<li><a href="<?php echo esc_url(get_permalink(wc_get_page_id('shop'))); ?>">Каталог</a></li>
<?php
global $post;
$terms = get_the_terms($post->ID, 'product_cat');
if ($terms && !is_wp_error($terms)) {
$shown = [];
foreach ($terms as $term) {
$ancestors = get_ancestors($term->term_id, 'product_cat');
$ancestors = array_reverse($ancestors);
foreach ($ancestors as $ancestor_id) {
if (in_array($ancestor_id, $shown)) continue;
$ancestor = get_term($ancestor_id, 'product_cat');
echo '<li><p class="breadcumbs-separator">/</p></li>';
echo '<li><a href="' . esc_url(get_term_link($ancestor)) . '">' . esc_html($ancestor->name) . '</a></li>';
$shown[] = $ancestor_id;
}
if (!in_array($term->term_id, $shown)) {
echo '<li><p class="breadcumbs-separator">/</p></li>';
echo '<li><a href="' . esc_url(get_term_link($term)) . '">' . esc_html($term->name) . '</a></li>';
$shown[] = $term->term_id;
}
}
}
?>
<li><p class="breadcumbs-separator">/</p></li>
<li><p><?php the_title(); ?></p></li>
</ul>
</nav>
<section class="product_page">
<div class="product_page-container container">
<div class="product_page-main">
<div class="product_page-images">
<div class="product_page-labels">
<?php
global $product;
$custom_status = get_post_meta($product->get_id(), '_custom_stock_status', true);
if ($custom_status) {
$status_text = '';
switch ($custom_status) {
case 'in_stock':
$status_text = 'В наличии';
break;
case 'low_stock':
$status_text = 'Осталось мало';
break;
case 'on_order':
$status_text = 'Под заказ';
break;
}
if ($status_text) : ?>
<div class="product_page-aviable">
<p><?php echo esc_html($status_text); ?></p>
</div>
<?php endif;
}
?>
<?php
// Получаем отсортированные теги (сначала статус, потом скидки)
$sorted_tags = get_sorted_product_tags( get_the_ID() );
// Выводим все метки (статусные и скидки)
// Теперь метки со скидками автоматически применяют скидку к цене через хуки
foreach ( $sorted_tags as $tag ) {
$is_discount = is_discount_tag( $tag->name );
$class = $is_discount ? 'product_page-discount' : 'product_page-popular';
echo '<p class="' . esc_attr( $class ) . '">' . esc_html( $tag->name ) . '</p>';
}
?>
</div>
<?php get_template_part( 'woocommerce/single-product/product', 'image' ); ?>
</div>
<div class="product_page-col">
<?php
if ($status_text) : ?>
<div class="product_page-aviable">
<p><?php echo esc_html($status_text); ?></p>
</div>
<?php endif;
?>
<h2><?php the_title(); ?></h2>
<?php
$sku = $product->get_sku();
if ($sku) : ?>
<div class="product_page-sku">
<p>Код товара:</p>
<p><?php echo esc_html($sku); ?></p>
</div>
<?php endif; ?>
<?php
global $product;
$show_specs = ( $product instanceof WC_Product ) && $product->is_type( 'simple' );
if ( $show_specs ) {
/** ===== Длина */
$len_mm_meta = get_post_meta( $product->get_id(), '_variation_length', true );
if ( $len_mm_meta !== '' ) {
$len_mm_num = floatval( str_replace( ',', '.', preg_replace( '/\x{00A0}|\s/u', '', (string) $len_mm_meta ) ) );
$length_label = $len_mm_num > 0 ? number_format_i18n( $len_mm_num, 0 ) . ' мм' : '';
} else {
$len_sys = $product->get_length();
if ( $len_sys !== '' ) {
$unit = get_option( 'woocommerce_dimension_unit', 'cm' ); // 'mm','cm','m','in','yd'
$length_label = wc_format_localized_decimal( $len_sys ) . ' ' . $unit;
} else {
$length_label = '';
}
}
/** ===== Вес (3 знака, точка, всегда "кг") */
$weight_raw = $product->get_weight();
if ( $weight_raw !== '' ) {
$weight_num = (float) wc_format_decimal( $weight_raw );
$weight = number_format( $weight_num, 3, '.', '' ) . ' кг';
} else {
$weight = '';
}
/** ===== Атрибуты */
$attrs = $product->get_attributes();
// Собираем приоритетный диаметр и остаток
$diam_vn_html = ''; // diametr-vnesnij-vnutrennij
$diam_fallback = ''; // diametr (если нет основного)
$remaining_rows = [];
if ( ! empty( $attrs ) ) {
foreach ( $attrs as $attr ) {
if ( method_exists( $attr, 'get_visible' ) && ! $attr->get_visible() ) {
continue;
}
$raw_name = $attr->get_name();
$slug = $attr->is_taxonomy()
? wc_sanitize_taxonomy_name( str_replace( 'pa_', '', $raw_name ) )
: wc_sanitize_taxonomy_name( $raw_name );
// Пропускаем вес (ves) полностью — он выводится отдельно
if ( $slug === 'ves' ) {
continue;
}
// Получаем значение и метку
if ( $attr->is_taxonomy() ) {
$values = wc_get_product_terms(
$product->get_id(),
$attr->get_name(),
[ 'fields' => 'names' ]
);
$value = $values ? implode( ', ', $values ) : '';
$label = wc_attribute_label( $attr->get_name() );
} else {
$options = (array) $attr->get_options();
$options = array_map( static function( $v ) { return wp_kses_post( $v ); }, $options );
$value = $options ? implode( ', ', $options ) : '';
$label = wc_attribute_label( $attr->get_name() );
}
if ( $value === '' ) {
continue;
}
$row_html = '<div class="product-specs__row">
<span class="product-specs__label">' . esc_html( $label ) . ':</span>
<span class="product-specs__value">' . esc_html( $value ) . '</span>
</div>';
// Приоритет: diametr-vnesnij-vnutrennij → затем diametr
if ( $slug === 'diametr-vnesnij-vnutrennij' ) {
$diam_vn_html = $row_html;
continue; // не добавляем в остаток
}
if ( $slug === 'diametr' ) {
$diam_fallback = $row_html;
continue; // не добавляем в остаток
}
// Остальные атрибуты — в конец
$remaining_rows[] = $row_html;
}
}
// Печатаем блок, если есть что выводить
if ( $diam_vn_html || $diam_fallback || $length_label !== '' || $weight !== '' || ! empty( $remaining_rows ) ) :
?>
<div class="product-specs">
<div class="product-specs__list">
<?php
// 1) Диаметр (внешний/внутренний), если нет — обычный диаметр
echo $diam_vn_html ? $diam_vn_html : $diam_fallback;
// 2) Длина
if ( $length_label !== '' ) : ?>
<div class="product-specs__row">
<span class="product-specs__label">Длина:</span>
<span class="product-specs__value"><?php echo esc_html( $length_label ); ?></span>
</div>
<?php endif; ?>
<!-- 3) Вес 1 шт -->
<?php
// Для вариативных товаров не показываем (есть в селекте "Вес 1 шт")
// Для простых товаров - показываем
if ( $weight !== '' && ! $product->is_type('variable') ) :
?>
<div class="product-specs__row">
<span class="product-specs__label">Вес 1&nbsp;шт:</span>
<span class="product-specs__value"><?php echo esc_html( $weight ); ?></span>
</div>
<?php endif; ?>
<!-- 4) Цена 1 шт -->
<div class="product-specs__row">
<span class="product-specs__label">Цена 1&nbsp;шт:</span>
<span class="product-specs__value" style="color: var(--Blue);">
<?php
$price = (float) $product->get_price();
$regular_price = (float) $product->get_regular_price();
// Сначала текущая цена
echo number_format_i18n( $price, 0 ) . ' ₽';
// Потом зачёркнутая цена (если есть скидка)
if ( $product->is_on_sale() && $regular_price > $price ) {
echo '<span style="text-decoration: line-through; color: #999; margin-left: 8px;">';
echo number_format_i18n( $regular_price, 0 ) . ' ₽';
echo '</span>';
}
?>
</span>
</div>
<?php
// 5) Остальные атрибуты (кроме ves, diametr-vnesnij-vnutrennij, diametr)
if ( ! empty( $remaining_rows ) ) {
echo implode( '', $remaining_rows );
}
?>
</div>
</div>
<style>
.product-specs {margin-bottom: 16px;}
.product-specs__list {display: flex; flex-direction: column;}
.product-specs__row {display: flex; align-items: baseline; gap: 8px;}
.product-specs__label {
color: var(--Grey-2);
font-size: 1.4rem;
font-weight: 600;
line-height: 130%;
letter-spacing: -0.028rem;
}
.product-specs__value { color: var(--Black); font-weight: 600; }
</style>
<?php
endif;
}
?>
<?php do_action( 'woocommerce_single_product_summary' ); ?>
</div>
</div>
<div class="product_page-info">
<div class="product_page-tabs">
<button class="product_page-tab active">Характеристики</button>
<?php
$product_description = get_field('product_description');
$documentation_repeat_repeats = get_field('documentation_repeat_repeat');
if($product_description) {
echo '<button class="product_page-tab">Область применения</button>';
}
if($documentation_repeat_repeats) {
echo '<button class="product_page-tab">Документация</button>';
}
?>
</div>
<div class="product_page-tabs__mob">
<button class="product_page-tabs__mob-button">
<p>Характеристики</p>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9485 5.45312H7.79512H4.05512C3.41512 5.45312 3.09512 6.22646 3.54845 6.67979L7.00179 10.1331C7.55512 10.6865 8.45512 10.6865 9.00845 10.1331L10.3218 8.81979Л12.4618 6.67979C12.9085 6.22646 12.5885 5.45312 11.9485 5.45312Z" fill="#2C3846"/></svg>
</button>
<div class="product_page-tabs__mob-content">
<button class="product_page-tabs__mob-tab">
<p>Характеристики</p>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.99967 1.33325C4.32634 1.33325 1.33301 4.32659 1.33301 7.99992C1.33301 11.6733 4.32634 14.6666 7.99967 14.6666C11.673 14.6666 14.6663 11.6733 14.6663 7.99992C14.6663 4.32659 11.673 1.33325 7.99967 1.33325ZM11.1863 6.46659L7.40634 10.2466C7.31301 10.3399 7.18634 10.3933 7.05301 10.3933C6.91967 10.3933 6.79301 10.3399 6.69967 10.2466L4.81301 8.35992C4.61967 8.16659 4.61967 7.84659 4.81301 7.65325C5.00634 7.45992 5.32634 7.45992 5.51967 7.65325L7.05301 9.18659L10.4797 5.75992C10.673 5.56659 10.993 5.56659 11.1863 5.75992C11.3797 5.95325 11.3797 6.26659 11.1863 6.46659Z" fill="#02ADEF"/></svg>
</button>
<?php
if($product_description) {
echo '<button class="product_page-tabs__mob-tab"><p>Область применения</p><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.99967 1.33325C4.32634 1.33325 1.33301 4.32659 1.33301 7.99992C1.33301 11.6733 4.32634 14.6666 7.99967 14.6666C11.673 14.6666 14.6663 11.6733 14.6663 7.99992C14.6663 4.32659 11.673 1.33325 7.99967 1.33325ZM11.1863 6.46659L7.40634 10.2466C7.31301 10.3399 7.18634 10.3933 7.05301 10.3933C6.91967 10.3933 6.79301 10.3399 6.69967 10.2466L4.81301 8.35992C4.61967 8.16659 4.61967 7.84659 4.81301 7.65325C5.00634 7.45992 5.32634 7.45992 5.51967 7.65325L7.05301 9.18659L10.4797 5.75992C10.673 5.56659 10.993 5.56659 11.1863 5.75992C11.3797 5.95325 11.3797 6.26659 11.1863 6.46659Z" fill="#02ADEF"/></svg></button>';
}
if($documentation_repeat_repeats) {
echo '<button class="product_page-tabs__mob-tab"><p>Документация</p><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.99967 1.33325C4.32634 1.33325 1.33301 4.32659 1.33301 7.99992C1.33301 11.6733 4.32634 14.6666 7.99967 14.6666C11.673 14.6666 14.6663 11.6733 14.6663 7.99992C14.6663 4.32659 11.673 1.33325 7.99967 1.33325ZM11.1863 6.46659Л7.40634 10.2466C7.31301 10.3399 7.18634 10.3933 7.05301 10.3933C6.91967 10.3933 6.79301 10.3399 6.69967 10.2466L4.81301 8.35992C4.61967 8.16659 4.61967 7.84659 4.81301 7.65325C5.00634 7.45992 5.32634 7.45992 5.51967 7.65325L7.05301 9.18659Л10.4797 5.75992C10.673 5.56659 10.993 5.56659 11.1863 5.75992C11.3797 5.95325 11.3797 6.26659 11.1863 6.46659Z" fill="#02ADEF"/></svg></button>';
}
?>
</div>
</div>
<div class="product_page-content active">
<div class="product_page-description">
<h2>Характеристики и свойства</h2>
<div class="product_page-description-col">
<?php echo the_content(); ?>
</div>
</div>
</div>
<?php
if($product_description) {
echo '<div class="product_page-content"><div class="product_page-description"><h2>Область применения</h2><div class="product_page-description-col">' . $product_description . '</div></div></div>';
}
if($documentation_repeat_repeats) {
echo '<div class="product_page-content"><div class="product_page-docs"><h2>Документация для скачивания</h2><div class="product_page-docs__grid">';
foreach ($documentation_repeat_repeats as $index => $documentation_repeat_repeat) {
$documentation_repeat_repeat_title = $documentation_repeat_repeat['documentation_repeat_repeat_title'];
$documentation_repeat_repeat_format = $documentation_repeat_repeat['documentation_repeat_repeat_format'];
$documentation_repeat_repeat_razmer = $documentation_repeat_repeat['documentation_repeat_repeat_razmer'];
$documentation_repeat_repeat_file = $documentation_repeat_repeat['documentation_repeat_repeat_file'];
$documentation_repeat_repeat_file_url = $documentation_repeat_repeat_file ? esc_url($documentation_repeat_repeat_file['url']) : '';
echo '<div class="documentation-item">';
echo '<a href="' . $documentation_repeat_repeat_file_url . '" class="documentation-item__title">' . $documentation_repeat_repeat_title . '</a>';
echo '<div class="documentation-item__row">';
echo '<div class="documentation-item__info">';
if($documentation_repeat_repeat_format) {
echo '<p>' . $documentation_repeat_repeat_format . '</p>';
}
if($documentation_repeat_repeat_razmer) {
echo '<p>' . $documentation_repeat_repeat_razmer . '</p>';
}
echo '</div>';
echo '<a href="' . $documentation_repeat_repeat_file_url . '" class="documentation-item__download" download=""><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3011_8559)"><path d="M6.58516 12.0813C6.77089 12.2672 6.99143 12.4146 7.23416 12.5152C7.4769 12.6158 7.73707 12.6676 7.99983 12.6676C8.26258 12.6676 8.52275 12.6158 8.76549 12.5152C9.00822 12.4146 9.22876 12.2672 9.41449 12.0813L11.5552 9.94067C11.6699 9.81373 11.7315 9.64752 11.7271 9.47644C11.7227 9.30536 11.6527 9.14253 11.5316 9.02165C11.4104 8.90077 11.2474 8.8311 11.0764 8.82707C10.9053 8.82304 10.7392 8.88496 10.6125 9L8.66182 10.9513L8.66649 0.666667C8.66649 0.489856 8.59625 0.320286 8.47123 0.195262C8.34621 0.0702379 8.17664 0 7.99983 0V0C7.82301 0 7.65344 0.0702379 7.52842 0.195262C7.4034 0.320286 7.33316 0.489856 7.33316 0.666667L7.32716 10.9387L5.38716 9C5.26206 8.875 5.09244 8.8048 4.91559 8.80486C4.73874 8.80493 4.56916 8.87524 4.44416 9.00033C4.31915 9.12543 4.24896 9.29506 4.24902 9.4719C4.24909 9.64875 4.3194 9.81833 4.44449 9.94333L6.58516 12.0813Z" fill="#02ADEF"/><path d="M15.3333 10.6665C15.1565 10.6665 14.987 10.7367 14.8619 10.8618C14.7369 10.9868 14.6667 11.1564 14.6667 11.3332V13.9998C14.6667 14.1766 14.5964 14.3462 14.4714 14.4712C14.3464 14.5963 14.1768 14.6665 14 14.6665H2C1.82319 14.6665 1.65362 14.5963 1.5286 14.4712C1.40357 14.3462 1.33333 14.1766 1.33333 13.9998V11.3332C1.33333 11.1564 1.2631 10.9868 1.13807 10.8618C1.01305 10.7367 0.843478 10.6665 0.666667 10.6665C0.489856 10.6665 0.320286 10.7367 0.195262 10.8618C0.0702379 10.9868 0 11.1564 0 11.3332L0 13.9998C0 14.5303 0.210714 15.039 0.585786 15.414C0.960859 15.7891 1.46957 15.9998 2 15.9998H14C14.5304 15.9998 15.0391 15.7891 15.4142 15.414C15.7893 15.039 16 14.5303 16 13.9998V11.3332C16 11.1564 15.9298 10.9868 15.8047 10.8618C15.6797 10.7367 15.5101 10.6665 15.3333 10.6665Z" fill="#02ADEF"/></g><defs><clipPath id="clip0_3011_8559"><rect width="16" height="16" fill="white"/></clipPath></defs></svg></a>'; // оставить SVG как есть
echo '</div>';
echo '<div class="documentation-item__mob">';
echo '<a href="' . esc_url($documentation_repeat_repeat_file['url']) . '" class="documentation-item__title">' . $documentation_repeat_repeat_title . '</a>';
echo '<div class="documentation-item__info">';
if($documentation_repeat_repeat_format) {
echo '<p>' . $documentation_repeat_repeat_format . '</p>';
}
if($documentation_repeat_repeat_razmer) {
echo '<p>' . $documentation_repeat_repeat_razmer . '</p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '</div></div></div>';
}
?>
</div>
</div>
</section>
<?php
global $product;
$categories = wp_get_post_terms( $product->get_id(), 'product_cat', array( 'fields' => 'ids' ) );
// Расширяем до родительской категории и всех её дочерних
$all_categories = $categories;
foreach ( $categories as $cat_id ) {
$ancestors = get_ancestors( $cat_id, 'product_cat' );
$all_categories = array_merge( $all_categories, $ancestors );
foreach ( $ancestors as $ancestor_id ) {
$children = get_term_children( $ancestor_id, 'product_cat' );
$all_categories = array_merge( $all_categories, $children );
}
}
$categories = array_unique( $all_categories );
// Рекомендуемые товары: только с _is_recommended_product = 'yes' из той же категории
$recommended_args = array(
'post_type' => 'product',
'posts_per_page' => 8,
'post__not_in' => array( $product->get_id() ),
'ignore_sticky_posts' => 1,
'post_status' => array( 'publish', 'draft' ),
'orderby' => 'rand',
'meta_query' => array(
array(
'key' => '_is_recommended_product',
'value' => 'yes',
),
),
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $categories,
'operator' => 'IN',
),
),
);
$recommended_query = new WP_Query( $recommended_args );
$all_products = $recommended_query->posts;
if ( ! empty( $all_products ) ) :
global $post;
echo '<section class="cart_more"><div class="cart_more-container container"><div class="cart_more-name"><h2>Рекомендуемые товары</h2><a href="/catalog" class="cart_more-link">Все товары<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0007 9.99989C14.9966 9.56147 14.8199 9.14231 14.509 8.83323L10.934 5.2499C10.7778 5.09469 10.5666 5.00757 10.3465 5.00757C10.1263 5.00757 9.91512 5.09469 9.75898 5.2499C9.68088 5.32736 9.61888 5.41953 9.57657 5.52108C9.53427 5.62263 9.51249 5.73155 9.51249 5.84156C9.51249 5.95157 9.53427 6.06049 9.57657 6.16204C9.61888 6.26359 9.68088 6.35576 9.75898 6.43323L12.5007 9.16656H4.16732C3.9463 9.16656 3.73434 9.25435 3.57806 9.41064C3.42178 9.56692 3.33398 9.77888 3.33398 9.99989C3.33398 10.2209 3.42178 10.4329 3.57806 10.5891C3.73434 10.7454 3.9463 10.8332 4.16732 10.8332H12.5007L9.75898 13.5749C9.60206 13.7307 9.51347 13.9425 9.51269 14.1636C9.51191 14.3847 9.599 14.5971 9.75482 14.7541C9.91063 14.911 10.1224 14.9996 10.3435 15.0003C10.5647 15.0011 10.7771 14.914 10.934 14.7582L14.509 11.1749C14.822 10.8638 14.9988 10.4412 15.0007 9.99989Z" fill="#02ADEF"/></svg></a></div><div class="products-slider"><div class="products-swiper swiper"><div class="swiper-wrapper">';
foreach ( $all_products as $related_product ) :
$post = $related_product;
setup_postdata( $post );
echo '<div class="swiper-slide">';
wc_get_template_part( 'content', 'product' );
echo '</div>';
endforeach;
wp_reset_postdata();
echo '</div></div><button class="products-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.0596 13.28L5.7129 8.9333C5.19957 8.41997 5.19957 7.57997 5.7129 7.06664L10.0596 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button><button class="products-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.94043 13.28L10.2871 8.9333C10.8004 8.41997 10.8004 7.57997 10.2871 7.06664L5.94043 2.71997" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div><div class="cart_more-mob"><div class="products-mob">';
foreach ( $all_products as $related_product ) :
$post = $related_product;
setup_postdata( $post );
wc_get_template_part( 'content', 'product' );
endforeach;
wp_reset_postdata();
echo '</div><a href="/catalog" class="cart_more-mob__link">Все товары</a></div></div></section>';
endif;
?>

View File

@ -0,0 +1,42 @@
<?php
/**
* The template for displaying product price filter widget.
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-widget-price-filter.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 7.0.1
*/
defined( 'ABSPATH' ) || exit;
?>
<?php do_action( 'woocommerce_widget_price_filter_start', $args ); ?>
<form method="get" action="<?php echo esc_url( $form_action ); ?>">
<div class="price_slider_wrapper">
<div class="price_slider" style="display:none;"></div>
<div class="price_slider_amount" data-step="<?php echo esc_attr( $step ); ?>">
<label class="screen-reader-text" for="min_price"><?php esc_html_e( 'Min price', 'woocommerce' ); ?></label>
<input type="text" id="min_price" name="min_price" value="<?php echo esc_attr( $current_min_price ); ?>" data-min="<?php echo esc_attr( $min_price ); ?>" placeholder="<?php echo esc_attr__( 'Min price', 'woocommerce' ); ?>" />
<label class="screen-reader-text" for="max_price"><?php esc_html_e( 'Max price', 'woocommerce' ); ?></label>
<input type="text" id="max_price" name="max_price" value="<?php echo esc_attr( $current_max_price ); ?>" data-max="<?php echo esc_attr( $max_price ); ?>" placeholder="<?php echo esc_attr__( 'Max price', 'woocommerce' ); ?>" />
<?php /* translators: Filter: verb "to filter" */ ?>
<button type="submit" class="button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ); ?>"><?php echo esc_html__( 'Filter', 'woocommerce' ); ?></button>
<div class="price_label" style="display:none;">
<?php echo esc_html__( 'Price:', 'woocommerce' ); ?> <span class="from"></span> &mdash; <span class="to"></span>
</div>
<?php echo wc_query_string_form_fields( null, array( 'min_price', 'max_price', 'paged' ), '', true ); ?>
<div class="clear"></div>
</div>
</div>
</form>
<?php do_action( 'woocommerce_widget_price_filter_end', $args ); ?>

View File

@ -0,0 +1,43 @@
<?php
/**
* The template for displaying product widget entries.
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-widget-product.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.5.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $product;
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
?>
<li>
<?php do_action( 'woocommerce_widget_product_item_start', $args ); ?>
<a href="<?php echo esc_url( $product->get_permalink() ); ?>">
<?php echo $product->get_image(); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<span class="product-title"><?php echo wp_kses_post( $product->get_name() ); ?></span>
</a>
<?php if ( ! empty( $show_rating ) ) : ?>
<?php echo wc_get_rating_html( $product->get_average_rating() ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<?php echo $product->get_price_html(); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php do_action( 'woocommerce_widget_product_item_end', $args ); ?>
</li>

View File

@ -0,0 +1,47 @@
<?php
/**
* The template for displaying product widget entries.
*
* This template can be overridden by copying it to yourtheme/woocommerce/content-widget-reviews.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.4.0
*/
defined( 'ABSPATH' ) || exit;
?>
<li>
<?php do_action( 'woocommerce_widget_product_review_item_start', $args ); ?>
<?php
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
?>
<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php echo $product->get_image(); ?>
<span class="product-title"><?php echo wp_kses_post( $product->get_name() ); ?></span>
</a>
<?php echo wc_get_rating_html( intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ) ); ?>
<span class="reviewer">
<?php
/* translators: %s: Comment author. */
echo sprintf( esc_html__( 'by %s', 'woocommerce' ), get_comment_author( $comment->comment_ID ) );
?>
</span>
<?php
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
?>
<?php do_action( 'woocommerce_widget_product_review_item_end', $args ); ?>
</li>

View File

@ -0,0 +1,75 @@
<?php
/**
* Admin cancelled order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-cancelled-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php
echo $email_improvements_enabled ? '<div class="email-introduction">' : '';
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Notification to let you know &mdash; order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Were getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' );
}
?>
<p><?php printf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,76 @@
<?php
/**
* Admin failed order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-failed-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php
echo $email_improvements_enabled ? '<div class="email-introduction">' : '';
/* translators: %1$s: Order number. %2$s: Customer full name. */
$text = __( 'Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number. %2$s: Customer full name. */
$text = __( 'Unfortunately, the payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' );
}
?>
<p><?php printf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,74 @@
<?php
/**
* Admin new order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/admin-new-order.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\Emails\HTML
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php
echo $email_improvements_enabled ? '<div class="email-introduction">' : '';
/* translators: %s: Customer billing full name */
$text = __( 'Youve received the following order from %s:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %s: Customer billing full name */
$text = __( 'Woo! Youve received a new order from %s:', 'woocommerce' );
}
?>
<p><?php printf( esc_html( $text ), esc_html( $order->get_formatted_billing_full_name() ) ); ?></p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,83 @@
<?php
/**
* Customer completed order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<?php if ( $email_improvements_enabled ) : ?>
<p><?php esc_html_e( 'Weve successfully processed your order, and its on its way to you.', 'woocommerce' ); ?></p>
<p><?php esc_html_e( 'Heres a reminder of what youve ordered:', 'woocommerce' ); ?></p>
<?php else : ?>
<p><?php esc_html_e( 'We have finished processing your order.', 'woocommerce' ); ?></p>
<?php endif; ?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,94 @@
<?php
/**
* Customer failed order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-failed-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/**
* Hook for the woocommerce_email_header.
*
* @hooked WC_Emails::email_header() Output the email header
* @since 3.7.0
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<p><?php esc_html_e( "Unfortunately, we couldn't complete your order due to an issue with your payment method.", 'woocommerce' ); ?></p>
<?php /* translators: %s: Site title */ ?>
<p><?php printf( esc_html__( "If you'd like to continue with your purchase, please return to %s and try a different method of payment.", 'woocommerce' ), esc_html( $blogname ) ); ?></p>
<p><?php esc_html_e( 'Your order details are as follows:', 'woocommerce' ); ?></p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/**
* Hook for the woocommerce_email_order_details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for the woocommerce_email_order_meta.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
* @since 1.0.0
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for woocommerce_email_customer_details.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
* @since 1.0.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/**
* Hook for the woocommerce_email_footer.
*
* @hooked WC_Emails::email_footer() Output the email footer
* @since 3.7.0
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,133 @@
<?php
/**
* Customer invoice email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-invoice.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Enums\OrderStatus;
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/**
* Executes the e-mail header.
*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<?php if ( $order->needs_payment() ) { ?>
<p>
<?php
if ( $order->has_status( OrderStatus::FAILED ) ) {
printf(
wp_kses(
/* translators: %1$s Site title, %2$s Order pay link */
__( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ),
array(
'a' => array(
'href' => array(),
),
)
),
esc_html( get_bloginfo( 'name', 'display' ) ),
'<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>'
);
} else {
printf(
wp_kses(
/* translators: %1$s Site title, %2$s Order pay link */
__( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when youre ready: %2$s', 'woocommerce' ),
array(
'a' => array(
'href' => array(),
),
)
),
esc_html( get_bloginfo( 'name', 'display' ) ),
'<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>'
);
}
?>
</p>
<?php } else { ?>
<p>
<?php
/* translators: %s Order date */
printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) );
?>
</p>
<?php
}
?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/**
* Hook for the woocommerce_email_order_details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for the woocommerce_email_order_meta.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for woocommerce_email_customer_details.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/**
* Executes the email footer.
*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,68 @@
<?php
/**
* Customer new account email - html.
*
* This is intended as a replacement to WC_Email_Customer_New_Account(),
* with a set password link instead of including the new password in email
* content.
*
* @package WooCommerce/Blocks
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/**
* Fires to output the email header.
*
* @hooked WC_Emails::email_header()
*
* @since 3.7.0
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<?php if ( $email_improvements_enabled ) : ?>
<?php /* translators: %s: Site title */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %s. Heres a copy of your user details.', 'woocommerce' ), esc_html( $blogname ) ); ?></p>
<div class="hr hr-top"></div>
<?php /* translators: %s: Username */ ?>
<p><?php echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), esc_html( $user_login ) ), array( 'b' => array() ) ); ?></p>
<?php if ( $set_password_url ) : ?>
<p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>
<div class="hr hr-bottom"></div>
<p><?php echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ); ?></p>
<p><a href="<?php echo esc_attr( wc_get_page_permalink( 'myaccount' ) ); ?>"><?php printf( esc_html__( 'My account', 'woocommerce' ) ); ?></a></p>
<?php else : ?>
<?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php if ( $set_password_url ) : ?>
<p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>
<?php endif; ?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content email-additional-content-aligned">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/**
* Fires to output the email footer.
*
* @hooked WC_Emails::email_footer()
*
* @since 3.7.0
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,62 @@
<?php
/**
* Customer new account email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-new-account.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<?php if ( $email_improvements_enabled ) : ?>
<?php /* translators: %s: Site title */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %s. Heres a copy of your user details.', 'woocommerce' ), esc_html( $blogname ) ); ?></p>
<div class="hr hr-top"></div>
<?php /* translators: %s: Username */ ?>
<p><?php echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), esc_html( $user_login ) ), array( 'b' => array() ) ); ?></p>
<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated && $set_password_url ) : ?>
<?php // If the password has not been set by the user during the sign up process, send them a link to set a new password. ?>
<p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>
<div class="hr hr-bottom"></div>
<p><?php echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ); ?></p>
<p><a href="<?php echo esc_attr( wc_get_page_permalink( 'myaccount' ) ); ?>"><?php printf( esc_html__( 'My account', 'woocommerce' ) ); ?></a></p>
<?php else : ?>
<?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated && $set_password_url ) : ?>
<?php // If the password has not been set by the user during the sign up process, send them a link to set a new password. ?>
<p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>
<?php endif; ?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content email-additional-content-aligned">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,82 @@
<?php
/**
* Customer note email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-note.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<p><?php esc_html_e( 'The following note has been added to your order:', 'woocommerce' ); ?></p>
<blockquote><?php echo wpautop( wptexturize( make_clickable( $customer_note ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></blockquote>
<p><?php esc_html_e( 'As a reminder, here are your order details:', 'woocommerce' ); ?></p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,81 @@
<?php
/**
* Customer on-hold order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-on-hold-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<?php if ( $email_improvements_enabled ) : ?>
<p><?php esc_html_e( 'Weve received your order and its currently on hold until we can confirm your payment has been processed.', 'woocommerce' ); ?></p>
<p><?php esc_html_e( 'Heres a reminder of what youve ordered:', 'woocommerce' ); ?></p>
<?php else : ?>
<p><?php esc_html_e( 'Thanks for your order. Its on-hold until we confirm that payment has been received.', 'woocommerce' ); ?></p>
<?php endif; ?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,84 @@
<?php
/**
* Customer processing order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-processing-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<?php if ( $email_improvements_enabled ) : ?>
<p><?php esc_html_e( 'Weve received your order and will let you know when its on its way to you!', 'woocommerce' ); ?></p>
<p><?php esc_html_e( 'Heres a reminder of what youve ordered:', 'woocommerce' ); ?></p>
<?php else : ?>
<?php /* translators: %s: Order number */ ?>
<p><?php printf( esc_html__( 'Just to let you know &mdash; we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></p>
<?php endif; ?>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,98 @@
<?php
/**
* Customer refunded order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-refunded-order.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<p>
<?php
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) );
} else {
printf( esc_html__( 'Hi,', 'woocommerce' ) );
}
?>
</p>
<p>
<?php
if ( $email_improvements_enabled ) {
if ( $partial_refund ) {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
} else {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
}
echo '</p><p>';
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
} elseif ( $partial_refund ) {
/* translators: %s: Site title */
printf( esc_html__( 'Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) );
} else {
/* translators: %s: Site title */
printf( esc_html__( 'Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) );
}
?>
</p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,69 @@
<?php
/**
* Customer Reset Password email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-reset-password.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
?>
<?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php echo $email_improvements_enabled ? '<div class="email-introduction">' : ''; ?>
<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<?php /* translators: %s: Store name */ ?>
<p><?php printf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), esc_html( $blogname ) ); ?></p>
<?php if ( $email_improvements_enabled ) : ?>
<div class="hr hr-top"></div>
<?php /* translators: %s: Username */ ?>
<p><?php echo wp_kses( sprintf( __( 'Username: <b>%s</b>', 'woocommerce' ), esc_html( $user_login ) ), array( 'b' => array() ) ); ?></p>
<div class="hr hr-bottom"></div>
<p><?php esc_html_e( 'If you didnt make this request, just ignore this email. If youd like to proceed, reset your password via the link below:', 'woocommerce' ); ?></p>
<?php else : ?>
<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Username: %s', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<p><?php esc_html_e( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ); ?></p>
<?php endif; ?>
<p>
<a class="link" href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ); ?>"><?php // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?>
<?php
if ( $email_improvements_enabled ) {
esc_html_e( 'Reset your password', 'woocommerce' );
} else {
esc_html_e( 'Click here to reset your password', 'woocommerce' );
}
?>
</a>
</p>
<?php echo $email_improvements_enabled ? '</div>' : ''; ?>
<?php
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo $email_improvements_enabled ? '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="email-additional-content email-additional-content-aligned">' : '';
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
echo $email_improvements_enabled ? '</td></tr></table>' : '';
}
do_action( 'woocommerce_email_footer', $email );

View File

@ -0,0 +1,92 @@
<?php
/**
* Email Addresses
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$address = $order->get_formatted_billing_address();
$shipping = $order->get_formatted_shipping_address();
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: <?php echo $email_improvements_enabled ? '0' : '40px'; ?>; padding:0;" border="0">
<tr>
<td class="font-family text-align-left" style="border:0; padding:0;" valign="top" width="50%">
<?php if ( $email_improvements_enabled ) { ?>
<b class="address-title"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></b>
<?php } else { ?>
<h2><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
<?php } ?>
<address class="address">
<?php echo wp_kses_post( $address ? $address : esc_html__( 'N/A', 'woocommerce' ) ); ?>
<?php if ( $order->get_billing_phone() ) : ?>
<br/><?php echo wc_make_phone_clickable( $order->get_billing_phone() ); ?>
<?php endif; ?>
<?php if ( $order->get_billing_email() ) : ?>
<br/><?php echo esc_html( $order->get_billing_email() ); ?>
<?php endif; ?>
<?php
/**
* Fires after the core address fields in emails.
*
* @since 8.6.0
*
* @param string $type Address type. Either 'billing' or 'shipping'.
* @param WC_Order $order Order instance.
* @param bool $sent_to_admin If this email is being sent to the admin or not.
* @param bool $plain_text If this email is plain text or not.
*/
do_action( 'woocommerce_email_customer_address_section', 'billing', $order, $sent_to_admin, false );
?>
</address>
</td>
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
<td class="font-family text-align-left" style="padding:0;" valign="top" width="50%">
<?php if ( $email_improvements_enabled ) { ?>
<b class="address-title"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></b>
<?php } else { ?>
<h2><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
<?php } ?>
<address class="address">
<?php echo wp_kses_post( $shipping ); ?>
<?php if ( $order->get_shipping_phone() ) : ?>
<br /><?php echo wc_make_phone_clickable( $order->get_shipping_phone() ); ?>
<?php endif; ?>
<?php
/**
* Fires after the core address fields in emails.
*
* @since 8.6.0
*
* @param string $type Address type. Either 'billing' or 'shipping'.
* @param WC_Order $order Order instance.
* @param bool $sent_to_admin If this email is being sent to the admin or not.
* @param bool $plain_text If this email is plain text or not.
*/
do_action( 'woocommerce_email_customer_address_section', 'shipping', $order, $sent_to_admin, false );
?>
</address>
</td>
<?php endif; ?>
</tr>
</table>
<?php echo $email_improvements_enabled ? '<br>' : ''; ?>

View File

@ -0,0 +1,31 @@
<?php
/**
* Additional Customer Details
*
* This is extra customer data which can be filtered by plugins. It outputs below the order item table.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-customer-details.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\Emails
* @version 9.7.0
*/
defined( 'ABSPATH' ) || exit;
?>
<?php if ( ! empty( $fields ) ) : ?>
<div class="font-family" style="margin-bottom: 40px;">
<h2><?php esc_html_e( 'Customer details', 'woocommerce' ); ?></h2>
<ul>
<?php foreach ( $fields as $field ) : ?>
<li><strong><?php echo wp_kses_post( $field['label'] ); ?>:</strong> <span class="text"><?php echo wp_kses_post( $field['value'] ); ?></span></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -0,0 +1,66 @@
<?php
/**
* Email Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-downloads.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
*/
defined( 'ABSPATH' ) || exit;
?><h2 class="woocommerce-order-downloads__title"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2>
<table class="td font-family" cellspacing="0" cellpadding="6" style="width: 100%; margin-bottom: 40px;" border="1">
<thead>
<tr>
<?php foreach ( $columns as $column_id => $column_name ) : ?>
<th class="td text-align-left" scope="col"><?php echo esc_html( $column_name ); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<?php foreach ( $downloads as $download ) : ?>
<tr>
<?php foreach ( $columns as $column_id => $column_name ) : ?>
<td class="td text-align-left">
<?php
if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text );
} else {
switch ( $column_id ) {
case 'download-product':
?>
<a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo wp_kses_post( $download['product_name'] ); ?></a>
<?php
break;
case 'download-file':
?>
<a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file button alt"><?php echo esc_html( $download['download_name'] ); ?></a>
<?php
break;
case 'download-expires':
if ( ! empty( $download['access_expires'] ) ) {
?>
<time datetime="<?php echo esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ); ?></time>
<?php
} else {
esc_html_e( 'Never', 'woocommerce' );
}
break;
}
}
?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>

View File

@ -0,0 +1,85 @@
<?php
/**
* Email Footer
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-footer.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\Emails
* @version 9.6.0
*/
defined( 'ABSPATH' ) || exit;
?>
</div>
</td>
</tr>
</table>
<!-- End Content -->
</td>
</tr>
</table>
<!-- End Body -->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- Footer -->
<table border="0" cellpadding="10" cellspacing="0" width="100%" id="template_footer">
<tr>
<td valign="top">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td colspan="2" valign="middle" id="credit">
<?php
$email_footer_text = get_option( 'woocommerce_email_footer_text' );
/**
* This filter is documented in templates/emails/email-styles.php
*
* @since 9.6.0
*/
if ( apply_filters( 'woocommerce_is_email_preview', false ) ) {
$text_transient = get_transient( 'woocommerce_email_footer_text' );
$email_footer_text = false !== $text_transient ? $text_transient : $email_footer_text;
}
echo wp_kses_post(
wpautop(
wptexturize(
/**
* Provides control over the email footer text used for most order emails.
*
* @since 4.0.0
*
* @param string $email_footer_text
*/
apply_filters( 'woocommerce_email_footer_text', $email_footer_text )
)
)
);
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- End Footer -->
</td>
</tr>
</table>
</div>
</td>
<td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,103 @@
<?php
/**
* Email Header
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-header.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title><?php echo get_bloginfo( 'name', 'display' ); ?></title>
</head>
<body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<table width="100%" id="outer_wrapper">
<tr>
<td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td>
<td width="600">
<div id="wrapper" dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="inner_wrapper">
<tr>
<td align="center" valign="top">
<?php
$img = get_option( 'woocommerce_email_header_image' );
/**
* This filter is documented in templates/emails/email-styles.php
*
* @since 9.6.0
*/
if ( apply_filters( 'woocommerce_is_email_preview', false ) ) {
$img_transient = get_transient( 'woocommerce_email_header_image' );
$img = false !== $img_transient ? $img_transient : $img;
}
if ( $email_improvements_enabled ) :
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td id="template_header_image">
<?php
if ( $img ) {
echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" /></p>';
} else {
echo '<p class="email-logo-text">' . esc_html( get_bloginfo( 'name', 'display' ) ) . '</p>';
}
?>
</td>
</tr>
</table>
<?php else : ?>
<div id="template_header_image">
<?php
if ( $img ) {
echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" /></p>';
}
?>
</div>
<?php endif; ?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_container">
<tr>
<td align="center" valign="top">
<!-- Header -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_header">
<tr>
<td id="header_wrapper">
<h1><?php echo esc_html( $email_heading ); ?></h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- Body -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="template_body">
<tr>
<td valign="top" id="body_content">
<!-- Content -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr>
<td valign="top" id="body_content_inner_cell">
<div id="body_content_inner">

View File

@ -0,0 +1,20 @@
<?php
/**
* Email mobile messaging
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-mobile-messaging.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\Emails
* @version 7.0
*/
use Automattic\WooCommerce\Internal\Orders\MobileMessagingHandler;
echo wp_kses_post( MobileMessagingHandler::prepare_mobile_message( $order, $blog_id, $now, $domain ) );

View File

@ -0,0 +1,161 @@
<?php
/**
* Order details table shown in emails.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$text_align = is_rtl() ? 'right' : 'left';
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
$heading_class = $email_improvements_enabled ? 'email-order-detail-heading' : '';
$order_table_class = $email_improvements_enabled ? 'email-order-details' : '';
$order_total_text_align = $email_improvements_enabled ? 'right' : 'left';
if ( $email_improvements_enabled ) {
add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' );
}
/**
* Action hook to add custom content before order details in email.
*
* @param WC_Order $order Order object.
* @param bool $sent_to_admin Whether it's sent to admin or customer.
* @param bool $plain_text Whether it's a plain text email.
* @param WC_Email $email Email object.
* @since 2.5.0
*/
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
<h2 class="<?php echo esc_attr( $heading_class ); ?>">
<?php
if ( $email_improvements_enabled ) {
echo wp_kses_post( __( 'Order summary', 'woocommerce' ) );
}
if ( $sent_to_admin ) {
$before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
$after = '</a>';
} else {
$before = '';
$after = '';
}
if ( $email_improvements_enabled ) {
echo '<br><span>';
}
/* translators: %s: Order ID. */
$order_number_string = __( '[Order #%s]', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %s: Order ID. */
$order_number_string = __( 'Order #%s', 'woocommerce' );
}
echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) );
if ( $email_improvements_enabled ) {
echo '</span>';
}
?>
</h2>
<div style="margin-bottom: <?php echo $email_improvements_enabled ? '24px' : '40px'; ?>;">
<table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1">
<?php if ( ! $email_improvements_enabled ) { ?>
<thead>
<tr>
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
</tr>
</thead>
<?php } ?>
<tbody>
<?php
$image_size = $email_improvements_enabled ? 48 : 32;
echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$order,
array(
'show_sku' => $sent_to_admin,
'show_image' => $email_improvements_enabled,
'image_size' => array( $image_size, $image_size ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
)
);
?>
</tbody>
<tfoot>
<?php
$item_totals = $order->get_order_item_totals();
$item_totals_count = count( $item_totals );
if ( $item_totals ) {
$i = 0;
foreach ( $item_totals as $total ) {
$i++;
$last_class = ( $i === $item_totals_count ) ? ' order-totals-last' : '';
?>
<tr class="order-totals order-totals-<?php echo esc_attr( $total['type'] ?? 'unknown' ); ?><?php echo esc_attr( $last_class ); ?>">
<th class="td text-align-left" scope="row" colspan="2" style="<?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>">
<?php
echo wp_kses_post( $total['label'] ) . ' ';
if ( $email_improvements_enabled ) {
echo isset( $total['meta'] ) ? wp_kses_post( $total['meta'] ) : '';
}
?>
</th>
<td class="td text-align-<?php echo esc_attr( $order_total_text_align ); ?>" style="<?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['value'] ); ?></td>
</tr>
<?php
}
}
if ( $order->get_customer_note() && ! $email_improvements_enabled ) {
?>
<tr>
<th class="td text-align-left" scope="row" colspan="2"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
<td class="td text-align-left"><?php echo wp_kses( nl2br( wptexturize( $order->get_customer_note() ) ), array() ); ?></td>
</tr>
<?php
}
if ( $order->get_customer_note() && $email_improvements_enabled ) {
?>
<tr class="order-customer-note">
<td class="td text-align-left" colspan="3">
<b><?php esc_html_e( 'Customer note', 'woocommerce' ); ?></b><br>
<?php echo wp_kses( nl2br( wptexturize( $order->get_customer_note() ) ), array( 'br' => array() ) ); ?>
</td>
</tr>
<?php
}
?>
</tfoot>
</table>
</div>
<?php
if ( $email_improvements_enabled ) {
remove_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' );
}
/**
* Action hook to add custom content after order details in email.
*
* @param WC_Order $order Order object.
* @param bool $sent_to_admin Whether it's sent to admin or customer.
* @param bool $plain_text Whether it's a plain text email.
* @param WC_Email $email Email object.
* @since 2.5.0
*/
do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email );
?>

View File

@ -0,0 +1,218 @@
<?php
/**
* Email Order Items
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$margin_side = is_rtl() ? 'left' : 'right';
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
$price_text_align = $email_improvements_enabled ? 'right' : 'left';
foreach ( $items as $item_id => $item ) :
$product = $item->get_product();
$sku = '';
$purchase_note = '';
$image = '';
if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
continue;
}
if ( is_object( $product ) ) {
$sku = $product->get_sku();
$purchase_note = $product->get_purchase_note();
$image = $product->get_image( $image_size );
}
?>
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
<td class="td font-family text-align-left" style="vertical-align: middle; word-wrap:break-word;">
<?php if ( $email_improvements_enabled ) { ?>
<table class="order-item-data">
<tr>
<?php
// Show title/image etc.
if ( $show_image ) {
/**
* Email Order Item Thumbnail hook.
*
* @param string $image The image HTML.
* @param WC_Order_Item_Product $item The item being displayed.
* @since 2.1.0
*/
echo '<td>' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '</td>';
}
?>
<td>
<?php
/**
* Order Item Name hook.
*
* @param string $item_name The item name HTML.
* @param WC_Order_Item_Product $item The item being displayed.
* @since 2.1.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
// SKU.
if ( $show_sku && $sku ) {
echo wp_kses_post( ' (#' . $sku . ')' );
}
/**
* Allow other plugins to add additional product information.
*
* @param int $item_id The item ID.
* @param WC_Order_Item_Product $item The item object.
* @param WC_Order $order The order object.
* @param bool $plain_text Whether the email is plain text or not.
* @since 2.3.0
*/
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
$item_meta = wc_display_item_meta(
$item,
array(
'before' => '',
'after' => '',
'separator' => '<br>',
'echo' => false,
'label_before' => '<span>',
'label_after' => ':</span> ',
)
);
echo '<div class="email-order-item-meta">';
echo wp_kses(
$item_meta,
array(
'br' => array(),
'span' => array(),
)
);
echo '</div>';
/**
* Allow other plugins to add additional product information.
*
* @param int $item_id The item ID.
* @param WC_Order_Item_Product $item The item object.
* @param WC_Order $order The order object.
* @param bool $plain_text Whether the email is plain text or not.
* @since 2.3.0
*/
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
?>
</td>
</tr>
</table>
<?php
} else {
// Show title/image etc.
if ( $show_image ) {
/**
* Email Order Item Thumbnail hook.
*
* @param string $image The image HTML.
* @param WC_Order_Item_Product $item The item being displayed.
* @since 2.1.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
}
/**
* Order Item Name hook.
*
* @param string $item_name The item name HTML.
* @param WC_Order_Item_Product $item The item being displayed.
* @since 2.1.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
// SKU.
if ( $show_sku && $sku ) {
echo wp_kses_post( ' (#' . $sku . ')' );
}
/**
* Allow other plugins to add additional product information.
*
* @param int $item_id The item ID.
* @param WC_Order_Item_Product $item The item object.
* @param WC_Order $order The order object.
* @param bool $plain_text Whether the email is plain text or not.
* @since 2.3.0
*/
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
wc_display_item_meta(
$item,
array(
'label_before' => '<strong class="wc-item-meta-label" style="float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
)
);
/**
* Allow other plugins to add additional product information.
*
* @param int $item_id The item ID.
* @param WC_Order_Item_Product $item The item object.
* @param WC_Order $order The order object.
* @param bool $plain_text Whether the email is plain text or not.
* @since 2.3.0
*/
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
}
?>
</td>
<td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
<?php
echo $email_improvements_enabled ? '&times;' : '';
$qty = $item->get_quantity();
$refunded_qty = $order->get_qty_refunded_for_item( $item_id );
if ( $refunded_qty ) {
$qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
} else {
$qty_display = esc_html( $qty );
}
echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) );
?>
</td>
<td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
<?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
</td>
</tr>
<?php
if ( $show_purchase_note && $purchase_note ) {
?>
<tr>
<td colspan="3" class="font-family text-align-left" style="vertical-align:middle;">
<?php
echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );
?>
</td>
</tr>
<?php
}
?>
<?php endforeach; ?>

View File

@ -0,0 +1,531 @@
<?php
/**
* Email Styles
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-styles.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\Emails
* @version 9.8.0
*/
use Automattic\WooCommerce\Internal\Email\EmailFont;
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
// Load colors.
$bg = get_option( 'woocommerce_email_background_color' );
$body = get_option( 'woocommerce_email_body_background_color' );
$base = get_option( 'woocommerce_email_base_color' );
$text = get_option( 'woocommerce_email_text_color' );
$footer_text = get_option( 'woocommerce_email_footer_text_color' );
$header_alignment = get_option( 'woocommerce_email_header_alignment', $email_improvements_enabled ? 'left' : false );
$logo_image_width = get_option( 'woocommerce_email_header_image_width', '120' );
$default_font = 'Helvetica';
$font_family = $email_improvements_enabled ? get_option( 'woocommerce_email_font_family', $default_font ) : $default_font;
/**
* Check if we are in preview mode (WooCommerce > Settings > Emails).
*
* @since 9.6.0
* @param bool $is_email_preview Whether the email is being previewed.
*/
$is_email_preview = apply_filters( 'woocommerce_is_email_preview', false );
if ( $is_email_preview ) {
$bg_transient = get_transient( 'woocommerce_email_background_color' );
$body_transient = get_transient( 'woocommerce_email_body_background_color' );
$base_transient = get_transient( 'woocommerce_email_base_color' );
$text_transient = get_transient( 'woocommerce_email_text_color' );
$footer_text_transient = get_transient( 'woocommerce_email_footer_text_color' );
$header_alignment_transient = get_transient( 'woocommerce_email_header_alignment' );
$logo_image_width_transient = get_transient( 'woocommerce_email_header_image_width' );
$font_family_transient = get_transient( 'woocommerce_email_font_family' );
$bg = $bg_transient ? $bg_transient : $bg;
$body = $body_transient ? $body_transient : $body;
$base = $base_transient ? $base_transient : $base;
$text = $text_transient ? $text_transient : $text;
$footer_text = $footer_text_transient ? $footer_text_transient : $footer_text;
$header_alignment = $header_alignment_transient ? $header_alignment_transient : $header_alignment;
$logo_image_width = $logo_image_width_transient ? $logo_image_width_transient : $logo_image_width;
$font_family = $font_family_transient ? $font_family_transient : $font_family;
}
// Only use safe fonts. They won't be escaped to preserve single quotes.
$safe_font_family = EmailFont::$font[ $font_family ] ?? EmailFont::$font[ $default_font ];
$base_text = wc_light_or_dark( $base, '#202020', '#ffffff' );
// Pick a contrasting color for links.
$link_color = wc_hex_is_light( $base ) ? $base : $base_text;
if ( wc_hex_is_light( $body ) ) {
$link_color = wc_hex_is_light( $base ) ? $base_text : $base;
}
// If email improvements are enabled, always use the base color for links.
if ( $email_improvements_enabled ) {
$link_color = $base;
}
$border_color = wc_light_or_dark( $body, 'rgba(0, 0, 0, .2)', 'rgba(255, 255, 255, .2)' );
$bg_darker_10 = wc_hex_darker( $bg, 10 );
$body_darker_10 = wc_hex_darker( $body, 10 );
$base_lighter_20 = wc_hex_lighter( $base, 20 );
$base_lighter_40 = wc_hex_lighter( $base, 40 );
$text_lighter_20 = wc_hex_lighter( $text, 20 );
$text_lighter_40 = wc_hex_lighter( $text, 40 );
// !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
// body{padding: 0;} ensures proper scale/positioning of the email in the iOS native email app.
?>
body {
background-color: <?php echo esc_attr( $bg ); ?>;
padding: 0;
text-align: center;
}
#outer_wrapper {
background-color: <?php echo esc_attr( $bg ); ?>;
}
<?php if ( $email_improvements_enabled ) : ?>
#inner_wrapper {
background-color: <?php echo esc_attr( $body ); ?>;
border-radius: 8px;
}
<?php endif; ?>
#wrapper {
margin: 0 auto;
padding: <?php echo $email_improvements_enabled ? '24px 0' : '70px 0'; ?>;
-webkit-text-size-adjust: none !important;
width: 100%;
max-width: 600px;
}
#template_container {
box-shadow: <?php echo $email_improvements_enabled ? 'none' : '0 1px 4px rgba(0, 0, 0, 0.1) !important'; ?>;
background-color: <?php echo esc_attr( $body ); ?>;
border: <?php echo $email_improvements_enabled ? '0' : '1px solid ' . esc_attr( $bg_darker_10 ); ?>;
border-radius: 3px !important;
}
#template_header {
background-color: <?php echo esc_attr( $email_improvements_enabled ? $body : $base ); ?>;
border-radius: 3px 3px 0 0 !important;
color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base_text ); ?>;
border-bottom: 0;
font-weight: bold;
line-height: 100%;
vertical-align: middle;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
#template_header h1,
#template_header h1 a {
color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base_text ); ?>;
background-color: inherit;
}
<?php if ( $email_improvements_enabled ) : ?>
.hr {
border-bottom: 1px solid #1e1e1e;
opacity: 0.2;
margin: 16px 0;
}
.hr-top {
margin-top: 32px;
}
.hr-bottom {
margin-bottom: 32px;
}
#template_header_image {
padding: 32px 32px 0;
}
#template_header_image p {
margin-bottom: 0;
text-align: <?php echo esc_attr( $header_alignment ); ?>;
}
#template_header_image img {
width: <?php echo esc_attr( $logo_image_width ); ?>px;
}
.email-logo-text {
color: <?php echo esc_attr( $link_color ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: 18px;
}
.email-introduction {
padding-bottom: 24px;
}
.email-order-item-meta {
color: <?php echo esc_attr( $footer_text ); ?>;
font-size: 14px;
line-height: 140%;
}
#body_content table td td.email-additional-content {
color: <?php echo esc_attr( $text ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
padding: 32px 0 0;
}
.email-additional-content p {
text-align: center;
}
.email-additional-content-aligned p {
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}
<?php else : ?>
#template_header_image img {
margin-left: 0;
margin-right: 0;
}
<?php endif; ?>
#template_footer td {
padding: 0;
border-radius: <?php echo $email_improvements_enabled ? '0' : '6px'; ?>;
}
#template_footer #credit {
border: 0;
<?php if ( $email_improvements_enabled ) : ?>
border-top: 1px solid <?php echo esc_attr( $border_color ); ?>;
<?php endif; ?>
color: <?php echo esc_attr( $footer_text ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: 12px;
line-height: <?php echo $email_improvements_enabled ? '140%' : '150%'; ?>;
text-align: center;
padding: <?php echo $email_improvements_enabled ? '32px' : '24px 0'; ?>;
}
#template_footer #credit p {
margin: <?php echo $email_improvements_enabled ? '0' : '0 0 16px'; ?>;
}
#body_content {
background-color: <?php echo esc_attr( $body ); ?>;
}
#body_content table td {
padding: <?php echo $email_improvements_enabled ? '20px 32px 32px' : '48px 48px 32px'; ?>;
}
#body_content table td td {
padding: 12px;
}
#body_content table td th {
padding: 12px;
}
#body_content table .email-order-details td,
#body_content table .email-order-details th {
padding: 8px 12px;
}
#body_content table .email-order-details td:first-child,
#body_content table .email-order-details th:first-child {
padding-<?php echo is_rtl() ? 'right' : 'left'; ?>: 0;
}
#body_content table .email-order-details td:last-child,
#body_content table .email-order-details th:last-child {
padding-<?php echo is_rtl() ? 'left' : 'right'; ?>: 0;
}
#body_content .email-order-details tbody tr:last-child td {
border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>;
padding-bottom: 24px;
}
#body_content .email-order-details tfoot tr:first-child td,
#body_content .email-order-details tfoot tr:first-child th {
padding-top: 24px;
}
#body_content .order-item-data td {
border: 0 !important;
padding: 0 !important;
vertical-align: middle;
}
#body_content .email-order-details .order-totals td,
#body_content .email-order-details .order-totals th {
font-weight: normal;
padding-bottom: 5px;
padding-top: 5px;
}
#body_content .email-order-details .order-totals-total th {
font-weight: bold;
}
#body_content .email-order-details .order-totals-total td {
font-weight: bold;
font-size: 20px;
}
#body_content .email-order-details .order-totals-last td,
#body_content .email-order-details .order-totals-last th {
border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>;
padding-bottom: 24px;
}
#body_content .email-order-details .order-customer-note td {
border-bottom: 1px solid <?php echo esc_attr( $border_color ); ?>;
padding-bottom: 24px;
padding-top: 24px;
}
#body_content td ul.wc-item-meta {
font-size: small;
margin: 1em 0 0>;
padding: 0;
list-style: none;
}
#body_content td ul.wc-item-meta li {
margin: 0.5em 0 0;
padding: 0;
}
#body_content td ul.wc-item-meta li p {
margin: 0;
}
#body_content .email-order-details .wc-item-meta-label {
clear: both;
float: <?php echo is_rtl() ? 'right' : 'left'; ?>;
font-weight: normal;
margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: .25em;
}
#body_content p {
margin: 0 0 16px;
}
#body_content_inner {
color: <?php echo esc_attr( $text_lighter_20 ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: <?php echo $email_improvements_enabled ? '16px' : '14px'; ?>;
line-height: 150%;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}
.td {
color: <?php echo esc_attr( $text_lighter_20 ); ?>;
border: <?php echo $email_improvements_enabled ? '0' : '1px solid ' . esc_attr( $body_darker_10 ); ?>;
vertical-align: middle;
}
.address {
<?php if ( $email_improvements_enabled ) { ?>
color: <?php echo esc_attr( $text ); ?>;
font-style: normal;
padding: 8px 0;
<?php } else { ?>
padding: 12px;
color: <?php echo esc_attr( $text_lighter_20 ); ?>;
border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
<?php } ?>
}
.additional-fields {
padding: 12px 12px 0;
color: <?php echo esc_attr( $text_lighter_20 ); ?>;
border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>;
list-style: none outside;
}
.additional-fields li {
margin: 0 0 12px 0;
}
.text,
.address-title,
.order-item-data {
color: <?php echo esc_attr( $text ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
.link {
color: <?php echo esc_attr( $link_color ); ?>;
}
#header_wrapper {
padding: <?php echo $email_improvements_enabled ? '20px 32px 0' : '36px 48px'; ?>;
display: block;
}
<?php if ( $header_alignment ) : ?>
#header_wrapper h1 {
text-align: <?php echo esc_attr( $header_alignment ); ?>;
}
<?php endif; ?>
#template_footer #credit,
#template_footer #credit a {
color: <?php echo esc_attr( $footer_text ); ?>;
}
h1 {
color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: <?php echo $email_improvements_enabled ? '32px' : '30px'; ?>;
font-weight: <?php echo $email_improvements_enabled ? 700 : 300; ?>;
<?php if ( $email_improvements_enabled ) : ?>
letter-spacing: -1px;
<?php endif; ?>
line-height: <?php echo $email_improvements_enabled ? '120%' : '150%'; ?>;
margin: 0;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
<?php if ( ! $email_improvements_enabled ) : ?>
text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>;
<?php endif; ?>
}
h2 {
color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>;
display: block;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: <?php echo $email_improvements_enabled ? '20px' : '18px'; ?>;
font-weight: bold;
line-height: <?php echo $email_improvements_enabled ? '160%' : '130%'; ?>;
margin: 0 0 18px;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}
h3 {
color: <?php echo esc_attr( $email_improvements_enabled ? $text : $base ); ?>;
display: block;
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
font-size: 16px;
font-weight: bold;
line-height: <?php echo $email_improvements_enabled ? '160%' : '130%'; ?>;
margin: 16px 0 8px;
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}
a {
color: <?php echo esc_attr( $link_color ); ?>;
font-weight: normal;
text-decoration: underline;
}
img {
border: none;
display: inline-block;
font-size: 14px;
font-weight: bold;
height: auto;
outline: none;
text-decoration: none;
text-transform: capitalize;
vertical-align: middle;
margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: <?php echo $email_improvements_enabled ? '24px' : '10px'; ?>;
max-width: 100%;
}
h2.email-order-detail-heading span {
color: <?php echo esc_attr( $footer_text ); ?>;
display: block;
font-size: 14px;
font-weight: normal;
}
.font-family {
font-family: <?php echo $safe_font_family; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
.text-align-left {
text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>;
}
.text-align-right {
text-align: <?php echo is_rtl() ? 'left' : 'right'; ?>;
}
/**
* Media queries are not supported by all email clients, however they do work on modern mobile
* Gmail clients and can help us achieve better consistency there.
*/
@media screen and (max-width: 600px) {
<?php if ( $email_improvements_enabled ) : ?>
#template_header_image {
padding: 16px 10px 0 !important;
}
#header_wrapper {
padding: 16px 10px 0 !important;
}
#header_wrapper h1 {
font-size: 24px !important;
}
#body_content_inner_cell {
padding: 10px !important;
}
#body_content_inner {
font-size: 12px !important;
}
.email-order-item-meta {
font-size: 12px !important;
}
#body_content .email-order-details .order-totals-total td {
font-size: 14px !important;
}
.email-order-detail-heading {
font-size: 16px !important;
line-height: 130% !important;
}
.email-additional-content {
padding-top: 16px !important;
}
<?php else : ?>
#header_wrapper {
padding: 27px 36px !important;
font-size: 24px;
}
#body_content table > tbody > tr > td {
padding: 10px !important;
}
#body_content_inner {
font-size: 10px !important;
}
<?php endif; ?>
}
<?php

View File

@ -0,0 +1,67 @@
<?php
/**
* Admin cancelled order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-cancelled-order.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\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Notification to let you know &mdash; order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Were getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' );
}
echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n";
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

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