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.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / ecommerce / billing-form-fields.php
tutor / templates / ecommerce Last commit date
billing-form-fields.php 1 week ago billing.php 3 weeks ago cart.php 10 months ago checkout-billing-form-fields.php 3 weeks ago checkout-details.php 3 weeks ago checkout.php 3 weeks ago order-placement-failed.php 9 months ago order-placement-success.php 3 weeks ago
billing-form-fields.php
163 lines
1 <?php
2 /**
3 * Billing Address Form Fields
4 *
5 * @package Tutor\Templates
6 * @author Themeum <support@themeum.com>
7 * @link https://themeum.com
8 * @since 4.0.0
9 *
10 * Received data
11 * - $show_close_button
12 * - $close_action
13 * - $country_options
14 * - $initial_states
15 */
16
17 defined( 'ABSPATH' ) || exit;
18
19 use Tutor\Components\Button;
20 use Tutor\Components\SvgIcon;
21 use Tutor\Components\Constants\Color;
22 use Tutor\Components\Constants\Size;
23 use Tutor\Components\Constants\Variant;
24 use Tutor\Components\Constants\InputType;
25 use Tutor\Components\InputField;
26 use TUTOR\Icon;
27
28 $show_close_button = $show_close_button ?? false;
29 $close_action = $close_action ?? 'editBilling = false';
30 $country_options = $country_options ?? array();
31 $initial_states = $initial_states ?? array();
32 ?>
33
34 <?php if ( $show_close_button ) : ?>
35 <div class="tutor-flex tutor-items-center tutor-justify-between tutor-mb-4">
36 <div class="tutor-flex tutor-items-center tutor-gap-2">
37 <span class="tutor-icon tutor-icon-md tutor-text-primary">
38 <?php
39 SvgIcon::make()
40 ->name( Icon::MAP_PIN )
41 ->color( Color::BRAND )
42 ->size( 20 )
43 ->render();
44 ?>
45 </span>
46 <div class="tutor-medium tutor-mb-none tutor-font-semibold">
47 <?php echo esc_html__( 'Billing Address', 'tutor' ); ?>
48 </div>
49 </div>
50 <?php
51 Button::make()
52 ->variant( Variant::LINK )
53 ->size( Size::SMALL )
54 ->label( __( 'Close', 'tutor' ) )
55 ->attr( 'type', 'button' )
56 ->attr( '@click', "{$close_action}" )
57 ->render();
58 ?>
59 </div>
60 <?php endif; ?>
61
62 <div class="tutor-grid tutor-md-grid-cols-1 tutor-grid-cols-2 tutor-gap-5">
63 <?php
64 InputField::make()
65 ->name( 'billing_first_name' )
66 ->label( __( 'First Name', 'tutor' ) )
67 ->id( 'billing_first_name' )
68 ->required()
69 ->placeholder( __( 'Enter your first name', 'tutor' ) )
70 ->attr( 'x-bind', "register('billing_first_name', { required: true })" )
71 ->render();
72
73 InputField::make()
74 ->name( 'billing_last_name' )
75 ->label( __( 'Last Name', 'tutor' ) )
76 ->id( 'billing_last_name' )
77 ->required()
78 ->placeholder( __( 'Enter your last name', 'tutor' ) )
79 ->attr( 'x-bind', "register('billing_last_name', { required: true })" )
80 ->render();
81 ?>
82 </div>
83
84 <?php
85 InputField::make()
86 ->type( InputType::EMAIL )
87 ->name( 'billing_email' )
88 ->label( __( 'Email Address', 'tutor' ) )
89 ->id( 'billing_email' )
90 ->required()
91 ->placeholder( __( 'Enter your email address', 'tutor' ) )
92 ->attr( 'x-bind', "register('billing_email', { required: true })" )
93 ->render();
94
95 InputField::make()
96 ->name( 'billing_phone' )
97 ->label( __( 'Phone', 'tutor' ) )
98 ->id( 'billing_phone' )
99 ->required()
100 ->placeholder( __( 'Enter your phone number', 'tutor' ) )
101 ->attr( 'x-bind', "register('billing_phone', { required: true })" )
102 ->render();
103
104 InputField::make()
105 ->type( InputType::SELECT )
106 ->name( 'billing_country' )
107 ->label( __( 'Country', 'tutor' ) )
108 ->options( $country_options )
109 ->searchable()
110 ->id( 'billing_country' )
111 ->required()
112 ->placeholder( __( 'Enter your country', 'tutor' ) )
113 ->attr( 'x-bind', "register('billing_country', { required: true })" )
114 ->render();
115
116 InputField::make()
117 ->type( InputType::SELECT )
118 ->name( 'billing_state' )
119 ->label( __( 'State', 'tutor' ) )
120 ->options( $initial_states )
121 ->searchable()
122 ->id( 'billing_state' )
123 ->placeholder( __( 'Enter your state', 'tutor' ) )
124 ->attr( 'x-effect', 'options = (config.stateOptions || {})[values.billing_country] || []' )
125 ->render();
126 ?>
127
128 <!-- City & Postcode Row -->
129 <div class="tutor-grid tutor-md-grid-cols-1 tutor-grid-cols-2 tutor-gap-5">
130 <?php
131 InputField::make()
132 ->name( 'billing_city' )
133 ->label( __( 'City', 'tutor' ) )
134 ->id( 'billing_city' )
135 ->required()
136 ->placeholder( __( 'Enter your city', 'tutor' ) )
137 ->attr( 'x-bind', "register('billing_city', { required: true })" )
138 ->render();
139
140 InputField::make()
141 ->name( 'billing_zip_code' )
142 ->label( __( 'Postcode/ Zip', 'tutor' ) )
143 ->id( 'billing_zip_code' )
144 ->required()
145 ->placeholder( __( 'Enter your postcode/ zip', 'tutor' ) )
146 ->attr( 'x-bind', "register('billing_zip_code', { required: true })" )
147 ->render();
148 ?>
149 </div>
150
151 <!-- Address -->
152 <?php
153 InputField::make()
154 ->type( InputType::TEXTAREA )
155 ->name( 'billing_address' )
156 ->label( __( 'Address', 'tutor' ) )
157 ->id( 'billing_address' )
158 ->required()
159 ->placeholder( __( 'Enter your address', 'tutor' ) )
160 ->attr( 'x-bind', "register('billing_address', { required: true })" )
161 ->render();
162 ?>
163