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
165 lines
14 KiB
PHP
165 lines
14 KiB
PHP
<?php
|
||
defined( 'ABSPATH' ) || exit;
|
||
do_action( 'woocommerce_before_account_orders', $has_orders );
|
||
?>
|
||
<main>
|
||
<nav class="breadcumbs container">
|
||
<ul>
|
||
<li><a href="/">Главная</a></li>
|
||
<li><p class="breadcumbs-separator">/</p></li>
|
||
<li><a href="/account/">Личный кабинет</a></li>
|
||
<li><p class="breadcumbs-separator">/</p></li>
|
||
<li><p>История заказов</p></li>
|
||
</ul>
|
||
</nav>
|
||
<section class="lk">
|
||
<div class="lk-container container">
|
||
<div class="lk-menu">
|
||
<p class="lk-menu__link">Пользователь</p>
|
||
<a href="/account/" class="lk-menu__link">
|
||
Профиль
|
||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.09375 3.04013V6.15513V8.96013C4.09375 9.44013 4.67375 9.68013 5.01375 9.34013L7.60375 6.75013C8.01875 6.33513 8.01875 5.66013 7.60375 5.24513L6.61875 4.26013L5.01375 2.65513C4.67375 2.32013 4.09375 2.56013 4.09375 3.04013Z" fill="#808080"/></svg>
|
||
</a>
|
||
<a href="/account/orders/" class="lk-menu__link active">
|
||
История заказов
|
||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.09375 3.04013V6.15513V8.96013C4.09375 9.44013 4.67375 9.68013 5.01375 9.34013L7.60375 6.75013C8.01875 6.33513 8.01875 5.66013 7.60375 5.24513L6.61875 4.26013L5.01375 2.65513C4.67375 2.32013 4.09375 2.56013 4.09375 3.04013Z" fill="#808080"/></svg>
|
||
</a>
|
||
<a href="<?php echo wp_logout_url( home_url() ); ?>" class="lk-menu__link lk-menu__logout">
|
||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3029_15737)"><path d="M4.66667 14.6667H3.33333C2.8029 14.6667 2.29419 14.456 1.91912 14.0809C1.54405 13.7058 1.33333 13.1971 1.33333 12.6667V3.33333C1.33333 2.8029 1.54405 2.29419 1.91912 1.91912C2.29419 1.54405 2.8029 1.33333 3.33333 1.33333H4.66667C4.84348 1.33333 5.01305 1.2631 5.13807 1.13807C5.2631 1.01305 5.33333 0.843478 5.33333 0.666667C5.33333 0.489856 5.2631 0.320286 5.13807 0.195262C5.01305 0.0702379 4.84348 0 4.66667 0L3.33333 0C2.4496 0.00105857 1.60237 0.352588 0.97748 0.97748C0.352588 1.60237 0.00105857 2.4496 0 3.33333L0 12.6667C0.00105857 13.5504 0.352588 14.3976 0.97748 15.0225C1.60237 15.6474 2.4496 15.9989 3.33333 16H4.66667C4.84348 16 5.01305 15.9298 5.13807 15.8047C5.2631 15.6797 5.33333 15.5101 5.33333 15.3333C5.33333 15.1565 5.2631 14.987 5.13807 14.8619C5.01305 14.7369 4.84348 14.6667 4.66667 14.6667Z" fill="#C4C4C4"/><path d="M15.3301 7.33339L4.81212 7.35472C4.87059 7.24612 4.94372 7.14607 5.02945 7.05739L7.61545 4.47139C7.67912 4.40989 7.72991 4.33633 7.76485 4.25499C7.79979 4.17365 7.81818 4.08617 7.81895 3.99766C7.81972 3.90914 7.80285 3.82135 7.76933 3.73942C7.73581 3.65749 7.68631 3.58305 7.62371 3.52046C7.56112 3.45786 7.48668 3.40836 7.40475 3.37484C7.32282 3.34132 7.23504 3.32445 7.14652 3.32522C7.058 3.32599 6.97052 3.34438 6.88918 3.37932C6.80785 3.41426 6.73428 3.46505 6.67278 3.52872L4.08545 6.11472C3.58553 6.61479 3.30469 7.29295 3.30469 8.00005C3.30469 8.70716 3.58553 9.38531 4.08545 9.88539L6.67145 12.4714C6.73295 12.5351 6.80651 12.5858 6.88785 12.6208C6.96918 12.6557 7.05666 12.6741 7.14518 12.6749C7.2337 12.6757 7.32149 12.6588 7.40342 12.6253C7.48535 12.5917 7.55979 12.5422 7.62238 12.4797C7.68498 12.4171 7.73448 12.3426 7.768 12.2607C7.80152 12.1788 7.81839 12.091 7.81762 12.0025C7.81685 11.9139 7.79846 11.8265 7.76352 11.7451C7.72858 11.6638 7.67779 11.5902 7.61412 11.5287L5.02812 8.94272C4.95351 8.86589 4.88838 8.78039 4.83412 8.68805L15.3301 8.66672C15.5069 8.66672 15.6765 8.59648 15.8015 8.47146C15.9265 8.34643 15.9968 8.17687 15.9968 8.00005C15.9968 7.82324 15.9265 7.65367 15.8015 7.52865C15.6765 7.40363 15.5069 7.33339 15.3301 7.33339Z" fill="#C4C4C4"/></g><defs><clipPath id="clip0_3029_15737"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>
|
||
Выйти
|
||
</a>
|
||
</div>
|
||
<div class="lk-menu__mobile">
|
||
<p>Пользователь</p>
|
||
<button class="lk-menu__mobile-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.81979L12.4618 6.67979C12.9085 6.22646 12.5885 5.45312 11.9485 5.45312Z" fill="#2C3846"/></svg>
|
||
</button>
|
||
<div class="lk-menu__mobile-content">
|
||
<a href="/account/" class="lk-menu__mobile-content__link">
|
||
<p>Профиль</p>
|
||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.0026 1.3335C4.32927 1.3335 1.33594 4.32683 1.33594 8.00016C1.33594 11.6735 4.32927 14.6668 8.0026 14.6668C11.6759 14.6668 14.6693 11.6735 14.6693 8.00016C14.6693 4.32683 11.6759 1.3335 8.0026 1.3335ZM11.1893 6.46683L7.40927 10.2468C7.31594 10.3402 7.18927 10.3935 7.05594 10.3935C6.9226 10.3935 6.79594 10.3402 6.7026 10.2468L4.81594 8.36016C4.6226 8.16683 4.6226 7.84683 4.81594 7.6535C5.00927 7.46016 5.32927 7.46016 5.5226 7.6535L7.05594 9.18683L10.4826 5.76016C10.6759 5.56683 10.9959 5.56683 11.1893 5.76016C11.3826 5.9535 11.3826 6.26683 11.1893 6.46683Z" fill="#02ADEF"/></svg>
|
||
</a>
|
||
<a href="/account/orders/" class="lk-menu__mobile-content__link active">
|
||
<p>История заказов</p>
|
||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.0026 1.3335C4.32927 1.3335 1.33594 4.32683 1.33594 8.00016C1.33594 11.6735 4.32927 14.6668 8.0026 14.6668C11.6759 14.6668 14.6693 11.6735 14.6693 8.00016C14.6693 4.32683 11.6759 1.3335 8.0026 1.3335ZM11.1893 6.46683L7.40927 10.2468C7.31594 10.3402 7.18927 10.3935 7.05594 10.3935C6.9226 10.3935 6.79594 10.3402 6.7026 10.2468L4.81594 8.36016C4.6226 8.16683 4.6226 7.84683 4.81594 7.6535C5.00927 7.46016 5.32927 7.46016 5.5226 7.6535L7.05594 9.18683L10.4826 5.76016C10.6759 5.56683 10.9959 5.56683 11.1893 5.76016C11.3826 5.9535 11.3826 6.26683 11.1893 6.46683Z" fill="#02ADEF"/></svg>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
<?php if ( $has_orders ) : ?>
|
||
|
||
<table class="woocommerce-orders-table woocommerce-MyAccount-orders shop_table shop_table_responsive my_account_orders account-orders-table">
|
||
<thead>
|
||
<tr>
|
||
<?php foreach ( wc_get_account_orders_columns() as $column_id => $column_name ) : ?>
|
||
<th scope="col" class="woocommerce-orders-table__header woocommerce-orders-table__header-<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
|
||
<?php endforeach; ?>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<?php
|
||
foreach ( $customer_orders->orders as $customer_order ) {
|
||
$order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||
$item_count = $order->get_item_count() - $order->get_item_count_refunded();
|
||
?>
|
||
<tr class="woocommerce-orders-table__row woocommerce-orders-table__row--status-<?php echo esc_attr( $order->get_status() ); ?> order">
|
||
<?php foreach ( wc_get_account_orders_columns() as $column_id => $column_name ) :
|
||
$is_order_number = 'order-number' === $column_id;
|
||
?>
|
||
<?php if ( $is_order_number ) : ?>
|
||
<th class="woocommerce-orders-table__cell woocommerce-orders-table__cell-<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>" scope="row">
|
||
<?php else : ?>
|
||
<td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
|
||
<?php endif; ?>
|
||
|
||
<?php if ( has_action( 'woocommerce_my_account_my_orders_column_' . $column_id ) ) : ?>
|
||
<?php do_action( 'woocommerce_my_account_my_orders_column_' . $column_id, $order ); ?>
|
||
|
||
<?php elseif ( $is_order_number ) : ?>
|
||
<?php /* translators: %s: the order number, usually accompanied by a leading # */ ?>
|
||
<a href="<?php echo esc_url( $order->get_view_order_url() ); ?>" aria-label="<?php echo esc_attr( sprintf( __( 'View order number %s', 'woocommerce' ), $order->get_order_number() ) ); ?>">
|
||
<?php echo esc_html( _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number() ); ?>
|
||
</a>
|
||
|
||
<?php elseif ( 'order-date' === $column_id ) : ?>
|
||
<time datetime="<?php echo esc_attr( $order->get_date_created()->date( 'c' ) ); ?>"><?php echo esc_html( wc_format_datetime( $order->get_date_created() ) ); ?></time>
|
||
|
||
<?php elseif ( 'order-status' === $column_id ) : ?>
|
||
<?php echo esc_html( wc_get_order_status_name( $order->get_status() ) ); ?>
|
||
|
||
<?php elseif ( 'order-total' === $column_id ) : ?>
|
||
<?php
|
||
/* translators: 1: formatted order total 2: total order items */
|
||
echo wp_kses_post( sprintf( _n( '%1$s for %2$s item', '%1$s for %2$s items', $item_count, 'woocommerce' ), $order->get_formatted_order_total(), $item_count ) );
|
||
?>
|
||
|
||
<?php elseif ( 'order-actions' === $column_id ) : ?>
|
||
<?php
|
||
$actions = wc_get_account_orders_actions( $order );
|
||
|
||
if ( ! empty( $actions ) ) {
|
||
foreach ( $actions as $key => $action ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||
if ( empty( $action['aria-label'] ) ) {
|
||
// Generate the aria-label based on the action name.
|
||
/* translators: %1$s Action name, %2$s Order number. */
|
||
$action_aria_label = sprintf( __( '%1$s order number %2$s', 'woocommerce' ), $action['name'], $order->get_order_number() );
|
||
} else {
|
||
$action_aria_label = $action['aria-label'];
|
||
}
|
||
echo '<a href="' . esc_url( $action['url'] ) . '" class="woocommerce-button' . esc_attr( $wp_button_class ) . ' button ' . sanitize_html_class( $key ) . '" aria-label="' . esc_attr( $action_aria_label ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||
unset( $action_aria_label );
|
||
}
|
||
}
|
||
?>
|
||
<?php endif; ?>
|
||
|
||
<?php if ( $is_order_number ) : ?>
|
||
</th>
|
||
<?php else : ?>
|
||
</td>
|
||
<?php endif; ?>
|
||
<?php endforeach; ?>
|
||
</tr>
|
||
<?php
|
||
}
|
||
?>
|
||
</tbody>
|
||
</table>
|
||
|
||
<?php do_action( 'woocommerce_before_account_orders_pagination' ); ?>
|
||
|
||
<?php if ( 1 < $customer_orders->max_num_pages ) : ?>
|
||
<div class="woocommerce-pagination woocommerce-pagination--without-numbers woocommerce-Pagination">
|
||
<?php if ( 1 !== $current_page ) : ?>
|
||
<a class="woocommerce-button woocommerce-button--previous woocommerce-Button woocommerce-Button--previous button<?php echo esc_attr( $wp_button_class ); ?>" href="<?php echo esc_url( wc_get_endpoint_url( 'orders', $current_page - 1 ) ); ?>"><?php esc_html_e( 'Previous', 'woocommerce' ); ?></a>
|
||
<?php endif; ?>
|
||
|
||
<?php if ( intval( $customer_orders->max_num_pages ) !== $current_page ) : ?>
|
||
<a class="woocommerce-button woocommerce-button--next woocommerce-Button woocommerce-Button--next button<?php echo esc_attr( $wp_button_class ); ?>" href="<?php echo esc_url( wc_get_endpoint_url( 'orders', $current_page + 1 ) ); ?>"><?php esc_html_e( 'Next', 'woocommerce' ); ?></a>
|
||
<?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
<?php else : ?>
|
||
<div class="lk-orders">
|
||
<div class="orders">
|
||
<h3>История заказов</h3>
|
||
<div class="orders-empty">
|
||
<h4>Заказов пока нет</h4>
|
||
<p>На этой странице будут отображаться ваши заказы.</p>
|
||
<a href="/catalog">
|
||
Перейти в каталог
|
||
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8203 4.94727L15.3728 9.49977L10.8203 14.0523" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.625 9.5H15.2475" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
<?php do_action( 'woocommerce_after_account_orders', $has_orders ); ?>
|
||
<a href="<?php echo wp_logout_url( home_url() ); ?>" class="lk-logout__mob">
|
||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3029_24293)"><path d="M4.66667 14.6667H3.33333C2.8029 14.6667 2.29419 14.456 1.91912 14.0809C1.54405 13.7058 1.33333 13.1971 1.33333 12.6667V3.33333C1.33333 2.8029 1.54405 2.29419 1.91912 1.91912C2.29419 1.54405 2.8029 1.33333 3.33333 1.33333H4.66667C4.84348 1.33333 5.01305 1.2631 5.13807 1.13807C5.2631 1.01305 5.33333 0.843478 5.33333 0.666667C5.33333 0.489856 5.2631 0.320286 5.13807 0.195262C5.01305 0.0702379 4.84348 0 4.66667 0L3.33333 0C2.4496 0.00105857 1.60237 0.352588 0.97748 0.97748C0.352588 1.60237 0.00105857 2.4496 0 3.33333L0 12.6667C0.00105857 13.5504 0.352588 14.3976 0.97748 15.0225C1.60237 15.6474 2.4496 15.9989 3.33333 16H4.66667C4.84348 16 5.01305 15.9298 5.13807 15.8047C5.2631 15.6797 5.33333 15.5101 5.33333 15.3333C5.33333 15.1565 5.2631 14.987 5.13807 14.8619C5.01305 14.7369 4.84348 14.6667 4.66667 14.6667Z" fill="#C4C4C4"/><path d="M15.3301 7.33339L4.81212 7.35472C4.87059 7.24612 4.94372 7.14607 5.02945 7.05739L7.61545 4.47139C7.67912 4.40989 7.72991 4.33633 7.76485 4.25499C7.79979 4.17365 7.81818 4.08617 7.81895 3.99766C7.81972 3.90914 7.80285 3.82135 7.76933 3.73942C7.73581 3.65749 7.68631 3.58305 7.62371 3.52046C7.56112 3.45786 7.48668 3.40836 7.40475 3.37484C7.32282 3.34132 7.23504 3.32445 7.14652 3.32522C7.058 3.32599 6.97052 3.34438 6.88918 3.37932C6.80785 3.41426 6.73428 3.46505 6.67278 3.52872L4.08545 6.11472C3.58553 6.61479 3.30469 7.29295 3.30469 8.00005C3.30469 8.70716 3.58553 9.38531 4.08545 9.88539L6.67145 12.4714C6.73295 12.5351 6.80651 12.5858 6.88785 12.6208C6.96918 12.6557 7.05666 12.6741 7.14518 12.6749C7.2337 12.6757 7.32149 12.6588 7.40342 12.6253C7.48535 12.5917 7.55979 12.5422 7.62238 12.4797C7.68498 12.4171 7.73448 12.3426 7.768 12.2607C7.80152 12.1788 7.81839 12.091 7.81762 12.0025C7.81685 11.9139 7.79846 11.8265 7.76352 11.7451C7.72858 11.6638 7.67779 11.5902 7.61412 11.5287L5.02812 8.94272C4.95351 8.86589 4.88838 8.78039 4.83412 8.68805L15.3301 8.66672C15.5069 8.66672 15.6765 8.59648 15.8015 8.47146C15.9265 8.34643 15.9968 8.17687 15.9968 8.00005C15.9968 7.82324 15.9265 7.65367 15.8015 7.52865C15.6765 7.40363 15.5069 7.33339 15.3301 7.33339Z" fill="#C4C4C4"/></g><defs><clipPath id="clip0_3029_24293"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>
|
||
Выйти
|
||
</a>
|
||
</div>
|
||
</section>
|
||
</main>
|