| Server IP : 104.171.130.249 / Your IP : 216.73.216.146 Web Server : nginx/1.25.5 System : Linux 0dac65491b7e 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/matreshka/woocommerce/checkout/ |
Upload File : |
<?php
/**
* Thankyou page — Matreshka custom design
*
* @package Matreshka
* @version 8.1.0
*
* @var WC_Order $order
*/
defined( 'ABSPATH' ) || exit;
?>
<div class="matreshka-thankyou">
<?php if ( $order ) :
do_action( 'woocommerce_before_thankyou', $order->get_id() );
if ( $order->has_status( 'failed' ) ) : ?>
<!-- ── Ошибка оплаты ── -->
<div class="mty-error">
<div class="mty-error__icon">
<span class="material-icons-outlined">error_outline</span>
</div>
<h2 class="montserrat-bold">Ошибка оформления</h2>
<p class="montserrat-regular">К сожалению, ваш заказ не может быть обработан. Пожалуйста, попробуйте ещё раз.</p>
<div class="mty-error__actions">
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="btn btn-red-primary montserrat-semibold">Оплатить</a>
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="btn btn-secondary montserrat-semibold">Мой аккаунт</a>
<?php endif; ?>
</div>
</div>
<?php else :
// ── Gather all order data ──
$order_id = $order->get_order_number();
$order_date = $order->get_date_created();
$order_total = $order->get_formatted_order_total();
$payment_title = $order->get_payment_method_title();
$payment_method = $order->get_payment_method();
$phone = $order->get_billing_phone();
$email = $order->get_billing_email();
$coupon_items = $order->get_items( 'coupon' );
// Shipping
$shipping_type = $order->get_meta( '_matreshka_shipping_type' ) ?: 'delivery';
// Pickup
$store_name = $order->get_meta( '_matreshka_pickup_store_name' );
$store_address = $order->get_meta( '_matreshka_pickup_store_address' );
$store_phone = $order->get_meta( '_matreshka_pickup_store_phone' );
$store_hours = $order->get_meta( '_matreshka_pickup_store_hours' );
// Delivery address
$address = $order->get_billing_address_1() ?: $order->get_shipping_address_1();
$entrance = $order->get_meta( '_matreshka_entrance' );
$intercom = $order->get_meta( '_matreshka_intercom' );
$floor_val = $order->get_meta( '_matreshka_floor' );
$apartment = $order->get_meta( '_matreshka_apartment' );
$leave_at_door = $order->get_meta( '_matreshka_leave_at_door' ) === 'yes';
// Courier comment
$courier_comment = $order->get_meta( '_matreshka_courier_comment' );
if ( ! $courier_comment ) {
$courier_comment = $order->get_customer_note();
}
// Substitution
$sub_label = $order->get_meta( '_matreshka_substitution_label' );
$sub_type = $order->get_meta( '_matreshka_substitution_type' );
$packer_comment = $order->get_meta( '_matreshka_packer_comment' );
$less_bags = $order->get_meta( '_matreshka_less_bags' ) === 'yes';
$vegs_in_bags = $order->get_meta( '_matreshka_vegs_in_bags' ) === 'yes';
?>
<!-- ════════════════════════════════════════════
HEADER — Успех + номер заказа
════════════════════════════════════════════ -->
<div class="mty-hero">
<div class="mty-hero__check">
<span class="material-icons-outlined">check_circle</span>
</div>
<h1 class="montserrat-bold">Спасибо за заказ!</h1>
<p class="montserrat-regular mty-hero__sub">
Заказ <strong>#<?php echo esc_html( $order_id ); ?></strong> успешно оформлен
</p>
<div class="mty-hero__meta">
<?php if ( $order_date ) : ?>
<span class="mty-hero__meta-item montserrat-medium">
<span class="material-icons-outlined">schedule</span>
<?php echo esc_html( $order_date->date_i18n( 'd.m.Y в H:i' ) ); ?>
</span>
<?php endif; ?>
<span class="mty-hero__meta-item montserrat-medium">
<span class="material-icons-outlined">receipt_long</span>
<?php echo wp_kses_post( $order_total ); ?>
</span>
</div>
</div>
<!-- ════════════════════════════════════════════
PROGRESS STEPS — Что дальше?
════════════════════════════════════════════ -->
<div class="mty-steps">
<h3 class="montserrat-bold mty-section-title">Что дальше?</h3>
<div class="mty-steps__list">
<div class="mty-step mty-step--active">
<div class="mty-step__icon"><span class="material-icons-outlined">inventory_2</span></div>
<div class="mty-step__line"></div>
<div class="mty-step__content">
<p class="montserrat-semibold">Сборка заказа</p>
<p class="montserrat-regular mty-step__desc">Наши сборщики уже начали комплектовать ваш заказ из свежих продуктов</p>
</div>
</div>
<div class="mty-step">
<div class="mty-step__icon"><span class="material-icons-outlined">support_agent</span></div>
<div class="mty-step__line"></div>
<div class="mty-step__content">
<p class="montserrat-semibold">Уточнения по заказу</p>
<p class="montserrat-regular mty-step__desc">Если возникнут вопросы по наличию или замене товаров — оператор свяжется с вами</p>
</div>
</div>
<?php if ( $shipping_type === 'pickup' ) : ?>
<div class="mty-step">
<div class="mty-step__icon"><span class="material-icons-outlined">storefront</span></div>
<div class="mty-step__line"></div>
<div class="mty-step__content">
<p class="montserrat-semibold">Самовывоз</p>
<p class="montserrat-regular mty-step__desc">Мы отправим уведомление, когда заказ будет готов к выдаче в магазине</p>
</div>
</div>
<?php else : ?>
<div class="mty-step">
<div class="mty-step__icon"><span class="material-icons-outlined">local_shipping</span></div>
<div class="mty-step__line"></div>
<div class="mty-step__content">
<p class="montserrat-semibold">Доставка курьером</p>
<p class="montserrat-regular mty-step__desc">Курьер доставит заказ по указанному адресу — мы пришлём уведомление перед приездом</p>
</div>
</div>
<?php endif; ?>
<div class="mty-step mty-step--last">
<div class="mty-step__icon"><span class="material-icons-outlined">emoji_emotions</span></div>
<div class="mty-step__content">
<p class="montserrat-semibold">Приятного аппетита!</p>
<p class="montserrat-regular mty-step__desc">Наслаждайтесь свежими продуктами от Матрёшки</p>
</div>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════
ORDER DETAILS — 3-column grid
════════════════════════════════════════════ -->
<div class="mty-details">
<h3 class="montserrat-bold mty-section-title">Детали заказа</h3>
<div class="mty-details__grid">
<!-- Column 1: Доставка -->
<div class="mty-details__col">
<h4 class="montserrat-semibold mty-details__col-title">
<span class="material-icons-outlined">local_shipping</span>
<?php echo $shipping_type === 'pickup' ? 'Самовывоз' : 'Доставка'; ?>
</h4>
<?php if ( $shipping_type === 'pickup' ) : ?>
<div class="mty-info-card">
<div class="mty-info-card__badge mty-info-card__badge--pickup">
<span class="material-icons-outlined">storefront</span> Самовывоз
</div>
<?php if ( $store_name || $store_address ) : ?>
<div class="mty-info-card__body">
<?php if ( $store_name ) : ?>
<p class="montserrat-semibold"><?php echo esc_html( $store_name ); ?></p>
<?php endif; ?>
<?php if ( $store_address ) : ?>
<p class="montserrat-regular"><span class="material-icons-outlined mty-icon-sm">location_on</span> <?php echo esc_html( $store_address ); ?></p>
<?php endif; ?>
<?php if ( $store_phone ) : ?>
<p class="montserrat-regular"><span class="material-icons-outlined mty-icon-sm">phone</span> <?php echo esc_html( $store_phone ); ?></p>
<?php endif; ?>
<?php if ( $store_hours ) : ?>
<p class="montserrat-regular"><span class="material-icons-outlined mty-icon-sm">schedule</span> <?php echo esc_html( $store_hours ); ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php else : ?>
<div class="mty-info-card">
<div class="mty-info-card__badge mty-info-card__badge--delivery">
<span class="material-icons-outlined">local_shipping</span> Курьерская доставка
</div>
<?php if ( $address ) : ?>
<div class="mty-info-card__body">
<p class="montserrat-semibold"><span class="material-icons-outlined mty-icon-sm">location_on</span> <?php echo esc_html( $address ); ?></p>
<?php
$addr_parts = [];
if ( $entrance ) $addr_parts[] = 'Подъезд: ' . esc_html( $entrance );
if ( $floor_val ) $addr_parts[] = 'Этаж: ' . esc_html( $floor_val );
if ( $apartment ) $addr_parts[] = 'Кв.: ' . esc_html( $apartment );
if ( $intercom ) $addr_parts[] = 'Домофон: ' . esc_html( $intercom );
if ( ! empty( $addr_parts ) ) : ?>
<p class="montserrat-regular mty-text-muted"><?php echo implode( ' · ', $addr_parts ); ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( $leave_at_door ) : ?>
<div class="mty-info-card__tag mty-info-card__tag--door">
<span class="material-icons-outlined mty-icon-sm">door_front</span> Оставить у двери
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( $courier_comment ) : ?>
<div class="mty-note">
<span class="material-icons-outlined mty-icon-sm">chat_bubble_outline</span>
<span class="montserrat-regular"><?php echo esc_html( $courier_comment ); ?></span>
</div>
<?php endif; ?>
<?php if ( $phone ) : ?>
<div class="mty-detail-row">
<span class="montserrat-medium mty-text-muted">Телефон</span>
<a href="tel:<?php echo esc_attr( $phone ); ?>" class="montserrat-semibold"><?php echo esc_html( $phone ); ?></a>
</div>
<?php endif; ?>
</div>
<!-- Column 2: Замены и пожелания -->
<div class="mty-details__col">
<h4 class="montserrat-semibold mty-details__col-title">
<span class="material-icons-outlined">swap_horiz</span>
Замены и пожелания
</h4>
<?php if ( $sub_label ) : ?>
<div class="mty-detail-row">
<span class="montserrat-medium mty-text-muted">Если не в наличии</span>
<span class="mty-tag mty-tag--substitution montserrat-semibold">
<?php
$sub_icon = 'phone_in_talk';
if ( $sub_type === 'no_replace' ) $sub_icon = 'block';
if ( $sub_type === 'auto_replace' ) $sub_icon = 'autorenew';
?>
<span class="material-icons-outlined mty-icon-sm"><?php echo esc_attr( $sub_icon ); ?></span>
<?php echo esc_html( $sub_label ); ?>
</span>
</div>
<?php endif; ?>
<?php if ( $less_bags || $vegs_in_bags ) : ?>
<div class="mty-detail-row mty-detail-row--col">
<span class="montserrat-medium mty-text-muted">Упаковка</span>
<div class="mty-checks">
<?php if ( $less_bags ) : ?>
<span class="mty-check montserrat-medium"><span class="material-icons-outlined mty-icon-sm">check_circle</span> Меньше пакетов</span>
<?php endif; ?>
<?php if ( $vegs_in_bags ) : ?>
<span class="mty-check montserrat-medium"><span class="material-icons-outlined mty-icon-sm">check_circle</span> Овощи в пакетах</span>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ( $packer_comment ) : ?>
<div class="mty-note">
<span class="material-icons-outlined mty-icon-sm">chat_bubble_outline</span>
<span class="montserrat-regular"><?php echo esc_html( $packer_comment ); ?></span>
</div>
<?php endif; ?>
<?php if ( ! $sub_label && ! $less_bags && ! $vegs_in_bags && ! $packer_comment ) : ?>
<p class="montserrat-regular mty-text-muted mty-empty">Нет особых пожеланий</p>
<?php endif; ?>
</div>
<!-- Column 3: Оплата -->
<div class="mty-details__col">
<h4 class="montserrat-semibold mty-details__col-title">
<span class="material-icons-outlined">payments</span>
Оплата
</h4>
<?php if ( $payment_title ) : ?>
<div class="mty-detail-row">
<span class="montserrat-medium mty-text-muted">Способ оплаты</span>
<span class="montserrat-semibold">
<span class="material-icons-outlined mty-icon-sm"><?php
echo ( $payment_method === 'bacs' || strpos( $payment_method, 'card' ) !== false || strpos( $payment_method, 'stripe' ) !== false ) ? 'credit_card' : 'payments';
?></span>
<?php echo esc_html( $payment_title ); ?>
</span>
</div>
<?php endif; ?>
<div class="mty-detail-row">
<span class="montserrat-medium mty-text-muted">Статус оплаты</span>
<?php // TODO: Use the actual gateway payment state when online payments are enabled. ?>
<span class="mty-tag mty-tag--pending montserrat-semibold">
<span class="material-icons-outlined mty-icon-sm">hourglass_empty</span> Ожидает оплаты
</span>
</div>
<div class="mty-detail-row mty-detail-row--total">
<span class="montserrat-semibold">Итого</span>
<span class="montserrat-bold mty-total-amount"><?php echo wp_kses_post( $order_total ); ?></span>
</div>
<?php if ( ! empty( $coupon_items ) ) : ?>
<div class="mty-coupons">
<span class="montserrat-medium mty-text-muted">Промокод</span>
<?php foreach ( $coupon_items as $coupon_item ) : ?>
<?php
$coupon_code = $coupon_item->get_code();
$coupon_discount = (float) $coupon_item->get_discount();
?>
<div class="mty-coupon-row">
<span class="montserrat-semibold mty-coupon-row__code"><?php echo esc_html( wc_format_coupon_code( $coupon_code ) ); ?></span>
<span class="montserrat-semibold mty-coupon-row__discount">-<?php echo wp_kses_post( wc_price( $coupon_discount, array( 'currency' => $order->get_currency() ) ) ); ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════
ORDER ITEMS — Товары в заказе
════════════════════════════════════════════ -->
<div class="mty-items">
<h3 class="montserrat-bold mty-section-title">Товары в заказе</h3>
<div class="mty-items__list">
<?php $display_incl_tax = wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_cart' ); ?>
<?php foreach ( $order->get_items() as $item_id => $item ) :
$product = $item->get_product();
$qty = $item->get_quantity();
$line_subtotal = $order->get_line_subtotal( $item, $display_incl_tax );
$line_total = $order->get_line_total( $item, $display_incl_tax );
$product_price = $product ? (float) $product->get_price() : 0;
$product_regular_price = $product ? (float) $product->get_regular_price() : 0;
$regular_line_total = $line_subtotal;
// Order subtotals already contain a product's sale price. Restore the regular
// price proportionally so both product sales and cart discounts are displayed.
if ( $product_price > 0 && $product_regular_price > $product_price ) {
$regular_line_total = $line_subtotal * ( $product_regular_price / $product_price );
}
$has_discount = $line_total < $regular_line_total;
$thumb = $product ? $product->get_image( 'thumbnail', [ 'class' => 'mty-item__img' ] ) : '';
?>
<div class="mty-item">
<?php if ( $thumb ) : ?>
<div class="mty-item__thumb"><?php echo $thumb; ?></div>
<?php endif; ?>
<div class="mty-item__info">
<p class="montserrat-semibold mty-item__name"><?php echo esc_html( $item->get_name() ); ?></p>
<p class="montserrat-regular mty-text-muted"><?php echo esc_html( $qty ); ?> шт.</p>
</div>
<div class="mty-item__price">
<?php if ( $has_discount ) : ?>
<del class="mty-item__price-old montserrat-medium">
<?php echo wp_kses_post( wc_price( $regular_line_total, [ 'currency' => $order->get_currency() ] ) ); ?>
</del>
<ins class="mty-item__price-sale montserrat-semibold">
<?php echo wp_kses_post( wc_price( $line_total, [ 'currency' => $order->get_currency() ] ) ); ?>
</ins>
<?php else : ?>
<span class="montserrat-semibold">
<?php echo wp_kses_post( wc_price( $line_total, [ 'currency' => $order->get_currency() ] ) ); ?>
</span>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php
$shipping_total = (float) $order->get_shipping_total();
$fees = $order->get_fees();
if ( $shipping_total > 0 || ! empty( $fees ) || ! empty( $coupon_items ) ) : ?>
<div class="mty-items__summary">
<?php if ( $shipping_total > 0 ) : ?>
<div class="mty-summary-row">
<span class="montserrat-regular">Доставка</span>
<span class="montserrat-medium"><?php echo wc_price( $shipping_total ); ?></span>
</div>
<?php endif; ?>
<?php foreach ( $fees as $fee ) : ?>
<div class="mty-summary-row">
<span class="montserrat-regular"><?php echo esc_html( $fee->get_name() ); ?></span>
<span class="montserrat-medium"><?php echo wc_price( $fee->get_total() ); ?></span>
</div>
<?php endforeach; ?>
<?php foreach ( $coupon_items as $coupon_item ) : ?>
<div class="mty-summary-row mty-summary-row--coupon">
<span class="montserrat-regular">Промокод <strong><?php echo esc_html( wc_format_coupon_code( $coupon_item->get_code() ) ); ?></strong></span>
<span class="montserrat-semibold">-<?php echo wp_kses_post( wc_price( (float) $coupon_item->get_discount(), array( 'currency' => $order->get_currency() ) ) ); ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<!-- ════════════════════════════════════════════
ACTIONS
════════════════════════════════════════════ -->
<div class="mty-actions">
<a href="<?php echo esc_url( function_exists( 'wc_get_page_id' ) ? get_permalink( wc_get_page_id( 'shop' ) ) : home_url( '/' ) ); ?>" class="btn btn-red-primary montserrat-semibold">
<span class="material-icons-outlined">storefront</span> Вернуться к покупкам
</a>
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( home_url( '/history/' ) ); ?>" class="btn btn-secondary montserrat-semibold">
<span class="material-icons-outlined">list_alt</span> Мои заказы
</a>
<?php endif; ?>
</div>
<!-- ════════════════════════════════════════════
СВЯЗАТЬСЯ С НАМИ
════════════════════════════════════════════ -->
<div class="mty-contact">
<div class="mty-contact__icon">
<span class="material-icons-outlined">headset_mic</span>
</div>
<div class="mty-contact__body">
<h3 class="montserrat-bold">Связаться с нами</h3>
<p class="montserrat-regular d-none d-md-block">Есть вопросы по заказу? Мы всегда на связи!</p>
</div>
<a href="<?php echo esc_url( home_url( '/contacts/' ) ); ?>" class="btn btn-secondary montserrat-semibold mty-contact__btn">
<span class="material-icons-outlined">arrow_forward</span> Контакты
</a>
</div>
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
<?php endif; ?>
<?php else : ?>
<div class="mty-hero">
<div class="mty-hero__check mty-hero__check--neutral">
<span class="material-icons-outlined">receipt_long</span>
</div>
<h1 class="montserrat-bold">Заказ не найден</h1>
<p class="montserrat-regular mty-hero__sub">Возможно, вы уже просмотрели эту страницу или ссылка устарела</p>
<div class="mty-actions" style="margin-top: 24px;">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="btn btn-red-primary montserrat-semibold">На главную</a>
</div>
</div>
<?php endif; ?>
</div>