cart-errors.php
2 years ago
form-billing.php
2 years ago
form-checkout.php
1 year ago
form-coupon.php
1 year ago
form-login.php
11 months ago
form-pay.php
2 years ago
form-shipping.php
2 years ago
form-verify-email.php
1 year ago
order-receipt.php
2 years ago
order-received.php
2 years ago
payment-method.php
2 years ago
payment.php
1 year ago
review-order.php
2 years ago
terms.php
4 years ago
thankyou.php
2 years ago
form-login.php
53 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Checkout login form |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 10.0.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $registration_at_checkout = WC_Checkout::instance()->is_registration_enabled(); |
| 21 | $login_reminder_at_checkout = 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ); |
| 22 | |
| 23 | if ( is_user_logged_in() ) { |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | if ( $login_reminder_at_checkout ) : ?> |
| 28 | <div class="woocommerce-form-login-toggle"> |
| 29 | <?php |
| 30 | wc_print_notice( |
| 31 | apply_filters( 'woocommerce_checkout_login_message', esc_html__( 'Returning customer?', 'woocommerce' ) ) . // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment |
| 32 | ' <a href="#" class="showlogin">' . esc_html__( 'Click here to login', 'woocommerce' ) . '</a>', |
| 33 | 'notice' |
| 34 | ); |
| 35 | ?> |
| 36 | </div> |
| 37 | <?php |
| 38 | endif; |
| 39 | |
| 40 | if ( $registration_at_checkout || $login_reminder_at_checkout ) : |
| 41 | |
| 42 | // Always show the form after a login attempt. |
| 43 | $show_form = isset( $_POST['login'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 44 | |
| 45 | woocommerce_login_form( |
| 46 | array( |
| 47 | 'message' => esc_html__( 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'woocommerce' ), |
| 48 | 'redirect' => wc_get_checkout_url(), |
| 49 | 'hidden' => ! $show_form, |
| 50 | ) |
| 51 | ); |
| 52 | endif; |
| 53 |