_customer.php
50 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; // Exit if accessed directly |
| 4 | } |
| 5 | ?> |
| 6 | <div class="os-step-tabs-w"> |
| 7 | <?php if (OsAuthHelper::is_customer_auth_enabled()) { ?> |
| 8 | <div class="os-step-tabs"> |
| 9 | <div class="os-step-tab active" |
| 10 | data-auth-action="register" |
| 11 | data-target=".os-step-new-customer-w"><?php esc_html_e('New Customer', 'latepoint'); ?></div> |
| 12 | <div class="os-step-tab" |
| 13 | data-auth-action="login" |
| 14 | data-target=".os-step-existing-customer-login-w"><?php esc_html_e('Already have an account?', 'latepoint'); ?></div> |
| 15 | </div> |
| 16 | <?php } ?> |
| 17 | <div class="os-step-tab-content os-step-new-customer-w"> |
| 18 | <div class="os-row"> |
| 19 | <?php if ($default_fields_for_customer['first_name']['active']) echo OsFormHelper::text_field('customer[first_name]', __('First Name', 'latepoint'), $customer->first_name, array('validate' => $customer->get_validations_for_property('first_name'), 'class' => $default_fields_for_customer['first_name']['required'] ? 'required' : ''), array('class' => $default_fields_for_customer['first_name']['width'])); ?> |
| 20 | <?php if ($default_fields_for_customer['last_name']['active']) echo OsFormHelper::text_field('customer[last_name]', __('Last Name', 'latepoint'), $customer->last_name, array('validate' => $customer->get_validations_for_property('last_name'), 'class' => $default_fields_for_customer['last_name']['required'] ? 'required' : ''), array('class' => $default_fields_for_customer['last_name']['width'])); ?> |
| 21 | <?php if ($default_fields_for_customer['phone']['active']) echo OsFormHelper::phone_number_field('customer[phone]', __('Phone Number', 'latepoint'), $customer->phone, array('validate' => $customer->get_validations_for_property('phone'), 'class' => $default_fields_for_customer['phone']['required'] ? 'required' : ''), array('class' => $default_fields_for_customer['phone']['width'] . ' os-col-sm-12')); ?> |
| 22 | <?php echo OsFormHelper::text_field('customer[email]', __('Email Address', 'latepoint'), $customer->email, array('validate' => $customer->get_validations_for_property('email'), 'class' => 'required'), array('class' => $default_fields_for_customer['email']['width'] . ' os-col-sm-12')); ?> |
| 23 | <?php if (OsSettingsHelper::is_on('steps_require_setting_password') && !OsAuthHelper::is_customer_logged_in() && ($customer->is_new_record() || $customer->is_guest)) { |
| 24 | echo OsFormHelper::password_field('customer[password]', __('Password', 'latepoint'), '', array('class' => 'required'), array('class' => 'os-col-6')); |
| 25 | echo OsFormHelper::password_field('customer[password_confirmation]', __('Confirm Password', 'latepoint'), '', array('class' => 'required'), array('class' => 'os-col-6')); |
| 26 | } ?> |
| 27 | <?php if ($default_fields_for_customer['notes']['active']) echo OsFormHelper::textarea_field('customer[notes]', __('Add Comments', 'latepoint'), $customer->notes, array('validate' => $customer->get_validations_for_property('notes'), 'class' => $default_fields_for_customer['notes']['required'] ? 'required' : ''), array('class' => $default_fields_for_customer['notes']['width'])); ?> |
| 28 | <?php do_action('latepoint_booking_steps_contact_after', $customer, $booking); ?> |
| 29 | </div> |
| 30 | </div> |
| 31 | <?php if (OsAuthHelper::is_customer_auth_enabled()) { ?> |
| 32 | <div class="os-step-tab-content os-step-existing-customer-login-w" style="display: none;"> |
| 33 | <div class="os-row"> |
| 34 | <?php echo OsFormHelper::text_field('auth[email]', __('Your Email Address', 'latepoint'), '', array('class' => 'required'), array('class' => 'os-col-12')); ?> |
| 35 | <?php echo OsFormHelper::password_field('auth[password]', __('Your Password', 'latepoint'), '', array('class' => 'required'), array('class' => 'os-col-12')); ?> |
| 36 | </div> |
| 37 | <div class="os-form-buttons os-flex os-space-between"> |
| 38 | <a href="#" class="latepoint-btn latepoint-btn-primary latepoint-btn-link step-forgot-password-btn" |
| 39 | data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('customer_cabinet', 'request_password_reset_token')); ?>" |
| 40 | data-os-output-target=".os-password-reset-form-holder" |
| 41 | data-os-after-call="latepoint_reset_password_from_booking_init" |
| 42 | data-os-params="<?php echo esc_attr(OsUtilHelper::build_os_params(['from_booking' => true])); ?>"><?php esc_html_e('Forgot Password?', 'latepoint'); ?></a> |
| 43 | <a data-btn-action="<?php echo esc_attr(OsRouterHelper::build_route_name('auth', 'login_customer')); ?>" href="#" |
| 44 | class="latepoint-btn latepoint-btn-primary step-login-existing-customer-btn"><?php esc_html_e('Sign in', 'latepoint'); ?></a> |
| 45 | </div> |
| 46 | </div> |
| 47 | <div class="os-password-reset-form-holder"></div> |
| 48 | <?php } ?> |
| 49 | </div> |
| 50 | <?php do_action('latepoint_after_customer_login_form'); ?> |