PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.2
ShopBuilder – WooCommerce Builder For Elementor v2.1.2
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 / Models / GeneralList.php

GeneralList.php in ShopBuilder – WooCommerce Builder For Elementor 2.1.2, at app/Models/GeneralList.php

1,353 lines 45.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\Models;
4
5 // use RadiusTheme\SB\Helpers\Fns;
6 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
7 use RadiusTheme\SB\Helpers\Fns;
8 use RadiusTheme\SB\Models\Base\ListModel;
9 use RadiusTheme\SB\Traits\SingletonTrait;
10
11 defined( 'ABSPATH' ) || exit;
12
13 /**
14 * General Settings.
15 */
16 class GeneralList extends ListModel {
17 /**
18 * Singleton
19 */
20 use SingletonTrait;
21
22 /**
23 * List Id
24 *
25 * @var string
26 */
27 protected $list_id = 'general';
28
29 /**
30 * Constructor
31 */
32 public function __construct() {
33 parent::__construct();
34 $this->title = esc_html__( 'Global Settings', 'shopbuilder' );
35 $this->description = esc_html__( 'ShopBuilder global settings for various elements.', 'shopbuilder' );
36 $this->categories = [
37 'general' => [
38 'title' => esc_html__( 'General', 'shopbuilder' ),
39 ],
40
41 'checkout' => [
42 'title' => esc_html__( 'Checkout Page', 'shopbuilder' ),
43 ],
44
45 ];
46 }
47
48 /**
49 * Package
50 *
51 * @return array
52 */
53 protected function raw_list() {
54 $list = [
55 'notification' => apply_filters(
56 'rtsb/settings/notification/options',
57 [
58 'id' => 'notification',
59 'category' => 'general',
60 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ),
61 'package' => 'free',
62 'active_field' => [
63 'disable' => true,
64 ],
65 'fields' => [
66 'notification_position' => [
67 'id' => 'notification_position',
68 'value' => 'center-center',
69 'type' => 'select',
70 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
71 'options' => [
72 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
73 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
74 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
75 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
76 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
77 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
78 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
79 ],
80 ],
81 'notification_color' => [
82 'id' => 'notification_color',
83 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
84 'type' => 'color',
85 'tab' => 'floating_button',
86 ],
87 'notification_btn_color' => [
88 'id' => 'notification_color',
89 'label' => esc_html__( 'Button Color', 'shopbuilder' ),
90 'type' => 'color',
91 'tab' => 'floating_button',
92 ],
93 'notification_bg' => [
94 'id' => 'notification_bg',
95 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
96 'type' => 'color',
97 'tab' => 'floating_button',
98 ],
99 'hide_notification' => [
100 'id' => 'hide_notification',
101 'type' => 'switch',
102 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ),
103 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ),
104 ],
105 ],
106 ],
107 ),
108 'social_share' => apply_filters(
109 'rtsb/settings/social_share/options',
110 [
111 'id' => 'social_share',
112 'category' => 'general',
113 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
114 'package' => 'free',
115 'active_field' => [
116 'disable' => true,
117 ],
118 'fields' => [
119 'share_platforms' => [
120 'id' => 'share_platforms',
121 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
122 'type' => 'checkbox',
123 'orientation' => 'vertical',
124 'value' => [ 'facebook', 'twitter', 'linkedin' ],
125 'options' => Fns::social_share_platforms_list(),
126 ],
127 'share_platforms_to_product_page' => [
128 'id' => 'share_platforms_to_product_page',
129 'type' => 'switch',
130 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
131 'help' => esc_html__( 'Enable this option to allow share a product from product page. Woocommerce Supported Sharing plugins added to Hook: woocommerce_share', 'shopbuilder' ),
132 ],
133 /*
134 * TODO : Implement later.
135 'share_icon_show_to_product_page' => array(
136 'id' => 'share_icon_show_to_product_page',
137 'type' => 'switch',
138 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
139 'dependency' => [
140 'rules' => [
141 [
142 'item' => 'general.social_share.share_platforms_to_product_page',
143 'value' => 'on',
144 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
145 ],
146 ],
147 ],
148 ),
149 */
150 'share_icon_layout' => [
151 'type' => 'select',
152 'value' => 'share-layout1',
153 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
154 'options' => [
155 'share-layout1' => esc_html__( 'Layout 1', 'shopbuilder' ),
156 'share-layout2' => esc_html__( 'Layout 2', 'shopbuilder' ),
157 ],
158 'dependency' => [
159 'rules' => [
160 [
161 'item' => 'general.social_share.share_platforms_to_product_page',
162 'value' => 'on',
163 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
164 ],
165 ],
166 ],
167 ],
168 ],
169 ],
170 ),
171 'tooltip' => apply_filters(
172 'rtsb/settings/tooltip/options',
173 [
174 'id' => 'tooltip',
175 'category' => 'general',
176 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
177 'package' => $this->pro_package(),
178 'active_field' => [
179 'disable' => true,
180 ],
181 ],
182 ),
183 'billing_form' => apply_filters(
184 'rtsb/settings/billing_form/options',
185 [
186 'id' => 'billing_form',
187 'category' => 'checkout',
188 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
189 'package' => 'free',
190 'active_field' => [
191 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
192 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
193 ],
194 'fields' => [
195 'billing_first_name_heading' => [
196 'id' => 'billing_first_name_heading',
197 'type' => 'title',
198 'label' => esc_html__( 'First Name', 'shopbuilder' ),
199 // 'tab' => 'name',
200 ],
201 'billing_first_name' => [
202 'id' => 'billing_first_name',
203 'label' => esc_html__( 'First name', 'shopbuilder' ),
204 'type' => 'checkbox',
205 'orientation' => 'vertical',
206 'value' => [ 'show', 'required' ],
207 'options' => [
208 [
209 'value' => 'show',
210 'label' => 'Show First name?',
211 ],
212 [
213 'value' => 'required',
214 'label' => 'Required Field',
215 ],
216 ],
217 // 'tab' => 'name',
218 ],
219 'billing_first_name_label' => [
220 'id' => 'billing_first_name_label',
221 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
222 'type' => 'text',
223 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
224 // 'tab' => 'name',
225 'dependency' => [
226 'rules' => [
227 [
228 'item' => 'general.billing_form.billing_first_name',
229 'value' => 'show',
230 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
231 ],
232 ],
233 ],
234 ],
235 'billing_first_name_placeholder' => [
236 'id' => 'billing_first_name_placeholder',
237 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
238 'type' => 'text',
239 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
240 // 'tab' => 'name',
241 'dependency' => [
242 'rules' => [
243 [
244 'item' => 'general.billing_form.billing_first_name',
245 'value' => 'show',
246 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
247 ],
248 ],
249 ],
250 ],
251
252 'billing_last_name_heading' => [
253 'id' => 'billing_last_name_heading',
254 'type' => 'title',
255 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
256 // 'tab' => 'name',
257 ],
258 'billing_last_name' => [
259 'id' => 'billing_last_name',
260 'label' => esc_html__( 'Last name', 'shopbuilder' ),
261 'type' => 'checkbox',
262 'orientation' => 'vertical',
263 'value' => [ 'show', 'required' ],
264 'options' => [
265 [
266 'value' => 'show',
267 'label' => 'Show Last name?',
268 ],
269 [
270 'value' => 'required',
271 'label' => 'Required Field',
272 ],
273 ],
274 // 'tab' => 'name',
275 ],
276
277 'billing_last_name_label' => [
278 'id' => 'billing_last_name_label',
279 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
280 'type' => 'text',
281 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
282 // 'tab' => 'name',
283 'dependency' => [
284 'rules' => [
285 [
286 'item' => 'general.billing_form.billing_last_name',
287 'value' => 'show',
288 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
289 ],
290 ],
291 ],
292 ],
293 'billing_last_name_placeholder' => [
294 'id' => 'billing_last_name_placeholder',
295 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
296 'type' => 'text',
297 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
298 // 'tab' => 'name',
299 'dependency' => [
300 'rules' => [
301 [
302 'item' => 'general.billing_form.billing_last_name',
303 'value' => 'show',
304 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
305 ],
306 ],
307 ],
308 ],
309
310 'billing_company_heading' => [
311 'id' => 'billing_company_heading',
312 'type' => 'title',
313 'label' => esc_html__( 'Company', 'shopbuilder' ),
314 // 'tab' => 'company',
315 ],
316 'billing_company' => [
317 'id' => 'billing_company',
318 'label' => esc_html__( 'Company name', 'shopbuilder' ),
319 'type' => 'checkbox',
320 'orientation' => 'vertical',
321 'value' => [
322 'show',
323 'required' === get_option( 'woocommerce_checkout_company_field', 'optional' ) ? 'required' : 'optional',
324 ],
325 'options' => [
326 [
327 'value' => 'show',
328 'label' => 'Show company name?',
329 ],
330 [
331 'value' => 'required',
332 'label' => 'Required Field',
333 ],
334 ],
335 // 'tab' => 'company',
336 ],
337
338 'billing_company_label' => [
339 'id' => 'billing_company_label',
340 'label' => esc_html__( 'Company label', 'shopbuilder' ),
341 'type' => 'text',
342 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
343 // 'tab' => 'company',
344 'dependency' => [
345 'rules' => [
346 [
347 'item' => 'general.billing_form.billing_company',
348 'value' => 'show',
349 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
350 ],
351 ],
352 ],
353 ],
354 'billing_company_placeholder' => [
355 'id' => 'billing_company_placeholder',
356 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
357 'type' => 'text',
358 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
359 // 'tab' => 'company',
360 'dependency' => [
361 'rules' => [
362 [
363 'item' => 'general.billing_form.billing_company',
364 'value' => 'show',
365 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
366 ],
367 ],
368 ],
369 ],
370
371 'billing_country_heading' => [
372 'id' => 'billing_country_heading',
373 'type' => 'title',
374 'label' => esc_html__( 'Country', 'shopbuilder' ),
375 // 'tab' => 'country',
376 ],
377 'billing_country' => [
378 'id' => 'billing_country',
379 'label' => esc_html__( 'Country', 'shopbuilder' ),
380 'type' => 'checkbox',
381 'orientation' => 'vertical',
382 'value' => [ 'show', 'required' ],
383 // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
384 'options' => [
385 [
386 'value' => 'show',
387 'label' => 'Show Country?',
388 // 'disabled' => true,
389 ],
390 [
391 'value' => 'required',
392 'label' => 'Required Field',
393 // 'disabled' => true,
394 ],
395 ],
396 // 'tab' => 'country',
397 ],
398
399 'billing_country_label' => [
400 'id' => 'billing_country_label',
401 'label' => esc_html__( 'Country label', 'shopbuilder' ),
402 'type' => 'text',
403 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
404 // 'tab' => 'country',
405 'dependency' => [
406 'rules' => [
407 [
408 'item' => 'general.billing_form.billing_country',
409 'value' => 'show',
410 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
411 ],
412 ],
413 ],
414 ],
415 'billing_address_1_heading' => [
416 'id' => 'billing_address_1_heading',
417 'type' => 'title',
418 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
419 // 'tab' => 'address',
420 ],
421 'billing_address_1' => [
422 'id' => 'billing_address_1',
423 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
424 'type' => 'checkbox',
425 'orientation' => 'vertical',
426 'value' => [ 'show', 'required' ],
427 'options' => [
428 [
429 'value' => 'show',
430 'label' => 'Show Address field?',
431 ],
432 [
433 'value' => 'required',
434 'label' => 'Required Field',
435 ],
436 ],
437 // 'tab' => 'address',
438 ],
439
440 'billing_address_1_label' => [
441 'id' => 'billing_address_1_label',
442 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
443 'type' => 'text',
444 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
445 // 'tab' => 'address',
446 'dependency' => [
447 'rules' => [
448 [
449 'item' => 'general.billing_form.billing_address_1',
450 'value' => 'show',
451 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
452 ],
453 ],
454 ],
455 ],
456 'billing_address_1_placeholder' => [
457 'id' => 'billing_address_1_placeholder',
458 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
459 'type' => 'text',
460 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
461 // 'tab' => 'address',
462 'dependency' => [
463 'rules' => [
464 [
465 'item' => 'general.billing_form.billing_address_1',
466 'value' => 'show',
467 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
468 ],
469 ],
470 ],
471 ],
472 'billing_address_2_heading' => [
473 'id' => 'billing_address_2_heading',
474 'type' => 'title',
475 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
476 // 'tab' => 'address',
477 'dependency' => [
478 'rules' => [
479 [
480 'item' => 'general.billing_form.billing_address_1',
481 'value' => 'show',
482 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
483 ],
484 ],
485 ],
486 ],
487 'billing_address_2' => [
488 'id' => 'billing_address_2',
489 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
490 'type' => 'checkbox',
491 'orientation' => 'vertical',
492 // 'tab' => 'address',
493 'value' => [
494 'show',
495 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
496 ],
497 'options' => [
498 [
499 'value' => 'show',
500 'label' => 'Show Address field?',
501 ],
502 ],
503 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
504 'dependency' => [
505 'rules' => [
506 [
507 'item' => 'general.billing_form.billing_address_1',
508 'value' => 'show',
509 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
510 ],
511 ],
512 ],
513 ],
514
515 'billing_address_2_label' => [
516 'id' => 'billing_address_2_label',
517 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
518 'type' => 'text',
519 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
520 // 'tab' => 'address',
521 'dependency' => [
522 'rules' => [
523 [
524 'item' => 'general.billing_form.billing_address_1',
525 'value' => 'show',
526 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
527 ],
528 [
529 'item' => 'general.billing_form.billing_address_2',
530 'value' => 'show',
531 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
532 ],
533 ],
534 ],
535 ],
536 'billing_address_2_placeholder' => [
537 'id' => 'billing_address_2_placeholder',
538 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
539 'type' => 'text',
540 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
541 // 'tab' => 'address',
542 'dependency' => [
543 'rules' => [
544 [
545 'item' => 'general.billing_form.billing_address_1',
546 'value' => 'show',
547 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
548 ],
549 [
550 'item' => 'general.billing_form.billing_address_2',
551 'value' => 'show',
552 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
553 ],
554 ],
555 ],
556 ],
557 'billing_city_heading' => [
558 'id' => 'billing_city_heading',
559 'type' => 'title',
560 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
561 // 'tab' => 'city',
562 ],
563 'billing_city' => [
564 'id' => 'billing_city',
565 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
566 'type' => 'checkbox',
567 'orientation' => 'vertical',
568 'value' => [ 'show', 'required' ],
569 // 'tab' => 'city',
570 'options' => [
571 [
572 'value' => 'show',
573 'label' => 'Show Town / City?',
574 ],
575 [
576 'value' => 'required',
577 'label' => 'Required Field',
578 ],
579 ],
580
581 ],
582 'billing_city_label' => [
583 'id' => 'billing_city_label',
584 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
585 'type' => 'text',
586 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
587 // 'tab' => 'city',
588 'dependency' => [
589 'rules' => [
590 [
591 'item' => 'general.billing_form.billing_city',
592 'value' => 'show',
593 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
594 ],
595 ],
596 ],
597 ],
598 'billing_city_placeholder' => [
599 'id' => 'billing_city_placeholder',
600 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
601 'type' => 'text',
602 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
603 // 'tab' => 'city',
604 'dependency' => [
605 'rules' => [
606 [
607 'item' => 'general.billing_form.billing_city',
608 'value' => 'show',
609 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
610 ],
611 ],
612 ],
613 ],
614 'billing_state_heading' => [
615 'id' => 'billing_city_heading',
616 'type' => 'title',
617 'label' => esc_html__( 'State', 'shopbuilder' ),
618 // 'tab' => 'state',
619 ],
620 'billing_state' => [
621 'id' => 'billing_state',
622 'label' => esc_html__( 'State', 'shopbuilder' ),
623 'type' => 'checkbox',
624 'orientation' => 'vertical',
625 'value' => [ 'show', 'required' ],
626 'options' => [
627 [
628 'value' => 'show',
629 'label' => 'Show State?',
630 ],
631 [
632 'value' => 'required',
633 'label' => 'Required Field',
634 ],
635 ],
636 // 'tab' => 'state',
637 ],
638
639 'billing_state_label' => [
640 'id' => 'billing_state_label',
641 'label' => esc_html__( 'State label', 'shopbuilder' ),
642 'type' => 'text',
643 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
644 // 'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
645 // 'tab' => 'state',
646 'dependency' => [
647 'rules' => [
648 [
649 'item' => 'general.billing_form.billing_state',
650 'value' => 'show',
651 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
652 ],
653 ],
654 ],
655 ],
656 'billing_postcode_heading' => [
657 'id' => 'billing_postcode_heading',
658 'type' => 'title',
659 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
660 // 'tab' => 'postcode',
661 ],
662 'billing_postcode' => [
663 'id' => 'billing_postcode',
664 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
665 'type' => 'checkbox',
666 'orientation' => 'vertical',
667 'value' => [ 'show', 'required' ],
668 'options' => [
669 [
670 'value' => 'show',
671 'label' => 'Show Postcode / ZIP?',
672 ],
673 [
674 'value' => 'required',
675 'label' => 'Required Field',
676 ],
677 ],
678 // 'tab' => 'postcode',
679 ],
680 'billing_postcode_label' => [
681 'id' => 'billing_postcode_label',
682 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
683 'type' => 'text',
684 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
685 // 'tab' => 'postcode',
686 'dependency' => [
687 'rules' => [
688 [
689 'item' => 'general.billing_form.billing_postcode',
690 'value' => 'show',
691 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
692 ],
693 ],
694 ],
695 ],
696 'billing_postcode_placeholder' => [
697 'id' => 'billing_postcode_placeholder',
698 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
699 'type' => 'text',
700 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
701 // 'tab' => 'postcode',
702 'dependency' => [
703 'rules' => [
704 [
705 'item' => 'general.billing_form.billing_postcode',
706 'value' => 'show',
707 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
708 ],
709 ],
710 ],
711 ],
712 'billing_phone_heading' => [
713 'id' => 'billing_phone_heading',
714 'type' => 'title',
715 'label' => esc_html__( 'Phone', 'shopbuilder' ),
716 // 'tab' => 'phone',
717 ],
718 'billing_phone' => [
719 'id' => 'billing_phone',
720 'label' => esc_html__( 'Phone', 'shopbuilder' ),
721 'type' => 'checkbox',
722 'orientation' => 'vertical',
723 // 'tab' => 'phone',
724 'value' => [
725 'show',
726 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
727 ],
728 'options' => [
729 [
730 'value' => 'show',
731 'label' => 'Show Phone Field?',
732 ],
733 [
734 'value' => 'required',
735 'label' => 'Required Field',
736 ],
737 ],
738
739 ],
740 'billing_phone_label' => [
741 'id' => 'billing_phone_label',
742 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
743 'type' => 'text',
744 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
745 // 'tab' => 'phone',
746 'dependency' => [
747 'rules' => [
748 [
749 'item' => 'general.billing_form.billing_phone',
750 'value' => 'show',
751 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
752 ],
753 ],
754 ],
755 ],
756 'billing_phone_placeholder' => [
757 'id' => 'billing_phone_placeholder',
758 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
759 'type' => 'text',
760 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
761 // 'tab' => 'phone',
762 'dependency' => [
763 'rules' => [
764 [
765 'item' => 'general.billing_form.billing_phone',
766 'value' => 'show',
767 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
768 ],
769 ],
770 ],
771 ],
772 'billing_email_heading' => [
773 'id' => 'billing_email_heading',
774 'type' => 'title',
775 'label' => esc_html__( 'Email', 'shopbuilder' ),
776 // 'tab' => 'email',
777 ],
778 'billing_email' => [
779 'id' => 'billing_email',
780 'label' => esc_html__( 'Email address', 'shopbuilder' ),
781 'type' => 'checkbox',
782 'orientation' => 'vertical',
783 // 'tab' => 'email',
784 'value' => [ 'show', 'required' ],
785 'options' => [
786 [
787 'value' => 'show',
788 'label' => 'Show Email address Field?',
789 ],
790 [
791 'value' => 'required',
792 'label' => 'Required Field',
793 ],
794 ],
795 ],
796 'billing_email_label' => [
797 'id' => 'billing_email_label',
798 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
799 'type' => 'text',
800 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
801 // 'tab' => 'email',
802 'dependency' => [
803 'rules' => [
804 [
805 'item' => 'general.billing_form.billing_email',
806 'value' => 'show',
807 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
808 ],
809 ],
810 ],
811 ],
812 'billing_email_placeholder' => [
813 'id' => 'billing_email_placeholder',
814 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
815 'type' => 'text',
816 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
817 // 'tab' => 'email',
818 'dependency' => [
819 'rules' => [
820 [
821 'item' => 'general.billing_form.billing_email',
822 'value' => 'show',
823 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
824 ],
825 ],
826 ],
827 ],
828 ],
829
830 ]
831 ),
832 'shipping_form' => apply_filters(
833 'rtsb/module/shipping_form/options',
834 [
835 'id' => 'shipping_form',
836 'category' => 'checkout',
837 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
838 'package' => 'free',
839 'active_field' => [
840 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
841 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
842 ],
843 'fields' => [
844 'shipping_first_name_heading' => [
845 'id' => 'shipping_first_name_heading',
846 'type' => 'title',
847 'label' => esc_html__( 'First Name', 'shopbuilder' ),
848 // 'tab' => 'name',
849 ],
850 'shipping_first_name' => [
851 'id' => 'shipping_first_name',
852 'label' => esc_html__( 'First name', 'shopbuilder' ),
853 'type' => 'checkbox',
854 'orientation' => 'vertical',
855 'value' => [ 'show', 'required' ],
856 'options' => [
857 [
858 'value' => 'show',
859 'label' => 'Show First name?',
860 ],
861 [
862 'value' => 'required',
863 'label' => 'Required Field',
864 ],
865 ],
866 // 'tab' => 'name',
867 ],
868 'shipping_first_name_label' => [
869 'id' => 'shipping_first_name_label',
870 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
871 'type' => 'text',
872 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
873 // 'tab' => 'name',
874 'dependency' => [
875 'rules' => [
876 [
877 'item' => 'general.shipping_form.shipping_first_name',
878 'value' => 'show',
879 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
880 ],
881 ],
882 ],
883 ],
884 'shipping_first_name_placeholder' => [
885 'id' => 'shipping_first_name_placeholder',
886 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
887 'type' => 'text',
888 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
889 // 'tab' => 'country',
890 'dependency' => [
891 'rules' => [
892 [
893 'item' => 'general.shipping_form.shipping_first_name',
894 'value' => 'show',
895 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
896 ],
897 ],
898 ],
899 ],
900 'shipping_first_last_heading' => [
901 'id' => 'shipping_first_last_heading',
902 'type' => 'title',
903 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
904 // 'tab' => 'name',
905 ],
906 'shipping_last_name' => [
907 'id' => 'shipping_last_name',
908 'label' => esc_html__( 'Last name', 'shopbuilder' ),
909 'type' => 'checkbox',
910 'orientation' => 'vertical',
911 'value' => [ 'show', 'required' ],
912 'options' => [
913 [
914 'value' => 'show',
915 'label' => 'Show Last name?',
916 ],
917 [
918 'value' => 'required',
919 'label' => 'Required Field',
920 ],
921 ],
922 // 'tab' => 'name',
923 ],
924
925 'shipping_last_name_label' => [
926 'id' => 'shipping_last_name_label',
927 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
928 'type' => 'text',
929 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
930 // 'tab' => 'name',
931 'dependency' => [
932 'rules' => [
933 [
934 'item' => 'general.shipping_form.shipping_last_name',
935 'value' => 'show',
936 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
937 ],
938 ],
939 ],
940 ],
941 'shipping_last_name_placeholder' => [
942 'id' => 'shipping_last_name_placeholder',
943 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
944 'type' => 'text',
945 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
946 // 'tab' => 'country',
947 'dependency' => [
948 'rules' => [
949 [
950 'item' => 'general.shipping_form.shipping_last_name',
951 'value' => 'show',
952 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
953 ],
954 ],
955 ],
956 ],
957 'shipping_company_heading' => [
958 'id' => 'shipping_company_heading',
959 'type' => 'title',
960 'label' => esc_html__( 'Company', 'shopbuilder' ),
961 // 'tab' => 'name',
962 ],
963 'shipping_company' => [
964 'id' => 'shipping_company',
965 'label' => esc_html__( 'Company name', 'shopbuilder' ),
966 'type' => 'checkbox',
967 'orientation' => 'vertical',
968 'value' => [ 'show', 'required' ],
969 'options' => [
970 [
971 'value' => 'show',
972 'label' => 'Show company name?',
973 ],
974 [
975 'value' => 'required',
976 'label' => 'Required Field',
977 ],
978 ],
979 // 'tab' => 'company',
980 ],
981
982 'shipping_company_label' => [
983 'id' => 'shipping_company_label',
984 'label' => esc_html__( 'Company label', 'shopbuilder' ),
985 'type' => 'text',
986 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
987 // 'tab' => 'company',
988 'dependency' => [
989 'rules' => [
990 [
991 'item' => 'general.shipping_form.shipping_company',
992 'value' => 'show',
993 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
994 ],
995 ],
996 ],
997 ],
998 'shipping_company_placeholder' => [
999 'id' => 'shipping_company_placeholder',
1000 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1001 'type' => 'text',
1002 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1003 // 'tab' => 'country',
1004 'dependency' => [
1005 'rules' => [
1006 [
1007 'item' => 'general.shipping_form.shipping_company',
1008 'value' => 'show',
1009 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1010 ],
1011 ],
1012 ],
1013 ],
1014 'shipping_country_heading' => [
1015 'id' => 'shipping_country_heading',
1016 'type' => 'title',
1017 'label' => esc_html__( 'Country', 'shopbuilder' ),
1018 // 'tab' => 'name',
1019 ],
1020 'shipping_country' => [
1021 'id' => 'shipping_country',
1022 'label' => esc_html__( 'Country', 'shopbuilder' ),
1023 'type' => 'checkbox',
1024 'orientation' => 'vertical',
1025 'value' => [ 'show', 'required' ],
1026 'options' => [
1027 [
1028 'value' => 'show',
1029 'label' => 'Show Country?',
1030 // 'disabled' => true,
1031 ],
1032 [
1033 'value' => 'required',
1034 'label' => 'Required Field',
1035 // 'disabled' => true,
1036 ],
1037 ],
1038 // 'tab' => 'country',
1039 ],
1040
1041 'shipping_country_label' => [
1042 'id' => 'shipping_country_label',
1043 'label' => esc_html__( 'Country label', 'shopbuilder' ),
1044 'type' => 'text',
1045 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1046 'dependency' => [
1047 'rules' => [
1048 [
1049 'item' => 'general.shipping_form.shipping_country',
1050 'value' => 'show',
1051 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1052 ],
1053 ],
1054 ],
1055 ],
1056 'shipping_address_1_heading' => [
1057 'id' => 'shipping_address_1_heading',
1058 'type' => 'title',
1059 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1060 // 'tab' => 'name',
1061 ],
1062 'shipping_address_1' => [
1063 'id' => 'shipping_address_1',
1064 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1065 'type' => 'checkbox',
1066 'orientation' => 'vertical',
1067 'value' => [ 'show', 'required' ],
1068 'options' => [
1069 [
1070 'value' => 'show',
1071 'label' => 'Show Address field?',
1072 ],
1073 [
1074 'value' => 'required',
1075 'label' => 'Required Field',
1076 ],
1077 ],
1078 // 'tab' => 'country',
1079 ],
1080
1081 'shipping_address_1_label' => [
1082 'id' => 'shipping_address_1_label',
1083 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1084 'type' => 'text',
1085 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1086 // 'tab' => 'country',
1087 'dependency' => [
1088 'rules' => [
1089 [
1090 'item' => 'general.shipping_form.shipping_address_1',
1091 'value' => 'show',
1092 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1093 ],
1094 ],
1095 ],
1096 ],
1097 'shipping_address_1_placeholder' => [
1098 'id' => 'shipping_address_1_placeholder',
1099 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1100 'type' => 'text',
1101 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1102 // 'tab' => 'country',
1103 'dependency' => [
1104 'rules' => [
1105 [
1106 'item' => 'general.shipping_form.shipping_address_1',
1107 'value' => 'show',
1108 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1109 ],
1110 ],
1111 ],
1112 ],
1113 'shipping_address_2_heading' => [
1114 'id' => 'shipping_address_2_heading',
1115 'type' => 'title',
1116 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1117 // 'tab' => 'name',
1118 'dependency' => [
1119 'rules' => [
1120 [
1121 'item' => 'general.shipping_form.shipping_address_1',
1122 'value' => 'show',
1123 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1124 ],
1125 ],
1126 ],
1127 ],
1128 'shipping_address_2' => [
1129 'id' => 'shipping_address_2',
1130 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1131 'type' => 'checkbox',
1132 'orientation' => 'vertical',
1133 'value' => [ 'show' ],
1134 'options' => [
1135 [
1136 'value' => 'show',
1137 'label' => 'Show Address field?',
1138 ],
1139 ],
1140 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1141 // 'tab' => 'country',
1142 'dependency' => [
1143 'rules' => [
1144 [
1145 'item' => 'general.shipping_form.shipping_address_1',
1146 'value' => 'show',
1147 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1148 ],
1149 ],
1150 ],
1151 ],
1152
1153 'shipping_address_2_label' => [
1154 'id' => 'shipping_address_2_label',
1155 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1156 'type' => 'text',
1157 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1158 // 'tab' => 'country',
1159 'dependency' => [
1160 'rules' => [
1161 [
1162 'item' => 'general.shipping_form.shipping_address_1',
1163 'value' => 'show',
1164 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1165 ],
1166 [
1167 'item' => 'general.shipping_form.shipping_address_2',
1168 'value' => 'show',
1169 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1170 ],
1171 ],
1172 ],
1173 ],
1174 'shipping_address_2_placeholder' => [
1175 'id' => 'shipping_address_2_placeholder',
1176 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1177 'type' => 'text',
1178 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1179 // 'tab' => 'country',
1180 'dependency' => [
1181 'rules' => [
1182 [
1183 'item' => 'general.shipping_form.shipping_address_1',
1184 'value' => 'show',
1185 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1186 ],
1187 [
1188 'item' => 'general.shipping_form.shipping_address_2',
1189 'value' => 'show',
1190 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1191 ],
1192 ],
1193 ],
1194 ],
1195 'shipping_city_heading' => [
1196 'id' => 'shipping_city_heading',
1197 'type' => 'title',
1198 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1199 // 'tab' => 'name',
1200 ],
1201 'shipping_city' => [
1202 'id' => 'shipping_city',
1203 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1204 'type' => 'checkbox',
1205 'orientation' => 'vertical',
1206 'value' => [ 'show', 'required' ],
1207 'options' => [
1208 [
1209 'value' => 'show',
1210 'label' => 'Show Town / City?',
1211 ],
1212 [
1213 'value' => 'required',
1214 'label' => 'Required Field',
1215 ],
1216 ],
1217 // 'tab' => 'country',
1218 ],
1219 'shipping_city_label' => [
1220 'id' => 'shipping_city_label',
1221 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1222 'type' => 'text',
1223 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1224 // 'tab' => 'country',
1225 'dependency' => [
1226 'rules' => [
1227 [
1228 'item' => 'general.shipping_form.shipping_city',
1229 'value' => 'show',
1230 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1231 ],
1232 ],
1233 ],
1234 ],
1235 'shipping_city_placeholder' => [
1236 'id' => 'shipping_city_placeholder',
1237 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1238 'type' => 'text',
1239 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1240 // 'tab' => 'country',
1241 'dependency' => [
1242 'rules' => [
1243 [
1244 'item' => 'general.shipping_form.shipping_city',
1245 'value' => 'show',
1246 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1247 ],
1248 ],
1249 ],
1250 ],
1251 'shipping_state_heading' => [
1252 'id' => 'shipping_state_heading',
1253 'type' => 'title',
1254 'label' => esc_html__( 'Others', 'shopbuilder' ),
1255 // 'tab' => 'name',
1256 ],
1257 'shipping_state' => [
1258 'id' => 'shipping_state',
1259 'label' => esc_html__( 'State', 'shopbuilder' ),
1260 'type' => 'checkbox',
1261 'orientation' => 'vertical',
1262 'value' => [ 'show', 'required' ],
1263 'options' => [
1264 [
1265 'value' => 'show',
1266 'label' => 'Show State?',
1267 ],
1268 [
1269 'value' => 'required',
1270 'label' => 'Required Field',
1271 ],
1272 ],
1273 // 'tab' => 'country',
1274 ],
1275 //
1276 // 'shipping_state_label' => [
1277 // 'id' => 'shipping_state_label',
1278 // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1279 // 'type' => 'text',
1280 // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1281 // 'tab' => 'country',
1282 // 'dependency' => [
1283 // 'rules' => [
1284 // [
1285 // 'item' => 'general.shipping_form.shipping_state',
1286 // 'value' => 'show',
1287 // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1288 // ],
1289 // ],
1290 // ],
1291 // ],
1292 // 'shipping_postcode_heading' => [
1293 // 'id' => 'shipping_postcode_heading',
1294 // 'type' => 'title',
1295 // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1296 // 'tab' => 'name',
1297 // ],
1298 'shipping_postcode' => [
1299 'id' => 'shipping_postcode',
1300 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1301 'type' => 'checkbox',
1302 'orientation' => 'vertical',
1303 'value' => [ 'show', 'required' ],
1304 'options' => [
1305 [
1306 'value' => 'show',
1307 'label' => 'Show Postcode / ZIP?',
1308 ],
1309 ],
1310 // 'tab' => 'country',
1311 ],
1312 // 'shipping_postcode_label' => [
1313 // 'id' => 'shipping_postcode_label',
1314 // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1315 // 'type' => 'text',
1316 // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1317 // 'tab' => 'country',
1318 // 'dependency' => [
1319 // 'rules' => [
1320 // [
1321 // 'item' => 'general.shipping_form.shipping_postcode',
1322 // 'value' => 'show',
1323 // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1324 // ],
1325 // ],
1326 // ],
1327 // ],
1328 // 'shipping_postcode_placeholder' => [
1329 // 'id' => 'shipping_postcode_placeholder',
1330 // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1331 // 'type' => 'text',
1332 // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1333 // 'tab' => 'country',
1334 // 'dependency' => [
1335 // 'rules' => [
1336 // [
1337 // 'item' => 'general.shipping_form.shipping_postcode',
1338 // 'value' => 'show',
1339 // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1340 // ],
1341 // ],
1342 // ],
1343 // ],
1344
1345 ],
1346 ]
1347 ),
1348 ];
1349
1350 return apply_filters( 'rtsb/core/general_settings/raw_list', $list );
1351 }
1352 }
1353