initial commit
This commit is contained in:
81
templates/myaccount/dashboard.php
Normal file
81
templates/myaccount/dashboard.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* My Account Dashboard
|
||||
*
|
||||
* Shows the first intro screen on the account dashboard.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/dashboard.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 4.4.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
$allowed_html = array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: user display name 2: logout url */
|
||||
wp_kses( __( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ), $allowed_html ),
|
||||
'<strong>' . esc_html( $current_user->display_name ) . '</strong>',
|
||||
esc_url( wc_logout_url() )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: Orders URL 2: Address URL 3: Account URL. */
|
||||
$dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">billing address</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
|
||||
if ( wc_shipping_enabled() ) {
|
||||
/* translators: 1: Orders URL 2: Addresses URL 3: Account URL. */
|
||||
$dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">shipping and billing addresses</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
|
||||
}
|
||||
printf(
|
||||
wp_kses( $dashboard_desc, $allowed_html ),
|
||||
esc_url( wc_get_endpoint_url( 'orders' ) ),
|
||||
esc_url( wc_get_endpoint_url( 'edit-address' ) ),
|
||||
esc_url( wc_get_endpoint_url( 'edit-account' ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* My Account dashboard.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( 'woocommerce_account_dashboard' );
|
||||
|
||||
/**
|
||||
* Deprecated woocommerce_before_my_account action.
|
||||
*
|
||||
* @deprecated 2.6.0
|
||||
*/
|
||||
do_action( 'woocommerce_before_my_account' );
|
||||
|
||||
/**
|
||||
* Deprecated woocommerce_after_my_account action.
|
||||
*
|
||||
* @deprecated 2.6.0
|
||||
*/
|
||||
do_action( 'woocommerce_after_my_account' );
|
||||
|
||||
/* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */
|
46
templates/myaccount/downloads.php
Normal file
46
templates/myaccount/downloads.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Downloads
|
||||
*
|
||||
* Shows downloads on the account page.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.2.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$downloads = WC()->customer->get_downloadable_products();
|
||||
$has_downloads = (bool) $downloads;
|
||||
|
||||
do_action( 'woocommerce_before_account_downloads', $has_downloads ); ?>
|
||||
|
||||
<?php if ( $has_downloads ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_available_downloads' ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_available_downloads', $downloads ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_available_downloads' ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
<div class="woocommerce-Message woocommerce-Message--info woocommerce-info">
|
||||
<a class="woocommerce-Button button" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">
|
||||
<?php esc_html_e( 'Browse products', 'woocommerce' ); ?>
|
||||
</a>
|
||||
<?php esc_html_e( 'No downloads available yet.', 'woocommerce' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_account_downloads', $has_downloads ); ?>
|
61
templates/myaccount/form-add-payment-method.php
Normal file
61
templates/myaccount/form-add-payment-method.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Add payment method form form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-add-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 4.3.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
|
||||
|
||||
if ( $available_gateways ) : ?>
|
||||
<form id="add_payment_method" method="post">
|
||||
<div id="payment" class="woocommerce-Payment">
|
||||
<ul class="woocommerce-PaymentMethods payment_methods methods">
|
||||
<?php
|
||||
// Chosen Method.
|
||||
if ( count( $available_gateways ) ) {
|
||||
current( $available_gateways )->set_current();
|
||||
}
|
||||
|
||||
foreach ( $available_gateways as $gateway ) {
|
||||
?>
|
||||
<li class="woocommerce-PaymentMethod woocommerce-PaymentMethod--<?php echo esc_attr( $gateway->id ); ?> 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 ); ?> />
|
||||
<label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>"><?php echo wp_kses_post( $gateway->get_title() ); ?> <?php echo wp_kses_post( $gateway->get_icon() ); ?></label>
|
||||
<?php
|
||||
if ( $gateway->has_fields() || $gateway->get_description() ) {
|
||||
echo '<div class="woocommerce-PaymentBox woocommerce-PaymentBox--' . esc_attr( $gateway->id ) . ' payment_box payment_method_' . esc_attr( $gateway->id ) . '" style="display: none;">';
|
||||
$gateway->payment_fields();
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'woocommerce_add_payment_method_form_bottom' ); ?>
|
||||
|
||||
<div class="form-row">
|
||||
<?php wp_nonce_field( 'woocommerce-add-payment-method', 'woocommerce-add-payment-method-nonce' ); ?>
|
||||
<button type="submit" class="woocommerce-Button woocommerce-Button--alt button alt" id="place_order" value="<?php esc_attr_e( 'Add payment method', 'woocommerce' ); ?>"><?php esc_html_e( 'Add payment method', 'woocommerce' ); ?></button>
|
||||
<input type="hidden" name="woocommerce_add_payment_method" id="woocommerce_add_payment_method" value="1" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php else : ?>
|
||||
<p class="woocommerce-notice woocommerce-notice--info woocommerce-info"><?php esc_html_e( 'New payment methods can only be added during checkout. Please contact us if you require assistance.', 'woocommerce' ); ?></p>
|
||||
<?php endif; ?>
|
76
templates/myaccount/form-edit-account.php
Normal file
76
templates/myaccount/form-edit-account.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit account form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_edit_account_form' ); ?>
|
||||
|
||||
<form class="woocommerce-EditAccountForm edit-account" action="" method="post" <?php do_action( 'woocommerce_edit_account_form_tag' ); ?> >
|
||||
|
||||
<?php do_action( 'woocommerce_edit_account_form_start' ); ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first">
|
||||
<label for="account_first_name"><?php esc_html_e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_first_name" id="account_first_name" autocomplete="given-name" value="<?php echo esc_attr( $user->first_name ); ?>" />
|
||||
</p>
|
||||
<p class="woocommerce-form-row woocommerce-form-row--last form-row form-row-last">
|
||||
<label for="account_last_name"><?php esc_html_e( 'Last name', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_last_name" id="account_last_name" autocomplete="family-name" value="<?php echo esc_attr( $user->last_name ); ?>" />
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="account_display_name"><?php esc_html_e( 'Display name', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="account_display_name" id="account_display_name" value="<?php echo esc_attr( $user->display_name ); ?>" /> <span><em><?php esc_html_e( 'This will be how your name will be displayed in the account section and in reviews', 'woocommerce' ); ?></em></span>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="account_email"><?php esc_html_e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="email" class="woocommerce-Input woocommerce-Input--email input-text" name="account_email" id="account_email" autocomplete="email" value="<?php echo esc_attr( $user->user_email ); ?>" />
|
||||
</p>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php esc_html_e( 'Password change', 'woocommerce' ); ?></legend>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="password_current"><?php esc_html_e( 'Current password (leave blank to leave unchanged)', 'woocommerce' ); ?></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_current" id="password_current" autocomplete="off" />
|
||||
</p>
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="password_1"><?php esc_html_e( 'New password (leave blank to leave unchanged)', 'woocommerce' ); ?></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_1" id="password_1" autocomplete="off" />
|
||||
</p>
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="password_2"><?php esc_html_e( 'Confirm new password', 'woocommerce' ); ?></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--password input-text" name="password_2" id="password_2" autocomplete="off" />
|
||||
</p>
|
||||
</fieldset>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action( 'woocommerce_edit_account_form' ); ?>
|
||||
|
||||
<p>
|
||||
<?php wp_nonce_field( 'save_account_details', 'save-account-details-nonce' ); ?>
|
||||
<button type="submit" class="woocommerce-Button button" name="save_account_details" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
|
||||
<input type="hidden" name="action" value="save_account_details" />
|
||||
</p>
|
||||
|
||||
<?php do_action( 'woocommerce_edit_account_form_end' ); ?>
|
||||
</form>
|
||||
|
||||
<?php do_action( 'woocommerce_after_edit_account_form' ); ?>
|
56
templates/myaccount/form-edit-address.php
Normal file
56
templates/myaccount/form-edit-address.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit address form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-address.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$page_title = ( 'billing' === $load_address ) ? esc_html__( 'Billing address', 'woocommerce' ) : esc_html__( 'Shipping address', 'woocommerce' );
|
||||
|
||||
do_action( 'woocommerce_before_edit_account_address_form' ); ?>
|
||||
|
||||
<?php if ( ! $load_address ) : ?>
|
||||
<?php wc_get_template( 'myaccount/my-address.php' ); ?>
|
||||
<?php else : ?>
|
||||
|
||||
<form method="post">
|
||||
|
||||
<h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title, $load_address ); ?></h3><?php // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<div class="woocommerce-address-fields">
|
||||
<?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?>
|
||||
|
||||
<div class="woocommerce-address-fields__field-wrapper">
|
||||
<?php
|
||||
foreach ( $address as $key => $field ) {
|
||||
woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save address', 'woocommerce' ); ?>"><?php esc_html_e( 'Save address', 'woocommerce' ); ?></button>
|
||||
<?php wp_nonce_field( 'woocommerce-edit_address', 'woocommerce-edit-address-nonce' ); ?>
|
||||
<input type="hidden" name="action" value="edit_address" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_edit_account_address_form' ); ?>
|
119
templates/myaccount/form-login.php
Normal file
119
templates/myaccount/form-login.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Login Form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 4.1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_before_customer_login_form' ); ?>
|
||||
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?>
|
||||
|
||||
<div class="u-columns col2-set" id="customer_login">
|
||||
|
||||
<div class="u-column1 col-1">
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h2><?php esc_html_e( 'Login', 'woocommerce' ); ?></h2>
|
||||
|
||||
<form class="woocommerce-form woocommerce-form-login login" method="post">
|
||||
|
||||
<?php do_action( 'woocommerce_login_form_start' ); ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="username"><?php esc_html_e( 'Username or email address', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p>
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input class="woocommerce-Input woocommerce-Input--text input-text" type="password" name="password" id="password" autocomplete="current-password" />
|
||||
</p>
|
||||
|
||||
<?php do_action( 'woocommerce_login_form' ); ?>
|
||||
|
||||
<p class="form-row">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme">
|
||||
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
|
||||
<button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php esc_attr_e( 'Log in', 'woocommerce' ); ?>"><?php esc_html_e( 'Log in', 'woocommerce' ); ?></button>
|
||||
</p>
|
||||
<p class="woocommerce-LostPassword lost_password">
|
||||
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'woocommerce_login_form_end' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="u-column2 col-2">
|
||||
|
||||
<h2><?php esc_html_e( 'Register', 'woocommerce' ); ?></h2>
|
||||
|
||||
<form method="post" class="woocommerce-form woocommerce-form-register register" <?php do_action( 'woocommerce_register_form_tag' ); ?> >
|
||||
|
||||
<?php do_action( 'woocommerce_register_form_start' ); ?>
|
||||
|
||||
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) : ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="reg_username"><?php esc_html_e( 'Username', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="text" class="woocommerce-Input woocommerce-Input--text input-text" name="username" id="reg_username" autocomplete="username" value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="reg_email"><?php esc_html_e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" autocomplete="email" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( wp_unslash( $_POST['email'] ) ) : ''; ?>" /><?php // @codingStandardsIgnoreLine ?>
|
||||
</p>
|
||||
|
||||
<?php if ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) : ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
|
||||
<label for="reg_password"><?php esc_html_e( 'Password', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" autocomplete="new-password" />
|
||||
</p>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p><?php esc_html_e( 'A password will be sent to your email address.', 'woocommerce' ); ?></p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_register_form' ); ?>
|
||||
|
||||
<p class="woocommerce-form-row form-row">
|
||||
<?php wp_nonce_field( 'woocommerce-register', 'woocommerce-register-nonce' ); ?>
|
||||
<button type="submit" class="woocommerce-Button woocommerce-button button woocommerce-form-register__submit" name="register" value="<?php esc_attr_e( 'Register', 'woocommerce' ); ?>"><?php esc_html_e( 'Register', 'woocommerce' ); ?></button>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'woocommerce_register_form_end' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_customer_login_form' ); ?>
|
45
templates/myaccount/form-lost-password.php
Normal file
45
templates/myaccount/form-lost-password.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Lost password form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-lost-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.2
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_lost_password_form' );
|
||||
?>
|
||||
|
||||
<form method="post" class="woocommerce-ResetPassword lost_reset_password">
|
||||
|
||||
<p><?php echo apply_filters( 'woocommerce_lost_password_message', esc_html__( 'Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.', 'woocommerce' ) ); ?></p><?php // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first">
|
||||
<label for="user_login"><?php esc_html_e( 'Username or email', 'woocommerce' ); ?></label>
|
||||
<input class="woocommerce-Input woocommerce-Input--text input-text" type="text" name="user_login" id="user_login" autocomplete="username" />
|
||||
</p>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action( 'woocommerce_lostpassword_form' ); ?>
|
||||
|
||||
<p class="woocommerce-form-row form-row">
|
||||
<input type="hidden" name="wc_reset_password" value="true" />
|
||||
<button type="submit" class="woocommerce-Button button" value="<?php esc_attr_e( 'Reset password', 'woocommerce' ); ?>"><?php esc_html_e( 'Reset password', 'woocommerce' ); ?></button>
|
||||
</p>
|
||||
|
||||
<?php wp_nonce_field( 'lost_password', 'woocommerce-lost-password-nonce' ); ?>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
do_action( 'woocommerce_after_lost_password_form' );
|
53
templates/myaccount/form-reset-password.php
Normal file
53
templates/myaccount/form-reset-password.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Lost password reset form.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.5
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_reset_password_form' );
|
||||
?>
|
||||
|
||||
<form method="post" class="woocommerce-ResetPassword lost_reset_password">
|
||||
|
||||
<p><?php echo apply_filters( 'woocommerce_reset_password_message', esc_html__( 'Enter a new password below.', 'woocommerce' ) ); ?></p><?php // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<p class="woocommerce-form-row woocommerce-form-row--first form-row form-row-first">
|
||||
<label for="password_1"><?php esc_html_e( 'New password', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password_1" id="password_1" autocomplete="new-password" />
|
||||
</p>
|
||||
<p class="woocommerce-form-row woocommerce-form-row--last form-row form-row-last">
|
||||
<label for="password_2"><?php esc_html_e( 'Re-enter new password', 'woocommerce' ); ?> <span class="required">*</span></label>
|
||||
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password_2" id="password_2" autocomplete="new-password" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="reset_key" value="<?php echo esc_attr( $args['key'] ); ?>" />
|
||||
<input type="hidden" name="reset_login" value="<?php echo esc_attr( $args['login'] ); ?>" />
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action( 'woocommerce_resetpassword_form' ); ?>
|
||||
|
||||
<p class="woocommerce-form-row form-row">
|
||||
<input type="hidden" name="wc_reset_password" value="true" />
|
||||
<button type="submit" class="woocommerce-Button button" value="<?php esc_attr_e( 'Save', 'woocommerce' ); ?>"><?php esc_html_e( 'Save', 'woocommerce' ); ?></button>
|
||||
</p>
|
||||
|
||||
<?php wp_nonce_field( 'reset_password', 'woocommerce-reset-password-nonce' ); ?>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
do_action( 'woocommerce_after_reset_password_form' );
|
||||
|
27
templates/myaccount/lost-password-confirmation.php
Normal file
27
templates/myaccount/lost-password-confirmation.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Lost password confirmation text.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/lost-password-confirmation.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.9.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
wc_print_notice( esc_html__( 'Password reset email has been sent.', 'woocommerce' ) );
|
||||
?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_lost_password_confirmation_message' ); ?>
|
||||
|
||||
<p><?php echo esc_html( apply_filters( 'woocommerce_lost_password_confirmation_message', esc_html__( 'A password reset email has been sent to the email address on file for your account, but may take several minutes to show up in your inbox. Please wait at least 10 minutes before attempting another reset.', 'woocommerce' ) ) ); ?></p>
|
||||
|
||||
<?php do_action( 'woocommerce_after_lost_password_confirmation_message' ); ?>
|
36
templates/myaccount/my-account.php
Normal file
36
templates/myaccount/my-account.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* My Account page
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* My Account navigation.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( 'woocommerce_account_navigation' ); ?>
|
||||
|
||||
<div class="woocommerce-MyAccount-content">
|
||||
<?php
|
||||
/**
|
||||
* My Account content.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( 'woocommerce_account_content' );
|
||||
?>
|
||||
</div>
|
77
templates/myaccount/my-address.php
Normal file
77
templates/myaccount/my-address.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* My Addresses
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-address.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 2.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$customer_id = get_current_user_id();
|
||||
|
||||
if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) {
|
||||
$get_addresses = apply_filters(
|
||||
'woocommerce_my_account_get_addresses',
|
||||
array(
|
||||
'billing' => __( 'Billing address', 'woocommerce' ),
|
||||
'shipping' => __( 'Shipping address', 'woocommerce' ),
|
||||
),
|
||||
$customer_id
|
||||
);
|
||||
} else {
|
||||
$get_addresses = apply_filters(
|
||||
'woocommerce_my_account_get_addresses',
|
||||
array(
|
||||
'billing' => __( 'Billing address', 'woocommerce' ),
|
||||
),
|
||||
$customer_id
|
||||
);
|
||||
}
|
||||
|
||||
$oldcol = 1;
|
||||
$col = 1;
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php echo apply_filters( 'woocommerce_my_account_my_address_description', esc_html__( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?>
|
||||
<div class="u-columns woocommerce-Addresses col2-set addresses">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ( $get_addresses as $name => $address_title ) : ?>
|
||||
<?php
|
||||
$address = wc_get_account_formatted_address( $name );
|
||||
$col = $col * -1;
|
||||
$oldcol = $oldcol * -1;
|
||||
?>
|
||||
|
||||
<div class="u-column<?php echo $col < 0 ? 1 : 2; ?> col-<?php echo $oldcol < 0 ? 1 : 2; ?> woocommerce-Address">
|
||||
<header class="woocommerce-Address-title title">
|
||||
<h3><?php echo esc_html( $address_title ); ?></h3>
|
||||
<a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', $name ) ); ?>" class="edit"><?php echo $address ? esc_html__( 'Edit', 'woocommerce' ) : esc_html__( 'Add', 'woocommerce' ); ?></a>
|
||||
</header>
|
||||
<address>
|
||||
<?php
|
||||
echo $address ? wp_kses_post( $address ) : esc_html_e( 'You have not set up this type of address yet.', 'woocommerce' );
|
||||
?>
|
||||
</address>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ( ! wc_ship_to_billing_address_only() && wc_shipping_enabled() ) : ?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
52
templates/myaccount/my-downloads.php
Normal file
52
templates/myaccount/my-downloads.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* My Downloads - Deprecated
|
||||
*
|
||||
* Shows downloads on the account page.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 2.0.0
|
||||
* @deprecated 2.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$downloads = WC()->customer->get_downloadable_products();
|
||||
|
||||
if ( $downloads ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_available_downloads' ); ?>
|
||||
|
||||
<h2><?php echo apply_filters( 'woocommerce_my_account_my_downloads_title', esc_html__( 'Available downloads', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
|
||||
|
||||
<ul class="woocommerce-Downloads digital-downloads">
|
||||
<?php foreach ( $downloads as $download ) : ?>
|
||||
<li>
|
||||
<?php
|
||||
do_action( 'woocommerce_available_download_start', $download );
|
||||
|
||||
if ( is_numeric( $download['downloads_remaining'] ) ) {
|
||||
/* translators: %s product name */
|
||||
echo apply_filters( 'woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_available_download_end', $download );
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'woocommerce_after_available_downloads' ); ?>
|
||||
|
||||
<?php endif; ?>
|
95
templates/myaccount/my-orders.php
Normal file
95
templates/myaccount/my-orders.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* My Orders - Deprecated
|
||||
*
|
||||
* @deprecated 2.6.0 this template file is no longer used. My Account shortcode uses orders.php.
|
||||
* @package WooCommerce\Templates
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$my_orders_columns = apply_filters(
|
||||
'woocommerce_my_account_my_orders_columns',
|
||||
array(
|
||||
'order-number' => esc_html__( 'Order', 'woocommerce' ),
|
||||
'order-date' => esc_html__( 'Date', 'woocommerce' ),
|
||||
'order-status' => esc_html__( 'Status', 'woocommerce' ),
|
||||
'order-total' => esc_html__( 'Total', 'woocommerce' ),
|
||||
'order-actions' => ' ',
|
||||
)
|
||||
);
|
||||
|
||||
$customer_orders = get_posts(
|
||||
apply_filters(
|
||||
'woocommerce_my_account_my_orders_query',
|
||||
array(
|
||||
'numberposts' => $order_count,
|
||||
'meta_key' => '_customer_user',
|
||||
'meta_value' => get_current_user_id(),
|
||||
'post_type' => wc_get_order_types( 'view-orders' ),
|
||||
'post_status' => array_keys( wc_get_order_statuses() ),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if ( $customer_orders ) : ?>
|
||||
|
||||
<h2><?php echo apply_filters( 'woocommerce_my_account_my_orders_title', esc_html__( 'Recent orders', 'woocommerce' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
|
||||
|
||||
<table class="shop_table shop_table_responsive my_account_orders">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ( $my_orders_columns as $column_id => $column_name ) : ?>
|
||||
<th class="<?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 as $customer_order ) :
|
||||
$order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
$item_count = $order->get_item_count();
|
||||
?>
|
||||
<tr class="order">
|
||||
<?php foreach ( $my_orders_columns as $column_id => $column_name ) : ?>
|
||||
<td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
|
||||
<?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 ( 'order-number' === $column_id ) : ?>
|
||||
<a href="<?php echo esc_url( $order->get_view_order_url() ); ?>">
|
||||
<?php echo _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</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 */
|
||||
printf( _n( '%1$s for %2$s item', '%1$s for %2$s items', $item_count, 'woocommerce' ), $order->get_formatted_order_total(), $item_count ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
|
||||
<?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
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
35
templates/myaccount/navigation.php
Normal file
35
templates/myaccount/navigation.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* My Account navigation
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/navigation.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 2.6.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_before_account_navigation' );
|
||||
?>
|
||||
|
||||
<nav class="woocommerce-MyAccount-navigation">
|
||||
<ul>
|
||||
<?php foreach ( wc_get_account_menu_items() as $endpoint => $label ) : ?>
|
||||
<li class="<?php echo wc_get_account_menu_item_classes( $endpoint ); ?>">
|
||||
<a href="<?php echo esc_url( wc_get_account_endpoint_url( $endpoint ) ); ?>"><?php echo esc_html( $label ); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<?php do_action( 'woocommerce_after_account_navigation' ); ?>
|
105
templates/myaccount/orders.php
Normal file
105
templates/myaccount/orders.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* Orders
|
||||
*
|
||||
* Shows orders on the account page.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/orders.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.7.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
do_action( 'woocommerce_before_account_orders', $has_orders ); ?>
|
||||
|
||||
<?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 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 ) : ?>
|
||||
<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 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 ( 'order-number' === $column_id ) : ?>
|
||||
<a href="<?php echo esc_url( $order->get_view_order_url() ); ?>">
|
||||
<?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
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="woocommerce-button button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?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" 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" 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="woocommerce-message woocommerce-message--info woocommerce-Message woocommerce-Message--info woocommerce-info">
|
||||
<a class="woocommerce-Button button" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>"><?php esc_html_e( 'Browse products', 'woocommerce' ); ?></a>
|
||||
<?php esc_html_e( 'No order has been made yet.', 'woocommerce' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_account_orders', $has_orders ); ?>
|
78
templates/myaccount/payment-methods.php
Normal file
78
templates/myaccount/payment-methods.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Payment methods
|
||||
*
|
||||
* Shows customer payment methods on the account page.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/payment-methods.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 2.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$saved_methods = wc_get_customer_saved_methods_list( get_current_user_id() );
|
||||
$has_methods = (bool) $saved_methods;
|
||||
$types = wc_get_account_payment_methods_types();
|
||||
|
||||
do_action( 'woocommerce_before_account_payment_methods', $has_methods ); ?>
|
||||
|
||||
<?php if ( $has_methods ) : ?>
|
||||
|
||||
<table class="woocommerce-MyAccount-paymentMethods shop_table shop_table_responsive account-payment-methods-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ( wc_get_account_payment_methods_columns() as $column_id => $column_name ) : ?>
|
||||
<th class="woocommerce-PaymentMethod woocommerce-PaymentMethod--<?php echo esc_attr( $column_id ); ?> payment-method-<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach ( $saved_methods as $type => $methods ) : // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
|
||||
<?php foreach ( $methods as $method ) : ?>
|
||||
<tr class="payment-method<?php echo ! empty( $method['is_default'] ) ? ' default-payment-method' : ''; ?>">
|
||||
<?php foreach ( wc_get_account_payment_methods_columns() as $column_id => $column_name ) : ?>
|
||||
<td class="woocommerce-PaymentMethod woocommerce-PaymentMethod--<?php echo esc_attr( $column_id ); ?> payment-method-<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
|
||||
<?php
|
||||
if ( has_action( 'woocommerce_account_payment_methods_column_' . $column_id ) ) {
|
||||
do_action( 'woocommerce_account_payment_methods_column_' . $column_id, $method );
|
||||
} elseif ( 'method' === $column_id ) {
|
||||
if ( ! empty( $method['method']['last4'] ) ) {
|
||||
/* translators: 1: credit card type 2: last 4 digits */
|
||||
echo sprintf( esc_html__( '%1$s ending in %2$s', 'woocommerce' ), esc_html( wc_get_credit_card_type_label( $method['method']['brand'] ) ), esc_html( $method['method']['last4'] ) );
|
||||
} else {
|
||||
echo esc_html( wc_get_credit_card_type_label( $method['method']['brand'] ) );
|
||||
}
|
||||
} elseif ( 'expires' === $column_id ) {
|
||||
echo esc_html( $method['expires'] );
|
||||
} elseif ( 'actions' === $column_id ) {
|
||||
foreach ( $method['actions'] as $key => $action ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
echo '<a href="' . esc_url( $action['url'] ) . '" class="button ' . sanitize_html_class( $key ) . '">' . esc_html( $action['name'] ) . '</a> ';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p class="woocommerce-Message woocommerce-Message--info woocommerce-info"><?php esc_html_e( 'No saved methods found.', 'woocommerce' ); ?></p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_account_payment_methods', $has_methods ); ?>
|
||||
|
||||
<?php if ( WC()->payment_gateways->get_available_payment_gateways() ) : ?>
|
||||
<a class="button" href="<?php echo esc_url( wc_get_endpoint_url( 'add-payment-method' ) ); ?>"><?php esc_html_e( 'Add payment method', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?>
|
56
templates/myaccount/view-order.php
Normal file
56
templates/myaccount/view-order.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* View Order
|
||||
*
|
||||
* Shows the details of a particular order on the account page.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/view-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://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$notes = $order->get_customer_order_notes();
|
||||
?>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: order number 2: order date 3: order status */
|
||||
esc_html__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ),
|
||||
'<mark class="order-number">' . $order->get_order_number() . '</mark>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php if ( $notes ) : ?>
|
||||
<h2><?php esc_html_e( 'Order updates', 'woocommerce' ); ?></h2>
|
||||
<ol class="woocommerce-OrderUpdates commentlist notes">
|
||||
<?php foreach ( $notes as $note ) : ?>
|
||||
<li class="woocommerce-OrderUpdate comment note">
|
||||
<div class="woocommerce-OrderUpdate-inner comment_container">
|
||||
<div class="woocommerce-OrderUpdate-text comment-text">
|
||||
<p class="woocommerce-OrderUpdate-meta meta"><?php echo date_i18n( esc_html__( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
<div class="woocommerce-OrderUpdate-description description">
|
||||
<?php echo wpautop( wptexturize( $note->comment_content ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_view_order', $order_id ); ?>
|
Reference in New Issue
Block a user