✏️ 正在编辑: dashboard.php
路径:
/home/h359620/public_html/wp-content/themes/datis/woocommerce/myaccount/dashboard.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * My Account Dashboard * * @package WooCommerce\Templates * @version 4.4.0 */ if (!defined('ABSPATH')) { exit; } $user_id = get_current_user_id(); $user = wp_get_current_user(); $avatar = get_avatar_url($user_id, array('size' => 80)); $display_name = !empty($user->display_name) ? $user->display_name : $user->user_login; $demo = get_option('datis_active_demo'); /** * Stats (WooCommerce-friendly + filterable) */ // Orders count $order_statuses = apply_filters( 'datis_myaccount_dashboard_order_statuses', array('wc-completed', 'wc-processing', 'wc-on-hold') ); $order_count = 0; if (function_exists('wc_get_orders')) { $order_ids = wc_get_orders( array( 'customer_id' => $user_id, 'status' => $order_statuses, 'limit' => -1, 'return' => 'ids', ) ); $order_count = is_array($order_ids) ? count($order_ids) : 0; } $order_count = (int) apply_filters('datis_myaccount_dashboard_order_count', $order_count, $user_id); // Purchases count (default = orders count) $purchase_count = (int) apply_filters('datis_myaccount_dashboard_purchase_count', $order_count, $user_id); // Projects count (post type: project, author: current user) $project_query_args = apply_filters( 'datis_myaccount_dashboard_project_query_args', array( 'post_type' => 'project', 'post_status' => array('publish'), 'author' => $user_id, 'fields' => 'ids', 'posts_per_page' => 1, 'no_found_rows' => false, ), $user_id ); $project_count = 0; $project_q = new WP_Query($project_query_args); if ($project_q instanceof WP_Query) { $project_count = (int) $project_q->found_posts; } $project_count = (int) apply_filters('datis_myaccount_dashboard_project_count', $project_count, $user_id); /** * Prefill fields (WooCommerce meta first, fallback to WP user) */ $first_name = get_user_meta($user_id, 'billing_first_name', true); $last_name = get_user_meta($user_id, 'billing_last_name', true); $full_name = trim($first_name . ' ' . $last_name); if ($full_name === '') { $full_name = trim($user->first_name . ' ' . $user->last_name); } if ($full_name === '') { $full_name = $display_name; } $phone = get_user_meta($user_id, 'billing_phone', true); $email = $user->user_email; $state = get_user_meta($user_id, 'billing_state', true); $city = get_user_meta($user_id, 'billing_city', true); $postcode = get_user_meta($user_id, 'billing_postcode', true); // allow filtering prefilled values $prefill = apply_filters( 'datis_myaccount_dashboard_prefill', array( 'full_name' => $full_name, 'phone' => $phone, 'email' => $email, 'state' => $state, 'city' => $city, 'postcode' => $postcode, ), $user_id ); /** * My Projects section (latest 3 by current user) * - show nothing if empty */ $my_projects = array(); $projects_args = apply_filters( 'datis_myaccount_dashboard_projects_list_query_args', array( 'post_type' => 'project', 'post_status' => array('publish'), 'author' => $user_id, 'posts_per_page' => 3, 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => true, 'no_found_rows' => true, ), $user_id ); $projects_q = new WP_Query($projects_args); if ($projects_q instanceof WP_Query && $projects_q->have_posts()) { while ($projects_q->have_posts()) { $projects_q->the_post(); $pid = get_the_ID(); // Project type (taxonomy: project-categories) -> first term name $type_label = ''; $terms = get_the_terms($pid, 'project-categories'); if (is_array($terms) && !empty($terms) && !is_wp_error($terms)) { $first_term = reset($terms); if ($first_term && !empty($first_term->name)) { $type_label = (string) $first_term->name; } } if ($type_label === '') { $type_label = esc_html_x('—', 'Project type fallback', 'datis'); } // Status (meta: datis_project_status => in_progress|completed) $raw_status = (string) get_post_meta($pid, 'datis_project_status', true); $raw_status = sanitize_key($raw_status); $status_key = in_array($raw_status, array('in_progress', 'completed'), true) ? $raw_status : 'in_progress'; if ($status_key === 'completed') { $status_text = esc_html_x('Completed', 'Project status', 'datis'); } else { $status_text = esc_html_x('In progress', 'Project status', 'datis'); } // Progress (optional): if you have a meta, use it; otherwise map from status // meta key is filterable to match your system later $progress_meta_key = (string) apply_filters('datis_project_progress_meta_key', 'datis_project_progress', $pid, $user_id); $progress_raw = get_post_meta($pid, $progress_meta_key, true); $progress = null; if ($progress_raw !== '' && $progress_raw !== null) { $progress = (int) $progress_raw; } if (!is_int($progress) || $progress < 0 || $progress > 100) { $progress = ($status_key === 'completed') ? 100 : 50; } // Details URL (single project) $details_url = get_permalink($pid); $my_projects[] = array( 'id' => $pid, 'title' => get_the_title($pid), 'type' => $type_label, 'status_key' => $status_key, 'status_text' => $status_text, 'progress' => $progress, 'url' => $details_url, ); } wp_reset_postdata(); } /** * Hooks */ do_action('woocommerce_account_dashboard'); do_action('woocommerce_before_my_account'); ?> <div class="account-dashboard"> <div class="dashboard-header"> <div class="account-wrapper p-3 p-lg-5 d-flex flex-column flex-lg-row align-items-center justify-content-between"> <div class="d-flex flex-column flex-lg-row align-items-center gap-2"> <div class="dashboard-avatar"> <img src="<?php echo esc_url($avatar); ?>" alt="<?php echo esc_attr(sprintf(_x('%s avatar', 'User avatar alt text', 'datis'), $display_name)); ?>" class="account-nav-avatar-img" width="80" height="80" loading="lazy"> </div> <div class="dashboard-name"> <?php echo esc_html($display_name); ?> </div> </div> <?php $profile_edit_url = apply_filters( 'datis_myaccount_dashboard_profile_edit_url', (function_exists('wc_get_account_endpoint_url') ? wc_get_account_endpoint_url('edit-account') : '#'), $user_id ); ?> <?php $attrs = Datis_WC_MyAccount_Manager::get_instance()->get_avatar_picker_button_attrs(get_current_user_id()); ?> <a href="#" class="account-profile-action d-flex flex-row align-items-center gap-2" <?php foreach ($attrs as $k => $v) { echo esc_attr($k) . '="' . esc_attr($v) . '" '; } ?>> <?php echo esc_html_x('Edit profile image', 'My Account dashboard action', 'datis'); ?> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M19.0105 13.0997C21.6632 10.5605 21.6632 6.44362 19.0105 3.90441C16.3578 1.3652 12.0569 1.3652 9.40419 3.90441M7.9175 17.8068L15.8084 10.2535C16.7558 9.34668 16.7558 7.87637 15.8084 6.96951C14.861 6.06265 13.325 6.06265 12.3776 6.96951L4.54387 14.4681C2.74382 16.1911 2.74382 18.9847 4.54387 20.7077C6.34391 22.4308 9.26237 22.4308 11.0624 20.7077L15.0364 16.9037M3 10.0346L6.20209 6.96951" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </a> </div> </div> <div class="dashboard-stats"> <div class="account-wrapper"> <div class="dashboard-stats-items d-flex flex-column flex-lg-row align-items-center justify-content-center"> <div class="stats-item w-100 w-lg-50 d-flex flex-row align-items-center justify-content-center gap-3"> <div class="stats-item-icon"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M2 13H5.16026C6.06543 13 6.51802 13 6.91584 13.183C7.31367 13.3659 7.60821 13.7096 8.19729 14.3968L8.80271 15.1032C9.39179 15.7904 9.68633 16.1341 10.0842 16.317C10.482 16.5 10.9346 16.5 11.8397 16.5H12.1603C13.0654 16.5 13.518 16.5 13.9158 16.317C14.3137 16.1341 14.6082 15.7904 15.1973 15.1032L15.8027 14.3968C16.3918 13.7096 16.6863 13.3659 17.0842 13.183C17.482 13 17.9346 13 18.8397 13H22" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M8 7H16" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M10 10.5H14" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C21.5093 4.43821 21.8356 5.80655 21.9449 8" stroke="white" stroke-width="1.5" stroke-linecap="round" /> </svg> </div> <div class="d-flex flex-column align-items-start gap-2"> <span class="stats-item-name"><?php echo esc_html_x('Total projects', 'My Account dashboard stat label', 'datis'); ?></span> <span class="stats-item-value"><?php echo esc_html((string) $project_count); ?></span> </div> </div> <div class="stats-item w-100 w-lg-50 d-flex flex-row align-items-center justify-content-center gap-3"> <div class="stats-item-icon"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M20.232 10.5257C19.6468 7.40452 19.3542 5.84393 18.2433 4.92196C17.1324 4 15.5446 4 12.369 4H11.6479C8.47228 4 6.8845 4 5.7736 4.92196C4.66271 5.84393 4.37009 7.40452 3.78487 10.5257C2.96195 14.9146 2.55049 17.1091 3.75011 18.5545C4.94973 20 7.18244 20 11.6478 20H12.369C16.8344 20 19.0672 20 20.2668 18.5545C20.9628 17.7159 21.1165 16.6252 20.9621 15" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M9.17188 8C9.58371 9.16519 10.695 10 12.0012 10C13.3074 10 14.4186 9.16519 14.8305 8" stroke="white" stroke-width="1.5" stroke-linecap="round" /> </svg> </div> <div class="d-flex flex-column align-items-start gap-2"> <span class="stats-item-name"><?php echo esc_html_x('Total purchases', 'My Account dashboard stat label', 'datis'); ?></span> <span class="stats-item-value"><?php echo esc_html((string) $purchase_count); ?></span> </div> </div> <div class="stats-item w-100 w-lg-50 d-flex flex-row align-items-center justify-content-center gap-3"> <div class="stats-item-icon"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M3.5 11V14C3.5 17.7712 3.5 19.6569 4.67157 20.8284C5.84315 22 7.72876 22 11.5 22H12.5C16.2712 22 18.1569 22 19.3284 20.8284M20.5 11V14C20.5 15.1698 20.5 16.1581 20.465 17" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M9.50051 2H14.5005M9.50051 2L8.84877 8.51737C8.66231 10.382 10.1266 12 12.0005 12C13.8744 12 15.3387 10.382 15.1522 8.51737L14.5005 2M9.50051 2H7.4182C6.51017 2 6.05616 2 5.66677 2.10675C4.84628 2.33168 4.15987 2.89439 3.7784 3.65484M9.50051 2L8.77598 9.24527C8.6196 10.8091 7.30367 12 5.73204 12C3.80159 12 2.35373 10.2339 2.73232 8.34093L2.80051 8M14.5005 2H16.5828C17.4908 2 17.9449 2 18.3342 2.10675C19.1547 2.33168 19.8411 2.89439 20.2226 3.65484C20.4037 4.01573 20.4927 4.46093 20.6708 5.35133L21.2687 8.34093C21.6473 10.2339 20.1994 12 18.269 12C16.6973 12 15.3814 10.8091 15.225 9.24527L14.5005 2Z" stroke="white" stroke-width="1.5" stroke-linecap="round" /> <path d="M9.5 21.5V18.5C9.5 17.5654 9.5 17.0981 9.70096 16.75C9.83261 16.522 10.022 16.3326 10.25 16.201C10.5981 16 11.0654 16 12 16C12.9346 16 13.4019 16 13.75 16.201C13.978 16.3326 14.1674 16.522 14.299 16.75C14.5 17.0981 14.5 17.5654 14.5 18.5V21.5" stroke="white" stroke-width="1.5" stroke-linecap="round" /> </svg> </div> <div class="d-flex flex-column align-items-start gap-2"> <span class="stats-item-name"><?php echo esc_html_x('Total orders', 'My Account dashboard stat label', 'datis'); ?></span> <span class="stats-item-value"><?php echo esc_html((string) $order_count); ?></span> </div> </div> </div> </div> </div> <?php if (!empty($my_projects)) : ?> <div class="dashboard-projects"> <div class="account-wrapper"> <!-- Reuse the same structure/classes as your orders/downloads table --> <div class="orders-shell"> <div class="orders-card"> <div class="orders-titlebar"> <h2 class="orders-title"><?php echo esc_html_x('My projects', 'Projects title', 'datis'); ?></h2> </div> <div class="orders-table"> <div class="orders-headrow"> <div class="orders-col orders-col-track"><?php echo esc_html_x('Project name', 'Projects head', 'datis'); ?></div> <div class="orders-col orders-col-date"><?php echo esc_html_x('Project type', 'Projects head', 'datis'); ?></div> <div class="orders-col orders-col-status"><?php echo esc_html_x('Project status', 'Projects head', 'datis'); ?></div> <div class="orders-col orders-col-total"><?php echo esc_html_x('Project progress', 'Projects head', 'datis'); ?></div> <div class="orders-col orders-col-actions"><?php echo esc_html_x('Actions', 'Projects head', 'datis'); ?></div> </div> <div class="orders-body"> <?php foreach ($my_projects as $p) : $status_class = ($p['status_key'] === 'completed') ? 'status-success' : 'status-default'; // ring settings $pct = (int) $p['progress']; if ($pct < 0) $pct = 0; if ($pct > 100) $pct = 100; $size = 26; // close to screenshot $stroke = 1.5; $r = 10; $cx = 13; $cy = 13; $circ = 2 * M_PI * $r; $offset = $circ - ($circ * ($pct / 100)); ?> <div class="orders-row"> <div class="orders-cell orders-col-track" data-label="<?php echo esc_attr_x('Project name', 'Projects label', 'datis'); ?>"> <span class="orders-text orders-track"><?php echo esc_html($p['title']); ?></span> </div> <div class="orders-cell orders-col-date" data-label="<?php echo esc_attr_x('Project type', 'Projects label', 'datis'); ?>"> <span class="orders-text"><?php echo esc_html($p['type']); ?></span> </div> <div class="orders-cell orders-col-status" data-label="<?php echo esc_attr_x('Project status', 'Projects label', 'datis'); ?>"> <span class="order-status <?php echo esc_attr($status_class); ?>"> <span class="order-status-dot" aria-hidden="true"></span> <span class="order-status-text"><?php echo esc_html($p['status_text']); ?></span> </span> </div> <div class="orders-cell orders-col-total" data-label="<?php echo esc_attr_x('Project progress', 'Projects label', 'datis'); ?>"> <span class="orders-text d-flex align-items-center gap-2 flex-row-reverse"> <span class="orders-text"><?php echo esc_html_x('Done', 'Project progress text', 'datis'); ?></span> <span class="datis-progress-ring" aria-label="<?php echo esc_attr(sprintf(esc_html_x('%s percent', 'Project progress aria', 'datis'), (string) $pct)); ?>"> <svg width="<?php echo esc_attr((string) $size); ?>" height="<?php echo esc_attr((string) $size); ?>" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <circle cx="<?php echo esc_attr((string) $cx); ?>" cy="<?php echo esc_attr((string) $cy); ?>" r="<?php echo esc_attr((string) $r); ?>" stroke="currentColor" stroke-opacity="0.15" stroke-width="<?php echo esc_attr((string) $stroke); ?>" /> <circle cx="<?php echo esc_attr((string) $cx); ?>" cy="<?php echo esc_attr((string) $cy); ?>" r="<?php echo esc_attr((string) $r); ?>" stroke="currentColor" stroke-width="<?php echo esc_attr((string) $stroke); ?>" stroke-linecap="round" stroke-dasharray="<?php echo esc_attr((string) $circ); ?>" stroke-dashoffset="<?php echo esc_attr((string) $offset); ?>" transform="rotate(-90 13 13)" /> <text x="13" y="14.5" text-anchor="middle" font-size="8" fill="currentColor" fill-opacity="0.85" style="font-weight:700;"><?php echo esc_html((string) $pct); ?>%</text> </svg> </span> </span> </div> <div class="orders-cell orders-col-actions" data-label="<?php echo esc_attr_x('Actions', 'Projects label', 'datis'); ?>"> <div class="download-actions-inline"> <a class="orders-btn" href="<?php echo esc_url($p['url']); ?>"> <?php echo esc_html_x('Project details', 'Projects action', 'datis'); ?> </a> </div> </div> </div> <?php endforeach; ?> </div> </div> </div> </div> </div> </div> <?php endif; ?> <div class="dashboard-settings"> <div class="account-wrapper d-flex flex-column gap-4"> <?php do_action('datis_myaccount_dashboard_before_settings_form', $user_id); ?> <form class="dash-form d-flex flex-column gap-3" method="post" action=""> <?php wp_nonce_field('datis_myaccount_dashboard_save', 'datis_myaccount_dashboard_nonce'); ?> <input type="hidden" name="datis_myaccount_dashboard_action" value="save"> <!-- Account Info --> <section class="dash-card dash-card-account"> <div class="dash-card-head flex-column d-flex flex-lg-row align-items-start align-items-lg-center justify-content-between"> <h3 class="dash-card-title"><?php echo esc_html_x('Account information', 'My Account dashboard section title', 'datis'); ?></h3> <a class="dash-card-more d-flex flex-row align-items-center gap-2" href="<?php echo esc_url(function_exists('wc_get_account_endpoint_url') ? wc_get_account_endpoint_url('edit-account') : '#'); ?>"> <?php echo esc_html_x('More information', 'My Account dashboard link label', 'datis'); ?> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M5 5H12.5M5 5V12.5M5 5L10.4167 10.4167M15 15L12.9167 12.9167" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> </svg> </a> </div> <div class="dash-card-body"> <div class="dash-form-grid"> <?php do_action('datis_myaccount_dashboard_before_account_fields', $user_id); ?> <div class="dash-field"> <span class="dash-field-icon dash-ico-user" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="12" cy="6" r="4" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M15 20.6151C14.0907 20.8619 13.0736 21 12 21C8.13401 21 5 19.2091 5 17C5 14.7909 8.13401 13 12 13C15.866 13 19 14.7909 19 17C19 17.3453 18.9234 17.6804 18.7795 18" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="text" name="datis_full_name" value="<?php echo esc_attr((string) $prefill['full_name']); ?>" placeholder="<?php echo esc_attr_x('Full name', 'Account field placeholder', 'datis'); ?>" autocomplete="name"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-phone" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.5 2.00012C13.5 2.00012 15.8335 2.21225 18.8033 5.1821C21.7731 8.15195 21.9853 10.4854 21.9853 10.4854" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M14.207 5.53564C14.207 5.53564 15.197 5.81849 16.6819 7.30341C18.1668 8.78834 18.4497 9.77829 18.4497 9.77829" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M15.1017 15.0272L15.6455 15.5437L15.6455 15.5437L15.1017 15.0272ZM15.5572 14.5477L15.0134 14.0312L15.0134 14.0312L15.5572 14.5477ZM17.9738 14.2123L17.5997 14.8623L17.5997 14.8623L17.9738 14.2123ZM19.8843 15.312L19.5102 15.962L19.8843 15.312ZM20.4227 18.7584L20.9665 19.2749L20.9665 19.2749L20.4227 18.7584ZM19.0021 20.254L18.4583 19.7375L18.4583 19.7375L19.0021 20.254ZM17.6773 20.9631L17.751 21.7095L17.751 21.7095L17.6773 20.9631ZM7.81638 16.4752L8.36017 15.9587L7.81638 16.4752ZM3.75283 6.92574C3.73063 6.51212 3.37733 6.19481 2.96371 6.21701C2.55009 6.23921 2.23278 6.59252 2.25498 7.00613L3.00391 6.96594L3.75283 6.92574ZM9.19172 8.80507L9.73552 9.32159L9.73552 9.32159L9.19172 8.80507ZM9.47854 8.50311L10.0223 9.01963L10.0223 9.01963L9.47854 8.50311ZM9.63526 5.6931L10.2477 5.26012L10.2477 5.26012L9.63526 5.6931ZM8.37427 3.90961L7.76188 4.3426L7.76188 4.3426L8.37427 3.90961ZM4.71868 3.09213C4.43341 3.39246 4.44562 3.86717 4.74595 4.15244C5.04628 4.4377 5.521 4.42549 5.80626 4.12516L5.26247 3.60864L4.71868 3.09213ZM11.0641 13.0559L11.6079 12.5394L11.6079 12.5394L11.0641 13.0559ZM10.6651 19.8123C11.0158 20.0327 11.4788 19.9271 11.6992 19.5764C11.9196 19.2257 11.8139 18.7627 11.4632 18.5423L11.0641 19.1773L10.6651 19.8123ZM15.114 20.0584C14.7085 19.9735 14.3111 20.2334 14.2262 20.6388C14.1413 21.0442 14.4011 21.4417 14.8065 21.5266L14.9602 20.7925L15.114 20.0584ZM15.1017 15.0272L15.6455 15.5437L16.101 15.0642L15.5572 14.5477L15.0134 14.0312L14.5579 14.5107L15.1017 15.0272ZM17.9738 14.2123L17.5997 14.8623L19.5102 15.962L19.8843 15.312L20.2585 14.662L18.348 13.5623L17.9738 14.2123ZM20.4227 18.7584L19.8789 18.2419L18.4583 19.7375L19.0021 20.254L19.5459 20.7705L20.9665 19.2749L20.4227 18.7584ZM7.81638 16.4752L8.36017 15.9587C4.48405 11.8778 3.83387 8.43556 3.75283 6.92574L3.00391 6.96594L2.25498 7.00613C2.35424 8.85536 3.13942 12.6403 7.27258 16.9917L7.81638 16.4752ZM9.19172 8.80507L9.73552 9.32159L10.0223 9.01963L9.47854 8.50311L8.93474 7.9866L8.64793 8.28856L9.19172 8.80507ZM9.63526 5.6931L10.2477 5.26012L8.98667 3.47663L8.37427 3.90961L7.76188 4.3426L9.02287 6.12608L9.63526 5.6931ZM9.19172 8.80507C8.64793 8.28856 8.64724 8.28929 8.64654 8.29002C8.6463 8.29028 8.6456 8.29102 8.64513 8.29152C8.64418 8.29254 8.64321 8.29357 8.64222 8.29463C8.64026 8.29675 8.63822 8.29896 8.63612 8.30127C8.63193 8.30588 8.62748 8.31087 8.6228 8.31625C8.61344 8.32701 8.60317 8.33931 8.59218 8.3532C8.5702 8.38098 8.54533 8.41511 8.51924 8.45588C8.46692 8.53764 8.41019 8.64531 8.36214 8.78033C8.26444 9.0549 8.2112 9.4185 8.27773 9.87257C8.40844 10.7647 8.993 11.9644 10.5203 13.5724L11.0641 13.0559L11.6079 12.5394C10.1803 11.0363 9.82863 10.1106 9.76188 9.65511C9.72968 9.43536 9.7624 9.31957 9.77534 9.28321C9.78261 9.26277 9.78737 9.25709 9.78271 9.26437C9.78045 9.26789 9.77596 9.27451 9.76839 9.28407C9.76461 9.28885 9.76005 9.29437 9.75461 9.30063C9.7519 9.30375 9.74895 9.30706 9.74578 9.31056C9.74419 9.31231 9.74254 9.3141 9.74083 9.31594C9.73997 9.31686 9.7391 9.31779 9.73822 9.31873C9.73778 9.3192 9.7371 9.31992 9.73688 9.32015C9.7362 9.32087 9.73552 9.32159 9.19172 8.80507ZM11.0641 13.0559L10.5203 13.5724C12.0432 15.1757 13.1933 15.806 14.0708 15.9485C14.5211 16.0216 14.8856 15.9632 15.1616 15.8544C15.2965 15.8012 15.4032 15.7387 15.4833 15.6819C15.5233 15.6535 15.5566 15.6266 15.5834 15.6031C15.5969 15.5913 15.6087 15.5803 15.6191 15.5703C15.6242 15.5654 15.629 15.5606 15.6334 15.5562C15.6356 15.554 15.6377 15.5518 15.6398 15.5497C15.6408 15.5487 15.6417 15.5477 15.6427 15.5467C15.6432 15.5462 15.6439 15.5454 15.6441 15.5452C15.6448 15.5444 15.6455 15.5437 15.1017 15.0272C14.5579 14.5107 14.5586 14.51 14.5593 14.5093C14.5595 14.509 14.5602 14.5083 14.5607 14.5078C14.5616 14.5069 14.5624 14.506 14.5633 14.5051C14.5651 14.5033 14.5668 14.5015 14.5685 14.4998C14.5718 14.4965 14.575 14.4933 14.578 14.4904C14.5841 14.4846 14.5895 14.4796 14.5943 14.4754C14.6038 14.467 14.611 14.4616 14.6156 14.4583C14.6249 14.4517 14.624 14.454 14.6112 14.459C14.5919 14.4666 14.501 14.4987 14.3113 14.4679C13.9088 14.4025 13.0401 14.0472 11.6079 12.5394L11.0641 13.0559ZM8.37427 3.90961L8.98667 3.47663C7.97308 2.04305 5.94486 1.80119 4.71868 3.09213L5.26247 3.60864L5.80626 4.12516C6.3291 3.57471 7.24953 3.61795 7.76188 4.3426L8.37427 3.90961ZM19.0021 20.254L18.4583 19.7375C18.1793 20.0313 17.8874 20.1887 17.6036 20.2167L17.6773 20.9631L17.751 21.7095C18.498 21.6357 19.1026 21.2373 19.5459 20.7705L19.0021 20.254ZM9.47854 8.50311L10.0223 9.01963C10.9899 8.00095 11.0584 6.40678 10.2477 5.26012L9.63526 5.6931L9.02287 6.12608C9.44501 6.72315 9.38028 7.51753 8.93474 7.9866L9.47854 8.50311ZM19.8843 15.312L19.5102 15.962C20.3311 16.4345 20.4917 17.5968 19.8789 18.2419L20.4227 18.7584L20.9665 19.2749C22.2715 17.901 21.8914 15.6019 20.2585 14.662L19.8843 15.312ZM15.5572 14.5477L16.101 15.0642C16.4864 14.6584 17.087 14.5672 17.5997 14.8623L17.9738 14.2123L18.348 13.5623C17.2495 12.93 15.8872 13.1113 15.0134 14.0312L15.5572 14.5477ZM11.0641 19.1773L11.4632 18.5423C10.4794 17.9241 9.43246 17.0876 8.36017 15.9587L7.81638 16.4752L7.27258 16.9917C8.42661 18.2067 9.56994 19.1241 10.6651 19.8123L11.0641 19.1773ZM17.6773 20.9631L17.6036 20.2167C17.0571 20.2707 16.1922 20.2842 15.114 20.0584L14.9602 20.7925L14.8065 21.5266C16.0551 21.788 17.0752 21.7762 17.751 21.7095L17.6773 20.9631Z" fill="currentColor" fill-opacity="0.6" /> </svg> </span> <input class="dash-input" type="text" name="datis_phone" value="<?php echo esc_attr((string) $prefill['phone']); ?>" placeholder="<?php echo esc_attr_x('Phone number', 'Account field placeholder', 'datis'); ?>" autocomplete="tel"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-mail" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M22 12C22 15.7712 22 17.6569 20.8284 18.8284C19.6569 20 17.7712 20 14 20H10C6.22876 20 4.34315 20 3.17157 18.8284C2 17.6569 2 15.7712 2 12C2 8.22876 2 6.34315 3.17157 5.17157C4.34315 4 6.22876 4 10 4H14C17.7712 4 19.6569 4 20.8284 5.17157C21.4816 5.82475 21.7706 6.69989 21.8985 8" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M18 8L15.8411 9.79908C14.0045 11.3296 13.0861 12.0949 12 12.0949C11.3507 12.0949 10.7614 11.8214 10 11.2744M6 8L6.9 8.75L7.8 9.5" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="email" name="datis_email" value="<?php echo esc_attr((string) $prefill['email']); ?>" placeholder="<?php echo esc_attr_x('Email address', 'Account field placeholder', 'datis'); ?>" autocomplete="email"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-province" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M22 22H2" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M21 22V14.5C21 13.6716 20.3284 13 19.5 13H16.5C15.6716 13 15 13.6716 15 14.5V22" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M15 22V9M9 22V5C9 3.58579 9 2.87868 9.43934 2.43934C9.87868 2 10.5858 2 12 2C13.4142 2 14.1213 2 14.5607 2.43934C15 2.87868 15 3.58579 15 5V5" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 22V9.5C9 8.67157 8.32843 8 7.5 8H4.5C3.67157 8 3 8.67157 3 9.5V16M3 22V19.75" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="text" name="datis_state" value="<?php echo esc_attr((string) $prefill['state']); ?>" placeholder="<?php echo esc_attr_x('State', 'Account field placeholder', 'datis'); ?>" autocomplete="address-level1"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-city" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M22 22H2" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M21 22V14.5C21 13.6716 20.3284 13 19.5 13H16.5C15.6716 13 15 13.6716 15 14.5V22" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M15 22V9M9 22V5C9 3.58579 9 2.87868 9.43934 2.43934C9.87868 2 10.5858 2 12 2C13.4142 2 14.1213 2 14.5607 2.43934C15 2.87868 15 3.58579 15 5V5" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 22V9.5C9 8.67157 8.32843 8 7.5 8H4.5C3.67157 8 3 8.67157 3 9.5V16M3 22V19.75" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="text" name="datis_city" value="<?php echo esc_attr((string) $prefill['city']); ?>" placeholder="<?php echo esc_attr_x('City', 'Account field placeholder', 'datis'); ?>" autocomplete="address-level2"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-postal" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M22 12C22 15.7712 22 17.6569 20.8284 18.8284C19.6569 20 17.7712 20 14 20H10C6.22876 20 4.34315 20 3.17157 18.8284C2 17.6569 2 15.7712 2 12C2 8.22876 2 6.34315 3.17157 5.17157C4.34315 4 6.22876 4 10 4H14C17.7712 4 19.6569 4 20.8284 5.17157C21.4816 5.82475 21.7706 6.69989 21.8985 8" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M18 8L15.8411 9.79908C14.0045 11.3296 13.0861 12.0949 12 12.0949C11.3507 12.0949 10.7614 11.8214 10 11.2744M6 8L6.9 8.75L7.8 9.5" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="text" name="datis_postcode" value="<?php echo esc_attr((string) $prefill['postcode']); ?>" placeholder="<?php echo esc_attr_x('Postal code', 'Account field placeholder', 'datis'); ?>" autocomplete="postal-code"> </div> <?php do_action('datis_myaccount_dashboard_after_account_fields', $user_id); ?> </div> </div> </section> <!-- Password Info --> <section class="dash-card dash-card-password"> <div class="dash-card-head flex-column d-flex flex-lg-row align-items-start align-items-lg-center justify-content-between"> <h3 class="dash-card-title"><?php echo esc_html_x('Password information', 'My Account dashboard section title', 'datis'); ?></h3> <a class="dash-card-more d-flex flex-row align-items-center gap-2" href="<?php echo esc_url(function_exists('wc_get_account_endpoint_url') ? wc_get_account_endpoint_url('edit-account') : '#'); ?>"> <?php echo esc_html_x('More information', 'My Account dashboard link label', 'datis'); ?> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> <path d="M5 5H12.5M5 5V12.5M5 5L10.4167 10.4167M15 15L12.9167 12.9167" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> </svg> </a> </div> <div class="dash-card-body"> <div class="dash-form-grid dash-form-grid-3"> <?php do_action('datis_myaccount_dashboard_before_password_fields', $user_id); ?> <div class="dash-field"> <span class="dash-field-icon dash-ico-lock" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="12" cy="16" r="2" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M6 10V8C6 7.65929 6.0284 7.32521 6.08296 7M18 10V8C18 4.68629 15.3137 2 12 2C10.208 2 8.59942 2.78563 7.5 4.03126" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M11 22H8C5.17157 22 3.75736 22 2.87868 21.1213C2 20.2426 2 18.8284 2 16C2 13.1716 2 11.7574 2.87868 10.8787C3.75736 10 5.17157 10 8 10H16C18.8284 10 20.2426 10 21.1213 10.8787C22 11.7574 22 13.1716 22 16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="password" name="datis_current_password" placeholder="<?php echo esc_attr_x('Current password', 'Password field placeholder', 'datis'); ?>" autocomplete="current-password"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-lock" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="12" cy="16" r="2" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M6 10V8C6 7.65929 6.0284 7.32521 6.08296 7M18 10V8C18 4.68629 15.3137 2 12 2C10.208 2 8.59942 2.78563 7.5 4.03126" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M11 22H8C5.17157 22 3.75736 22 2.87868 21.1213C2 20.2426 2 18.8284 2 16C2 13.1716 2 11.7574 2.87868 10.8787C3.75736 10 5.17157 10 8 10H16C18.8284 10 20.2426 10 21.1213 10.8787C22 11.7574 22 13.1716 22 16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="password" name="datis_new_password" placeholder="<?php echo esc_attr_x('New password', 'Password field placeholder', 'datis'); ?>" autocomplete="new-password"> </div> <div class="dash-field"> <span class="dash-field-icon dash-ico-lock" aria-hidden="true"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="12" cy="16" r="2" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" /> <path d="M6 10V8C6 7.65929 6.0284 7.32521 6.08296 7M18 10V8C18 4.68629 15.3137 2 12 2C10.208 2 8.59942 2.78563 7.5 4.03126" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> <path d="M11 22H8C5.17157 22 3.75736 22 2.87868 21.1213C2 20.2426 2 18.8284 2 16C2 13.1716 2 11.7574 2.87868 10.8787C3.75736 10 5.17157 10 8 10H16C18.8284 10 20.2426 10 21.1213 10.8787C22 11.7574 22 13.1716 22 16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" /> </svg> </span> <input class="dash-input" type="password" name="datis_confirm_password" placeholder="<?php echo esc_attr_x('Confirm new password', 'Password field placeholder', 'datis'); ?>" autocomplete="new-password"> </div> <?php do_action('datis_myaccount_dashboard_after_password_fields', $user_id); ?> </div> <ul class="dash-hints"> <li class="dash-hint-item"><?php echo esc_html_x('At least 8 characters', 'Password hint', 'datis'); ?></li> <li class="dash-hint-item"><?php echo esc_html_x('Use numbers and Latin letters', 'Password hint', 'datis'); ?></li> <li class="dash-hint-item"><?php echo esc_html_x('Do not use personal information', 'Password hint', 'datis'); ?></li> </ul> <div class="dash-actions d-flex align-items-center justify-content-start justify-content-lg-end w-100 mt-4 mt-lg-0"> <button class="dash-btn dash-btn-primary" type="submit" name="datis_myaccount_dashboard_submit" value="1"> <?php if ($demo == 'industry') : ?> <svg width="14" height="13" viewBox="0 0 14 13" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.7701 11.8579L10.8921 10.2077M0.750669 1.29699L9.2183 0.750029M0.750669 1.29699L1.29763 9.76463M0.750669 1.29699L8.63844 8.22758" stroke="#F5F5F5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" /> </svg> <?php elseif ($demo == 'business') : ?> <svg width="44" height="40" viewBox="0 0 44 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10 40C4.47715 40 -1.95703e-07 35.5228 -4.37114e-07 30L-1.31134e-06 10C-1.55275e-06 4.47715 4.47715 -1.95703e-07 10 -4.37114e-07L33.1922 -1.45088e-06C39.6979 -1.73525e-06 44.4715 6.11389 42.8937 12.4254L37.8937 32.4254C36.7807 36.877 32.7809 40 28.1922 40L10 40Z" fill="#F9E65C" /> <path d="M15.3433 15.3139H22.3286M15.3433 15.3139V22.2992M15.3433 15.3139L21.4554 21.4261M24.657 24.6276L23.2017 23.1724" stroke="#0A2647" stroke-width="1.23483" stroke-linecap="round" stroke-linejoin="round" /> </svg> <?php else : ?> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6 6H15M6 6V15M6 6L12.5 12.5M18 18L15.5 15.5" stroke="#F7F6FE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> </svg> <?php endif; ?> <?php if ($demo == 'industry' || $demo == 'business') : ?> <?php echo esc_html_x('Save', 'My Account dashboard button label', 'datis'); ?> <?php else : ?> <span><?php echo esc_html_x('Save', 'My Account dashboard button label', 'datis'); ?></span> <?php endif; ?> </button> </div> </div> </section> </form> <?php do_action('datis_myaccount_dashboard_after_settings_form', $user_id); ?> </div> </div> </div> <?php do_action('woocommerce_after_my_account');
💾 保存文件
← 返回文件管理器