PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.3.0
ShopBuilder – WooCommerce Builder For Elementor v3.3.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Modules / CheckoutEditor / CheckoutFns.php

CheckoutFns.php in ShopBuilder – WooCommerce Builder For Elementor 3.3.0, at app/Modules/CheckoutEditor/CheckoutFns.php

193 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace RadiusTheme\SB\Modules\CheckoutEditor;
3
4 // Do not allow directly accessing this file.
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit( 'This script cannot be accessed directly.' );
7 }
8 /**
9 * CheckoutEditorInit
10 */
11 class CheckoutFns {
12 /**
13 * Checkout Billing Field.
14 *
15 * @return array[]
16 */
17 public static function default_billing_fields() {
18 return [
19 [
20 'id' => 1,
21 'deletable' => 'no',
22 'isEnable' => 'on',
23 'label' => esc_html__( 'First Name', 'shopbuilder' ),
24 'type' => 'text',
25 'options' => [],
26 'name' => 'first_name',
27 'validation' => 'default',
28 'placeholder' => esc_html__( 'Enter your first name.', 'shopbuilder' ),
29 'isRequired' => 'on',
30 'default' => '',
31 'custom_class' => 'form-row-first',
32 ],
33 [
34 'id' => 2,
35 'deletable' => 'no',
36 'isEnable' => 'on',
37 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
38 'type' => 'text',
39 'options' => [],
40 'name' => 'last_name',
41 'isRequired' => 'on',
42 'placeholder' => esc_html__( 'Last Name', 'shopbuilder' ),
43 'default' => '',
44 'validation' => 'default',
45 'custom_class' => 'form-row-last',
46 ],
47 [
48 'id' => 3,
49 'deletable' => 'no',
50 'label' => esc_html__( 'Company Name', 'shopbuilder' ),
51 'placeholder' => '',
52 'type' => 'text',
53 'options' => [],
54 'isEnable' => 'on',
55 'name' => 'company',
56 'custom_class' => 'form-row-wide',
57 ],
58 [
59 'id' => 4,
60 'deletable' => 'no',
61 'label' => esc_html__( 'Country', 'shopbuilder' ),
62 'name' => 'country',
63 'placeholder' => '',
64 'type' => 'text',
65 'options' => [],
66 'isEnable' => 'on',
67 'custom_class' => 'form-row-wide,address-field,update_totals_on_change',
68 ],
69 [
70 'id' => 5,
71 'deletable' => 'no',
72 'label' => esc_html__( 'Street address', 'shopbuilder' ),
73 'type' => 'text',
74 'placeholder' => esc_html__( 'House number and street name', 'shopbuilder' ),
75 'options' => [],
76 'name' => 'address_1',
77 'custom_class' => 'form-row-wide,address-field',
78 'isEnable' => 'on',
79 ],
80 [
81 'id' => 6,
82 'deletable' => 'no',
83 'label' => esc_html__( 'Apartment Address', 'shopbuilder' ),
84 'placeholder' => esc_html__( 'Apartment, suite, unit, etc. (optional)', 'shopbuilder' ),
85 'custom_class' => 'form-row-wide,address-field',
86 'type' => 'text',
87 'options' => [],
88 'isEnable' => 'on',
89 'name' => 'address_2',
90 ],
91 [
92 'id' => 7,
93 'deletable' => 'no',
94 'label' => esc_html__( 'City / Town', 'shopbuilder' ),
95 'type' => 'text',
96 'placeholder' => '',
97 'options' => [],
98 'isEnable' => 'on',
99 'name' => 'city',
100 'validation' => 'default',
101 'isRequired' => 'on',
102 'custom_class' => 'form-row-wide,address-field',
103 ],
104 [
105 'id' => 8,
106 'isEnable' => 'on',
107 'deletable' => 'no',
108 'label' => esc_html__( 'State/Country', 'shopbuilder' ),
109 'type' => 'text',
110 'placeholder' => '',
111 'options' => [],
112 'name' => 'state',
113 'validation' => 'state',
114 'custom_class' => 'form-row-wide,address-field',
115 ],
116 [
117 'id' => 9,
118 'deletable' => 'no',
119 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
120 'type' => 'text',
121 'placeholder' => '',
122 'options' => [],
123 'isEnable' => 'on',
124 'name' => 'postcode',
125 'validation' => 'postcode',
126 'isRequired' => 'on',
127 'custom_class' => 'form-row-wide,address-field',
128 ],
129 [
130 'id' => 10,
131 'deletable' => 'no',
132 'label' => esc_html__( 'Phone', 'shopbuilder' ),
133 'placeholder' => '',
134 'type' => 'text',
135 'options' => [],
136 'isEnable' => 'on',
137 'name' => 'phone',
138 'validation' => 'phone',
139 'isRequired' => 'on',
140 'custom_class' => 'form-row-wide',
141 ],
142 [
143 'id' => 11,
144 'deletable' => 'no',
145 'label' => esc_html__( 'Email Address', 'shopbuilder' ),
146 'placeholder' => '',
147 'type' => 'text',
148 'options' => [],
149 'isEnable' => 'on',
150 'name' => 'email',
151 'validation' => 'email',
152 'isRequired' => 'on',
153 'custom_class' => 'form-row-wide',
154 ],
155 ];
156 }
157
158 /**
159 * Checkout Shipping Field.
160 *
161 * @return array[]
162 */
163 public static function default_shipping_fields() {
164 $fields = self::default_billing_fields();
165 array_splice( $fields, -2 );
166 return $fields;
167 }
168
169 /**
170 * Checkout Additional Field.
171 *
172 * @return array[]
173 */
174 public static function checkout_additional_fields() {
175 return [
176 [
177 'id' => 1,
178 'deletable' => 'no',
179 'isEnable' => 'on',
180 'label' => esc_html__( 'Order Note', 'shopbuilder' ),
181 'type' => 'textarea',
182 'options' => [],
183 'name' => 'comments',
184 'validation' => 'default',
185 'placeholder' => '',
186 'isRequired' => '',
187 'default' => '',
188 'custom_class' => '',
189 ],
190 ];
191 }
192 }
193