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 / Models / GeneralList.php

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

1,785 lines 60.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\AI\AIFns;
6 use RadiusTheme\SB\Helpers\Fns;
7 use RadiusTheme\SB\Helpers\SvgIcons;
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 'optimization' => apply_filters(
56 'rtsb/settings/optimization/options',
57 [
58 'id' => 'optimization',
59 'icon' => SvgIcons::get( 'optimization' ),
60 'category' => 'general',
61 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ),
62 'package' => $this->pro_version_checker(),
63 'badge' => 'new',
64 'links' => [
65 'doc' => '',
66 'video' => '',
67 ],
68 'active_field' => [
69 'disable' => true,
70 ],
71 'fields' => [
72 'optimization_intro' => [
73 'id' => 'optimization_intro',
74 'type' => 'description',
75 'text' => __( 'Optimize your website for maximum performance from these advanced options. <br /> <span style="color: #dc3545; display: block; margin-top: 10px;">⚠️ Note: After enabling or disabling any of these settings, clear the ShopBuilder cache to ensure changes are applied correctly.</span>', 'shopbuilder' ),
76 ],
77 'enable_optimization' => [
78 'id' => 'enable',
79 'type' => 'switch',
80 'value' => 'on',
81 'label' => esc_html__( 'Enable Asset Optimization?', 'shopbuilder' ),
82 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website\'s performance', 'shopbuilder' ),
83 ],
84 'load_elementor_scripts' => [
85 'id' => 'enable',
86 'type' => 'switch',
87 'label' => esc_html__( 'Load Elementor Assets?', 'shopbuilder' ),
88 'help' => __( 'Enable this option to load necessary Elementor assets on your website. <br /> <span style="color: #dc3545;">Turn this off if you are not using Elementor widgets to optimize site performance.</span>', 'shopbuilder' ),
89 'value' => 'on',
90 'dependency' => [
91 'rules' => [
92 [
93 'item' => 'general.optimization.enable_optimization',
94 'value' => 'on',
95 'operator' => '==',
96 ],
97 ],
98 ],
99 ],
100 'context_asset_loading' => [
101 'id' => 'enable',
102 'type' => 'switch',
103 'label' => esc_html__( 'Context-Aware Asset Loading?', 'shopbuilder' ),
104 'help' => esc_html__( 'Enable this option to dynamically Load only the necessary CSS and JS for each page type (e.g., product, cart, checkout). Disabling this option will include all assets globally on every page.', 'shopbuilder' ),
105 'dependency' => [
106 'rules' => [
107 [
108 'item' => 'general.optimization.enable_optimization',
109 'value' => 'on',
110 'operator' => '==',
111 ],
112 ],
113 ],
114 ],
115 'wp_rocket_compatibility' => [
116 'id' => 'wp_rocket_compatibility',
117 'type' => 'switch',
118 'label' => esc_html__( 'WP Rocket Compatibility', 'shopbuilder' ),
119 'help' => esc_html__( 'Enable this option to ensure compatibility with the WP Rocket plugin for optimized asset loading.', 'shopbuilder' ),
120 ],
121
122 'remove_pre_loader' => [
123 'id' => 'remove_pre_loader',
124 'type' => 'switch',
125 'label' => esc_html__( 'Disable Element Preloader', 'shopbuilder' ),
126 'help' => esc_html__( 'Enable this option to remove the element preloader.', 'shopbuilder' ),
127 ],
128 /**
129 'load_gutenberg_scripts' => [
130 'id' => 'enable',
131 'type' => 'switch',
132 'label' => esc_html__( 'Load Gutenberg Scripts?', 'shopbuilder' ),
133 'help' => esc_html__( 'Switch on to load elementor scripts by dynamically loading scripts', 'shopbuilder' ),
134 ],
135 */
136 ],
137 ],
138 ),
139 'ai_implementation' => apply_filters(
140 'rtsb/settings/ai_implementation/options',
141 [
142 'id' => 'ai_implementation',
143 'icon' => SvgIcons::get( 'ai_implementation' ),
144 'category' => 'general',
145 'title' => esc_html__( 'AI-implementation', 'shopbuilder' ),
146 'package' => 'free',
147 'badge' => 'beta',
148 'links' => [
149 'doc' => '',
150 'video' => '',
151 ],
152 'active_field' => [
153 'disable' => true,
154 ],
155 'fields' => [
156 'data_ai_feature_beta_message' => [
157 'id' => 'data_ai_feature_beta_message',
158 'type' => 'description',
159 'text' => esc_html__( '🧠 AI feature is in beta — stable and fully functional, with more enhancements coming soon.', 'shopbuilder' ),
160 ],
161 'ai_tools' => [
162 'id' => 'ai_tools',
163 'label' => esc_html__( 'AI Tools', 'shopbuilder' ),
164 'type' => 'select',
165 'value' => '',
166 'options' => [
167 '' => esc_html__( '----', 'shopbuilder' ),
168 'OpenAI' => esc_html__( 'ChatGPT', 'shopbuilder' ),
169 'Gemini' => esc_html__( 'Google Gemini', 'shopbuilder' ),
170 // phpcs:ignore Generic.Commenting
171 // DeepSeek' => esc_html__( 'DeepSeek', 'shopbuilder' ), .
172 ],
173 ],
174 // GPT.
175 'gpt_models' => [
176 'id' => 'gpt_models',
177 'label' => esc_html__( 'GPT Model', 'shopbuilder' ),
178 'type' => 'select',
179 'value' => 'gpt-4o',
180 'options' => [
181 'gpt-4o' => esc_html__( 'GPT-4o (Full Version)', 'shopbuilder' ),
182 'gpt-4o-mini' => esc_html__( 'GPT-4o Mini (Light Version)', 'shopbuilder' ),
183 ],
184 'dependency' => [
185 'rules' => [
186 [
187 'item' => 'general.ai_implementation.ai_tools',
188 'value' => 'OpenAI',
189 'operator' => '==',
190 ],
191 ],
192 ],
193 ],
194 'gpt_api_key' => [
195 'id' => 'gpt_api_key',
196 'label' => esc_html__( 'ChatGPT API Key', 'shopbuilder' ),
197 'type' => 'password',
198 'placeholder' => esc_html__( 'sk-p********', 'shopbuilder' ),
199 'help' => wp_kses(
200 __(
201 'To integrate with ChatGPT, you need to obtain an API key from OpenAI. Visit <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API Keys</a> to generate one.',
202 'shopbuilder'
203 ),
204 [
205 'a' => [
206 'href' => [],
207 'target' => [],
208 ],
209 ]
210 ),
211 'dependency' => [
212 'rules' => [
213 [
214 'item' => 'general.ai_implementation.ai_tools',
215 'value' => 'OpenAI',
216 'operator' => '==',
217 ],
218 ],
219 ],
220 ],
221 'gpt_max_token' => [
222 'id' => 'gpt_max_token',
223 'label' => esc_html__( 'ChatGPT Maximum Characters in Prompt Input', 'shopbuilder' ),
224 'type' => 'number',
225 'help' => esc_html__(
226 'Set the maximum character limit for the prompt input. This controls how many characters users can enter, ensuring input stays concise and manageable. Higher limits may affect performance and response quality.',
227 'shopbuilder'
228 ),
229 'value' => 200,
230 'placeholder' => esc_html__( '200', 'shopbuilder' ),
231 'dependency' => [
232 'rules' => [
233 [
234 'item' => 'general.ai_implementation.ai_tools',
235 'value' => 'OpenAI',
236 'operator' => '==',
237 ],
238 ],
239 ],
240 ],
241 // Gemini.
242 'gemini_api_key' => [
243 'id' => 'gemini_api_key',
244 'label' => esc_html__( 'Gemini API Key', 'shopbuilder' ),
245 'type' => 'password',
246 'placeholder' => esc_html__( 'AIzaSy***********************', 'shopbuilder' ),
247 'help' => wp_kses(
248 __(
249 'To integrate with Google Gemini, you need to obtain an API key from Google Cloud. Visit <a href="https://makersuite.google.com/app/apikey" target="_blank">Google AI Studio API Keys</a> to generate one.',
250 'shopbuilder'
251 ),
252 [
253 'a' => [
254 'href' => [],
255 'target' => [],
256 ],
257 ]
258 ),
259 'dependency' => [
260 'rules' => [
261 [
262 'item' => 'general.ai_implementation.ai_tools',
263 'value' => 'Gemini',
264 'operator' => '==',
265 ],
266 ],
267 ],
268 ],
269 /**
270 * User Will Not Understand how Its Works.
271 'gemini_models' => [
272 'id' => 'gemini_models',
273 'label' => esc_html__( 'Gemini Model', 'shopbuilder' ),
274 'type' => 'select',
275 'value' => 'gemini-2.5-flash',
276 'options' => [
277 'gemini-2.5-flash' => esc_html__( 'Gemini 2.5 Flash', 'shopbuilder' ),
278 'gemini-2.5-pro' => esc_html__( 'Gemini 2.5 Pro', 'shopbuilder' ),
279 ],
280 'dependency' => [
281 'rules' => [
282 [
283 'item' => 'general.ai_implementation.ai_tools',
284 'value' => 'Gemini',
285 'operator' => '==',
286 ],
287 ],
288 ],
289 ],
290 */
291 'gemini_max_token' => [
292 'id' => 'gemini_max_token',
293 'label' => esc_html__( 'Gemini Maximum Characters', 'shopbuilder' ),
294 'type' => 'number',
295 'help' => esc_html__(
296 'Set the maximum character limit for Gemini model prompts. Adjust according to model capabilities and performance.',
297 'shopbuilder'
298 ),
299 'value' => 200,
300 'placeholder' => esc_html__( '200', 'shopbuilder' ),
301 'dependency' => [
302 'rules' => [
303 [
304 'item' => 'general.ai_implementation.ai_tools',
305 'value' => 'Gemini',
306 'operator' => '==',
307 ],
308 ],
309 ],
310 ],
311 // DeepSeek.
312 'deepseek_api_key' => [
313 'id' => 'deepseek_api_key',
314 'label' => esc_html__( 'DeepSeek API Key', 'shopbuilder' ),
315 'type' => 'password',
316 'placeholder' => esc_html__( 'ds-***********************', 'shopbuilder' ),
317 'help' => wp_kses(
318 __(
319 'To integrate with DeepSeek, you need to obtain an API key from DeepSeek. Visit <a href="https://www.deepseek.com/api-keys" target="_blank">DeepSeek API Keys</a> to generate one.',
320 'shopbuilder'
321 ),
322 [
323 'a' => [
324 'href' => [],
325 'target' => [],
326 ],
327 ]
328 ),
329 'dependency' => [
330 'rules' => [
331 [
332 'item' => 'general.ai_implementation.ai_tools',
333 'value' => 'DeepSeek',
334 'operator' => '==',
335 ],
336 ],
337 ],
338 ],
339 'deepseek_models' => [
340 'id' => 'deepseek_models',
341 'label' => esc_html__( 'DeepSeek Model', 'shopbuilder' ),
342 'type' => 'select',
343 'value' => 'gpt-4o',
344 'options' => [
345 'deepseek-chat' => __( 'DeepSeek Chat (Full Version)', 'shopbuilder' ),
346 'deepseek-reasoner' => __( 'DeepSeek Reasoner Mini (Light Version)', 'shopbuilder' ),
347 ],
348 'dependency' => [
349 'rules' => [
350 [
351 'item' => 'general.ai_implementation.ai_tools',
352 'value' => 'DeepSeek',
353 'operator' => '==',
354 ],
355 ],
356 ],
357 ],
358 'deepseek_max_token' => [
359 'id' => 'deepseek_max_token',
360 'label' => esc_html__( 'Deepshek Maximum Characters', 'shopbuilder' ),
361 'type' => 'number',
362 'help' => esc_html__(
363 'Set the maximum character limit for Deepshek model prompts. Adjust according to model configuration and speed requirements.',
364 'shopbuilder'
365 ),
366 'value' => 200,
367 'placeholder' => esc_html__( '200', 'shopbuilder' ),
368 'dependency' => [
369 'rules' => [
370 [
371 'item' => 'general.ai_implementation.ai_tools',
372 'value' => 'DeepSeek',
373 'operator' => '==',
374 ],
375 ],
376 ],
377 ],
378 'enable_semantic_search' => [
379 'id' => 'enable_semantic_search',
380 'type' => 'switch',
381 'label' => esc_html__( 'Enable Semantic Search?', 'shopbuilder' ),
382 'help' => esc_html__( 'Enable AI product search instead of keyword matching to get product', 'shopbuilder' ),
383 'dependency' => [
384 'rules' => [
385 [
386 'item' => 'general.ai_implementation.ai_tools',
387 'value' => [ 'OpenAI', 'Gemini' ],
388 'operator' => 'in',
389 ],
390 ],
391 ],
392 ],
393 'minimum_matching_percentage' => [
394 'id' => 'minimum_matching_percentage',
395 'label' => esc_html__( 'Minimum Accuracy (in percentage)', 'shopbuilder' ),
396 'help' => esc_html__( 'Set the minimum Accuracy. It is good between 40 and 60', 'shopbuilder' ),
397 'type' => 'number',
398 'min' => 1,
399 'max' => 99,
400 'value' => 40,
401 'placeholder' => esc_html__( '40', 'shopbuilder' ),
402 'dependency' => [
403 'rules' => [
404 [
405 'item' => 'general.ai_implementation.ai_tools',
406 'value' => [ 'OpenAI', 'Gemini' ],
407 'operator' => 'in',
408 ],
409 [
410 'item' => 'general.ai_implementation.enable_semantic_search',
411 'value' => 'on',
412 'operator' => '==',
413 ],
414 ],
415 ],
416 ],
417 'data_training' => [
418 'id' => 'data_training',
419 'type' => 'title',
420 'label' => esc_html__( 'Data Training', 'shopbuilder' ),
421 'dependency' => [
422 'rules' => [
423 [
424 'item' => 'general.ai_implementation.ai_tools',
425 'value' => [ 'OpenAI', 'Gemini' ],
426 'operator' => 'in',
427 ],
428 ],
429 ],
430 ],
431 'data_training_note_gemini' => $this->get_data_training_note_field( 'Gemini' ),
432 'data_training_note_openai' => $this->get_data_training_note_field( 'OpenAI' ),
433 'data_training_note_missing_openai_key' => $this->get_data_training_note_field( 'missingOpenAIKey' ),
434 'data_training_note_missing_gemneni_key' => $this->get_data_training_note_field( 'missingGeminiKey' ),
435 ],
436 ],
437 ),
438 'notification' => apply_filters(
439 'rtsb/settings/notification/options',
440 [
441 'id' => 'notification',
442 'icon' => SvgIcons::get( 'notification' ),
443 'category' => 'general',
444 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ),
445 'package' => 'free',
446 'links' => [
447 'doc' => '',
448 'video' => '',
449 ],
450 'active_field' => [
451 'disable' => true,
452 ],
453 'fields' => [
454 'notification_intro' => [
455 'id' => 'notification_intro',
456 'type' => 'description',
457 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
458 ],
459 'notification_position' => [
460 'id' => 'notification_position',
461 'value' => 'center-center',
462 'type' => 'select',
463 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
464 'options' => [
465 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
466 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
467 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
468 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
469 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
470 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
471 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
472 ],
473 ],
474 'notification_timeOut' => [
475 'id' => 'notification_timeOut',
476 'label' => esc_html__( 'Notification Time-Out (in seconds)', 'shopbuilder' ),
477 'type' => 'number',
478 'help' => esc_html__(
479 'Duration (in seconds) before the notification hides automatically.',
480 'shopbuilder'
481 ),
482 'min' => 1,
483 'max' => 20,
484 'value' => 5,
485 'placeholder' => esc_html__( '3', 'shopbuilder' ),
486 ],
487 'notification_color' => [
488 'id' => 'notification_color',
489 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
490 'type' => 'color',
491 'tab' => 'floating_button',
492 ],
493 'notification_btn_color' => [
494 'id' => 'notification_color',
495 'label' => esc_html__( 'Button Color', 'shopbuilder' ),
496 'type' => 'color',
497 'tab' => 'floating_button',
498 ],
499 'notification_bg' => [
500 'id' => 'notification_bg',
501 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
502 'type' => 'color',
503 'tab' => 'floating_button',
504 ],
505 'hide_notification' => [
506 'id' => 'hide_notification',
507 'type' => 'switch',
508 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ),
509 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ),
510 ],
511 ],
512 ],
513 ),
514 'social_share' => apply_filters(
515 'rtsb/settings/social_share/options',
516 [
517 'id' => 'social_share',
518 'icon' => SvgIcons::get( 'social_share' ),
519 'category' => 'general',
520 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
521 'package' => 'free',
522 'links' => [
523 'doc' => '',
524 'video' => '',
525 ],
526 'active_field' => [
527 'disable' => true,
528 ],
529 'fields' => [
530 'social_share_intro' => [
531 'id' => 'social_share_intro',
532 'type' => 'description',
533 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
534 ],
535 'share_platforms' => [
536 'id' => 'share_platforms',
537 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
538 'type' => 'checkbox',
539 'orientation' => 'vertical',
540 'value' => [ 'facebook', 'twitter', 'linkedin' ],
541 'options' => Fns::social_share_platforms_list(),
542 ],
543 'share_platforms_to_product_page' => [
544 'id' => 'share_platforms_to_product_page',
545 'type' => 'switch',
546 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
547 'help' => esc_html__( 'Enable this option to allow share a product from product page. Woocommerce Supported Sharing plugins added to Hook: woocommerce_share', 'shopbuilder' ),
548 ],
549 'share_icon_layout' => [
550 'type' => 'select',
551 'value' => 'share-layout1',
552 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
553 'options' => [
554 'share-layout1' => esc_html__( 'Layout 1', 'shopbuilder' ),
555 'share-layout2' => esc_html__( 'Layout 2', 'shopbuilder' ),
556 ],
557 'dependency' => [
558 'rules' => [
559 [
560 'item' => 'general.social_share.share_platforms_to_product_page',
561 'value' => 'on',
562 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
563 ],
564 ],
565 ],
566 ],
567 ],
568 ],
569 ),
570 'guest_user' => apply_filters(
571 'rtsb/settings/guest_user/options',
572 [
573 'id' => 'guest_user',
574 'icon' => SvgIcons::get( 'guest_user' ),
575 'category' => 'general',
576 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
577 'package' => $this->pro_package(),
578 'links' => [
579 'doc' => '',
580 'video' => '',
581 ],
582 'active_field' => [
583 'disable' => true,
584 ],
585 ],
586 ),
587 'tooltip' => apply_filters(
588 'rtsb/settings/tooltip/options',
589 [
590 'id' => 'tooltip',
591 'icon' => SvgIcons::get( 'tooltip' ),
592 'category' => 'general',
593 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
594 'package' => $this->pro_package(),
595 'links' => [
596 'doc' => '',
597 'video' => '',
598 ],
599 'active_field' => [
600 'disable' => true,
601 ],
602 ],
603 ),
604 'billing_form' => apply_filters(
605 'rtsb/settings/billing_form/options',
606 [
607 'id' => 'billing_form',
608 'icon' => SvgIcons::get( 'billing_form' ),
609 'category' => 'checkout',
610 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
611 'package' => 'free',
612 'links' => [
613 'doc' => '',
614 'video' => '',
615 ],
616 'active_field' => [
617 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
618 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
619 ],
620 'fields' => [
621 'checkout_billing_info' => [
622 'id' => 'checkout_billing_info',
623 'type' => 'deprecated',
624 'label' => __( '<strong>Deprecated:</strong> Billing Form Settings is deprecated. Please use the <strong><u>Checkout Fields Editor</u></strong> module to customize checkout fields. These settings will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is active.', 'shopbuilder' ),
625 'customClass' => 'checkout-notice',
626 'before_active' => true,
627 ],
628 'billing_first_name_heading' => [
629 'id' => 'billing_first_name_heading',
630 'type' => 'title',
631 'label' => esc_html__( 'First Name', 'shopbuilder' ),
632 ],
633 'billing_first_name' => [
634 'id' => 'billing_first_name',
635 'label' => esc_html__( 'First name', 'shopbuilder' ),
636 'type' => 'checkbox',
637 'orientation' => 'vertical',
638 'value' => [ 'show', 'required' ],
639 'options' => [
640 [
641 'value' => 'show',
642 'label' => 'Show First name?',
643 ],
644 [
645 'value' => 'required',
646 'label' => 'Required Field',
647 ],
648 ],
649 ],
650 'billing_first_name_label' => [
651 'id' => 'billing_first_name_label',
652 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
653 'type' => 'text',
654 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
655 'dependency' => [
656 'rules' => [
657 [
658 'item' => 'general.billing_form.billing_first_name',
659 'value' => 'show',
660 'operator' => '==',
661 ],
662 ],
663 ],
664 ],
665 'billing_first_name_placeholder' => [
666 'id' => 'billing_first_name_placeholder',
667 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
668 'type' => 'text',
669 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
670 'dependency' => [
671 'rules' => [
672 [
673 'item' => 'general.billing_form.billing_first_name',
674 'value' => 'show',
675 'operator' => '==',
676 ],
677 ],
678 ],
679 ],
680
681 'billing_last_name_heading' => [
682 'id' => 'billing_last_name_heading',
683 'type' => 'title',
684 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
685 ],
686 'billing_last_name' => [
687 'id' => 'billing_last_name',
688 'label' => esc_html__( 'Last name', 'shopbuilder' ),
689 'type' => 'checkbox',
690 'orientation' => 'vertical',
691 'value' => [ 'show', 'required' ],
692 'options' => [
693 [
694 'value' => 'show',
695 'label' => 'Show Last name?',
696 ],
697 [
698 'value' => 'required',
699 'label' => 'Required Field',
700 ],
701 ],
702 ],
703
704 'billing_last_name_label' => [
705 'id' => 'billing_last_name_label',
706 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
707 'type' => 'text',
708 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
709 'dependency' => [
710 'rules' => [
711 [
712 'item' => 'general.billing_form.billing_last_name',
713 'value' => 'show',
714 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
715 ],
716 ],
717 ],
718 ],
719 'billing_last_name_placeholder' => [
720 'id' => 'billing_last_name_placeholder',
721 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
722 'type' => 'text',
723 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
724 'dependency' => [
725 'rules' => [
726 [
727 'item' => 'general.billing_form.billing_last_name',
728 'value' => 'show',
729 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
730 ],
731 ],
732 ],
733 ],
734
735 'billing_company_heading' => [
736 'id' => 'billing_company_heading',
737 'type' => 'title',
738 'label' => esc_html__( 'Company', 'shopbuilder' ),
739 ],
740 'billing_company' => [
741 'id' => 'billing_company',
742 'label' => esc_html__( 'Company name', 'shopbuilder' ),
743 'type' => 'checkbox',
744 'orientation' => 'vertical',
745 'value' => [
746 'show',
747 'required' === get_option( 'woocommerce_checkout_company_field', 'optional' ) ? 'required' : 'optional',
748 ],
749 'options' => [
750 [
751 'value' => 'show',
752 'label' => 'Show company name?',
753 ],
754 [
755 'value' => 'required',
756 'label' => 'Required Field',
757 ],
758 ],
759 ],
760
761 'billing_company_label' => [
762 'id' => 'billing_company_label',
763 'label' => esc_html__( 'Company label', 'shopbuilder' ),
764 'type' => 'text',
765 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
766 'dependency' => [
767 'rules' => [
768 [
769 'item' => 'general.billing_form.billing_company',
770 'value' => 'show',
771 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
772 ],
773 ],
774 ],
775 ],
776 'billing_company_placeholder' => [
777 'id' => 'billing_company_placeholder',
778 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
779 'type' => 'text',
780 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
781 'dependency' => [
782 'rules' => [
783 [
784 'item' => 'general.billing_form.billing_company',
785 'value' => 'show',
786 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
787 ],
788 ],
789 ],
790 ],
791
792 'billing_country_heading' => [
793 'id' => 'billing_country_heading',
794 'type' => 'title',
795 'label' => esc_html__( 'Country', 'shopbuilder' ),
796 ],
797 'billing_country' => [
798 'id' => 'billing_country',
799 'label' => esc_html__( 'Country', 'shopbuilder' ),
800 'type' => 'checkbox',
801 'orientation' => 'vertical',
802 'value' => [ 'show', 'required' ],
803 'options' => [
804 [
805 'value' => 'show',
806 'label' => 'Show Country?',
807 ],
808 [
809 'value' => 'required',
810 'label' => 'Required Field',
811 ],
812 ],
813 ],
814
815 'billing_country_label' => [
816 'id' => 'billing_country_label',
817 'label' => esc_html__( 'Country label', 'shopbuilder' ),
818 'type' => 'text',
819 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
820 'dependency' => [
821 'rules' => [
822 [
823 'item' => 'general.billing_form.billing_country',
824 'value' => 'show',
825 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
826 ],
827 ],
828 ],
829 ],
830 'billing_address_1_heading' => [
831 'id' => 'billing_address_1_heading',
832 'type' => 'title',
833 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
834 ],
835 'billing_address_1' => [
836 'id' => 'billing_address_1',
837 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
838 'type' => 'checkbox',
839 'orientation' => 'vertical',
840 'value' => [ 'show', 'required' ],
841 'options' => [
842 [
843 'value' => 'show',
844 'label' => 'Show Address field?',
845 ],
846 [
847 'value' => 'required',
848 'label' => 'Required Field',
849 ],
850 ],
851 ],
852
853 'billing_address_1_label' => [
854 'id' => 'billing_address_1_label',
855 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
856 'type' => 'text',
857 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
858 'dependency' => [
859 'rules' => [
860 [
861 'item' => 'general.billing_form.billing_address_1',
862 'value' => 'show',
863 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
864 ],
865 ],
866 ],
867 ],
868 'billing_address_1_placeholder' => [
869 'id' => 'billing_address_1_placeholder',
870 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
871 'type' => 'text',
872 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
873 'dependency' => [
874 'rules' => [
875 [
876 'item' => 'general.billing_form.billing_address_1',
877 'value' => 'show',
878 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
879 ],
880 ],
881 ],
882 ],
883 'billing_address_2_heading' => [
884 'id' => 'billing_address_2_heading',
885 'type' => 'title',
886 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
887 'dependency' => [
888 'rules' => [
889 [
890 'item' => 'general.billing_form.billing_address_1',
891 'value' => 'show',
892 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
893 ],
894 ],
895 ],
896 ],
897 'billing_address_2' => [
898 'id' => 'billing_address_2',
899 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
900 'type' => 'checkbox',
901 'orientation' => 'vertical',
902 'value' => [
903 'show',
904 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
905 ],
906 'options' => [
907 [
908 'value' => 'show',
909 'label' => 'Show Address field?',
910 ],
911 ],
912 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
913 'dependency' => [
914 'rules' => [
915 [
916 'item' => 'general.billing_form.billing_address_1',
917 'value' => 'show',
918 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
919 ],
920 ],
921 ],
922 ],
923
924 'billing_address_2_label' => [
925 'id' => 'billing_address_2_label',
926 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
927 'type' => 'text',
928 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
929 'dependency' => [
930 'rules' => [
931 [
932 'item' => 'general.billing_form.billing_address_1',
933 'value' => 'show',
934 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
935 ],
936 [
937 'item' => 'general.billing_form.billing_address_2',
938 'value' => 'show',
939 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
940 ],
941 ],
942 ],
943 ],
944 'billing_address_2_placeholder' => [
945 'id' => 'billing_address_2_placeholder',
946 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
947 'type' => 'text',
948 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
949 'dependency' => [
950 'rules' => [
951 [
952 'item' => 'general.billing_form.billing_address_1',
953 'value' => 'show',
954 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
955 ],
956 [
957 'item' => 'general.billing_form.billing_address_2',
958 'value' => 'show',
959 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
960 ],
961 ],
962 ],
963 ],
964 'billing_city_heading' => [
965 'id' => 'billing_city_heading',
966 'type' => 'title',
967 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
968 ],
969 'billing_city' => [
970 'id' => 'billing_city',
971 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
972 'type' => 'checkbox',
973 'orientation' => 'vertical',
974 'value' => [ 'show', 'required' ],
975 'options' => [
976 [
977 'value' => 'show',
978 'label' => 'Show Town / City?',
979 ],
980 [
981 'value' => 'required',
982 'label' => 'Required Field',
983 ],
984 ],
985
986 ],
987 'billing_city_label' => [
988 'id' => 'billing_city_label',
989 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
990 'type' => 'text',
991 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
992 'dependency' => [
993 'rules' => [
994 [
995 'item' => 'general.billing_form.billing_city',
996 'value' => 'show',
997 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
998 ],
999 ],
1000 ],
1001 ],
1002 'billing_city_placeholder' => [
1003 'id' => 'billing_city_placeholder',
1004 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
1005 'type' => 'text',
1006 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1007 'dependency' => [
1008 'rules' => [
1009 [
1010 'item' => 'general.billing_form.billing_city',
1011 'value' => 'show',
1012 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1013 ],
1014 ],
1015 ],
1016 ],
1017 'billing_state_heading' => [
1018 'id' => 'billing_city_heading',
1019 'type' => 'title',
1020 'label' => esc_html__( 'State', 'shopbuilder' ),
1021 ],
1022 'billing_state' => [
1023 'id' => 'billing_state',
1024 'label' => esc_html__( 'State', 'shopbuilder' ),
1025 'type' => 'checkbox',
1026 'orientation' => 'vertical',
1027 'value' => [ 'show', 'required' ],
1028 'options' => [
1029 [
1030 'value' => 'show',
1031 'label' => 'Show State?',
1032 ],
1033 [
1034 'value' => 'required',
1035 'label' => 'Required Field',
1036 ],
1037 ],
1038 ],
1039
1040 'billing_state_label' => [
1041 'id' => 'billing_state_label',
1042 'label' => esc_html__( 'State label', 'shopbuilder' ),
1043 'type' => 'text',
1044 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1045 'dependency' => [
1046 'rules' => [
1047 [
1048 'item' => 'general.billing_form.billing_state',
1049 'value' => 'show',
1050 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1051 ],
1052 ],
1053 ],
1054 ],
1055 'billing_postcode_heading' => [
1056 'id' => 'billing_postcode_heading',
1057 'type' => 'title',
1058 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1059 ],
1060 'billing_postcode' => [
1061 'id' => 'billing_postcode',
1062 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1063 'type' => 'checkbox',
1064 'orientation' => 'vertical',
1065 'value' => [ 'show', 'required' ],
1066 'options' => [
1067 [
1068 'value' => 'show',
1069 'label' => 'Show Postcode / ZIP?',
1070 ],
1071 [
1072 'value' => 'required',
1073 'label' => 'Required Field',
1074 ],
1075 ],
1076 ],
1077 'billing_postcode_label' => [
1078 'id' => 'billing_postcode_label',
1079 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1080 'type' => 'text',
1081 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1082 'dependency' => [
1083 'rules' => [
1084 [
1085 'item' => 'general.billing_form.billing_postcode',
1086 'value' => 'show',
1087 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1088 ],
1089 ],
1090 ],
1091 ],
1092 'billing_postcode_placeholder' => [
1093 'id' => 'billing_postcode_placeholder',
1094 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1095 'type' => 'text',
1096 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1097 'dependency' => [
1098 'rules' => [
1099 [
1100 'item' => 'general.billing_form.billing_postcode',
1101 'value' => 'show',
1102 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1103 ],
1104 ],
1105 ],
1106 ],
1107 'billing_phone_heading' => [
1108 'id' => 'billing_phone_heading',
1109 'type' => 'title',
1110 'label' => esc_html__( 'Phone', 'shopbuilder' ),
1111 ],
1112 'billing_phone' => [
1113 'id' => 'billing_phone',
1114 'label' => esc_html__( 'Phone', 'shopbuilder' ),
1115 'type' => 'checkbox',
1116 'orientation' => 'vertical',
1117 'value' => [
1118 'show',
1119 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
1120 ],
1121 'options' => [
1122 [
1123 'value' => 'show',
1124 'label' => 'Show Phone Field?',
1125 ],
1126 [
1127 'value' => 'required',
1128 'label' => 'Required Field',
1129 ],
1130 ],
1131
1132 ],
1133 'billing_phone_label' => [
1134 'id' => 'billing_phone_label',
1135 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
1136 'type' => 'text',
1137 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1138 'dependency' => [
1139 'rules' => [
1140 [
1141 'item' => 'general.billing_form.billing_phone',
1142 'value' => 'show',
1143 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1144 ],
1145 ],
1146 ],
1147 ],
1148 'billing_phone_placeholder' => [
1149 'id' => 'billing_phone_placeholder',
1150 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
1151 'type' => 'text',
1152 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1153 'dependency' => [
1154 'rules' => [
1155 [
1156 'item' => 'general.billing_form.billing_phone',
1157 'value' => 'show',
1158 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1159 ],
1160 ],
1161 ],
1162 ],
1163 'billing_email_heading' => [
1164 'id' => 'billing_email_heading',
1165 'type' => 'title',
1166 'label' => esc_html__( 'Email', 'shopbuilder' ),
1167 ],
1168 'billing_email' => [
1169 'id' => 'billing_email',
1170 'label' => esc_html__( 'Email address', 'shopbuilder' ),
1171 'type' => 'checkbox',
1172 'orientation' => 'vertical',
1173 'value' => [ 'show', 'required' ],
1174 'options' => [
1175 [
1176 'value' => 'show',
1177 'label' => 'Show Email address Field?',
1178 ],
1179 [
1180 'value' => 'required',
1181 'label' => 'Required Field',
1182 ],
1183 ],
1184 ],
1185 'billing_email_label' => [
1186 'id' => 'billing_email_label',
1187 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
1188 'type' => 'text',
1189 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1190 'dependency' => [
1191 'rules' => [
1192 [
1193 'item' => 'general.billing_form.billing_email',
1194 'value' => 'show',
1195 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1196 ],
1197 ],
1198 ],
1199 ],
1200 'billing_email_placeholder' => [
1201 'id' => 'billing_email_placeholder',
1202 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
1203 'type' => 'text',
1204 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1205 'dependency' => [
1206 'rules' => [
1207 [
1208 'item' => 'general.billing_form.billing_email',
1209 'value' => 'show',
1210 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1211 ],
1212 ],
1213 ],
1214 ],
1215 ],
1216
1217 ]
1218 ),
1219 'shipping_form' => apply_filters(
1220 'rtsb/module/shipping_form/options',
1221 [
1222 'id' => 'shipping_form',
1223 'icon' => SvgIcons::get( 'shipping_form' ),
1224 'category' => 'checkout',
1225 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
1226 'package' => 'free',
1227 'links' => [
1228 'doc' => '',
1229 'video' => '',
1230 ],
1231 'active_field' => [
1232 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1233 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
1234 ],
1235 'fields' => [
1236 'checkout_shipping_info' => [
1237 'id' => 'checkout_shipping_info',
1238 'type' => 'deprecated',
1239 'label' => __( '<strong>Deprecated:</strong> Shipping Form Settings is deprecated. Please use the <strong><u>Checkout Fields Editor</u></strong> module to customize checkout fields. These settings will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is active.', 'shopbuilder' ),
1240 'customClass' => 'checkout-notice',
1241 'before_active' => true,
1242 ],
1243 'shipping_first_name_heading' => [
1244 'id' => 'shipping_first_name_heading',
1245 'type' => 'title',
1246 'label' => esc_html__( 'First Name', 'shopbuilder' ),
1247 ],
1248 'shipping_first_name' => [
1249 'id' => 'shipping_first_name',
1250 'label' => esc_html__( 'First name', 'shopbuilder' ),
1251 'type' => 'checkbox',
1252 'orientation' => 'vertical',
1253 'value' => [ 'show', 'required' ],
1254 'options' => [
1255 [
1256 'value' => 'show',
1257 'label' => 'Show First name?',
1258 ],
1259 [
1260 'value' => 'required',
1261 'label' => 'Required Field',
1262 ],
1263 ],
1264 ],
1265 'shipping_first_name_label' => [
1266 'id' => 'shipping_first_name_label',
1267 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
1268 'type' => 'text',
1269 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1270 'dependency' => [
1271 'rules' => [
1272 [
1273 'item' => 'general.shipping_form.shipping_first_name',
1274 'value' => 'show',
1275 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1276 ],
1277 ],
1278 ],
1279 ],
1280 'shipping_first_name_placeholder' => [
1281 'id' => 'shipping_first_name_placeholder',
1282 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
1283 'type' => 'text',
1284 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1285 'dependency' => [
1286 'rules' => [
1287 [
1288 'item' => 'general.shipping_form.shipping_first_name',
1289 'value' => 'show',
1290 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1291 ],
1292 ],
1293 ],
1294 ],
1295 'shipping_first_last_heading' => [
1296 'id' => 'shipping_first_last_heading',
1297 'type' => 'title',
1298 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
1299 ],
1300 'shipping_last_name' => [
1301 'id' => 'shipping_last_name',
1302 'label' => esc_html__( 'Last name', 'shopbuilder' ),
1303 'type' => 'checkbox',
1304 'orientation' => 'vertical',
1305 'value' => [ 'show', 'required' ],
1306 'options' => [
1307 [
1308 'value' => 'show',
1309 'label' => 'Show Last name?',
1310 ],
1311 [
1312 'value' => 'required',
1313 'label' => 'Required Field',
1314 ],
1315 ],
1316 ],
1317
1318 'shipping_last_name_label' => [
1319 'id' => 'shipping_last_name_label',
1320 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
1321 'type' => 'text',
1322 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1323 'dependency' => [
1324 'rules' => [
1325 [
1326 'item' => 'general.shipping_form.shipping_last_name',
1327 'value' => 'show',
1328 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1329 ],
1330 ],
1331 ],
1332 ],
1333 'shipping_last_name_placeholder' => [
1334 'id' => 'shipping_last_name_placeholder',
1335 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
1336 'type' => 'text',
1337 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1338 'dependency' => [
1339 'rules' => [
1340 [
1341 'item' => 'general.shipping_form.shipping_last_name',
1342 'value' => 'show',
1343 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1344 ],
1345 ],
1346 ],
1347 ],
1348 'shipping_company_heading' => [
1349 'id' => 'shipping_company_heading',
1350 'type' => 'title',
1351 'label' => esc_html__( 'Company', 'shopbuilder' ),
1352 ],
1353 'shipping_company' => [
1354 'id' => 'shipping_company',
1355 'label' => esc_html__( 'Company name', 'shopbuilder' ),
1356 'type' => 'checkbox',
1357 'orientation' => 'vertical',
1358 'value' => [ 'show', 'required' ],
1359 'options' => [
1360 [
1361 'value' => 'show',
1362 'label' => 'Show company name?',
1363 ],
1364 [
1365 'value' => 'required',
1366 'label' => 'Required Field',
1367 ],
1368 ],
1369 ],
1370
1371 'shipping_company_label' => [
1372 'id' => 'shipping_company_label',
1373 'label' => esc_html__( 'Company label', 'shopbuilder' ),
1374 'type' => 'text',
1375 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1376 'dependency' => [
1377 'rules' => [
1378 [
1379 'item' => 'general.shipping_form.shipping_company',
1380 'value' => 'show',
1381 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1382 ],
1383 ],
1384 ],
1385 ],
1386 'shipping_company_placeholder' => [
1387 'id' => 'shipping_company_placeholder',
1388 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1389 'type' => 'text',
1390 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1391 'dependency' => [
1392 'rules' => [
1393 [
1394 'item' => 'general.shipping_form.shipping_company',
1395 'value' => 'show',
1396 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1397 ],
1398 ],
1399 ],
1400 ],
1401 'shipping_country_heading' => [
1402 'id' => 'shipping_country_heading',
1403 'type' => 'title',
1404 'label' => esc_html__( 'Country', 'shopbuilder' ),
1405 ],
1406 'shipping_country' => [
1407 'id' => 'shipping_country',
1408 'label' => esc_html__( 'Country', 'shopbuilder' ),
1409 'type' => 'checkbox',
1410 'orientation' => 'vertical',
1411 'value' => [ 'show', 'required' ],
1412 'options' => [
1413 [
1414 'value' => 'show',
1415 'label' => 'Show Country?',
1416 ],
1417 [
1418 'value' => 'required',
1419 'label' => 'Required Field',
1420 ],
1421 ],
1422 ],
1423
1424 'shipping_country_label' => [
1425 'id' => 'shipping_country_label',
1426 'label' => esc_html__( 'Country label', 'shopbuilder' ),
1427 'type' => 'text',
1428 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1429 'dependency' => [
1430 'rules' => [
1431 [
1432 'item' => 'general.shipping_form.shipping_country',
1433 'value' => 'show',
1434 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1435 ],
1436 ],
1437 ],
1438 ],
1439 'shipping_address_1_heading' => [
1440 'id' => 'shipping_address_1_heading',
1441 'type' => 'title',
1442 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1443 ],
1444 'shipping_address_1' => [
1445 'id' => 'shipping_address_1',
1446 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1447 'type' => 'checkbox',
1448 'orientation' => 'vertical',
1449 'value' => [ 'show', 'required' ],
1450 'options' => [
1451 [
1452 'value' => 'show',
1453 'label' => 'Show Address field?',
1454 ],
1455 [
1456 'value' => 'required',
1457 'label' => 'Required Field',
1458 ],
1459 ],
1460 ],
1461
1462 'shipping_address_1_label' => [
1463 'id' => 'shipping_address_1_label',
1464 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1465 'type' => 'text',
1466 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1467 'dependency' => [
1468 'rules' => [
1469 [
1470 'item' => 'general.shipping_form.shipping_address_1',
1471 'value' => 'show',
1472 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1473 ],
1474 ],
1475 ],
1476 ],
1477 'shipping_address_1_placeholder' => [
1478 'id' => 'shipping_address_1_placeholder',
1479 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1480 'type' => 'text',
1481 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1482 'dependency' => [
1483 'rules' => [
1484 [
1485 'item' => 'general.shipping_form.shipping_address_1',
1486 'value' => 'show',
1487 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1488 ],
1489 ],
1490 ],
1491 ],
1492 'shipping_address_2_heading' => [
1493 'id' => 'shipping_address_2_heading',
1494 'type' => 'title',
1495 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1496 'dependency' => [
1497 'rules' => [
1498 [
1499 'item' => 'general.shipping_form.shipping_address_1',
1500 'value' => 'show',
1501 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1502 ],
1503 ],
1504 ],
1505 ],
1506 'shipping_address_2' => [
1507 'id' => 'shipping_address_2',
1508 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1509 'type' => 'checkbox',
1510 'orientation' => 'vertical',
1511 'value' => [ 'show' ],
1512 'options' => [
1513 [
1514 'value' => 'show',
1515 'label' => 'Show Address field?',
1516 ],
1517 ],
1518 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1519 'dependency' => [
1520 'rules' => [
1521 [
1522 'item' => 'general.shipping_form.shipping_address_1',
1523 'value' => 'show',
1524 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1525 ],
1526 ],
1527 ],
1528 ],
1529
1530 'shipping_address_2_label' => [
1531 'id' => 'shipping_address_2_label',
1532 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1533 'type' => 'text',
1534 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1535 'dependency' => [
1536 'rules' => [
1537 [
1538 'item' => 'general.shipping_form.shipping_address_1',
1539 'value' => 'show',
1540 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1541 ],
1542 [
1543 'item' => 'general.shipping_form.shipping_address_2',
1544 'value' => 'show',
1545 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1546 ],
1547 ],
1548 ],
1549 ],
1550 'shipping_address_2_placeholder' => [
1551 'id' => 'shipping_address_2_placeholder',
1552 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1553 'type' => 'text',
1554 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1555 'dependency' => [
1556 'rules' => [
1557 [
1558 'item' => 'general.shipping_form.shipping_address_1',
1559 'value' => 'show',
1560 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1561 ],
1562 [
1563 'item' => 'general.shipping_form.shipping_address_2',
1564 'value' => 'show',
1565 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1566 ],
1567 ],
1568 ],
1569 ],
1570 'shipping_city_heading' => [
1571 'id' => 'shipping_city_heading',
1572 'type' => 'title',
1573 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1574 ],
1575 'shipping_city' => [
1576 'id' => 'shipping_city',
1577 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1578 'type' => 'checkbox',
1579 'orientation' => 'vertical',
1580 'value' => [ 'show', 'required' ],
1581 'options' => [
1582 [
1583 'value' => 'show',
1584 'label' => 'Show Town / City?',
1585 ],
1586 [
1587 'value' => 'required',
1588 'label' => 'Required Field',
1589 ],
1590 ],
1591 ],
1592 'shipping_city_label' => [
1593 'id' => 'shipping_city_label',
1594 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1595 'type' => 'text',
1596 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1597 'dependency' => [
1598 'rules' => [
1599 [
1600 'item' => 'general.shipping_form.shipping_city',
1601 'value' => 'show',
1602 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1603 ],
1604 ],
1605 ],
1606 ],
1607 'shipping_city_placeholder' => [
1608 'id' => 'shipping_city_placeholder',
1609 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1610 'type' => 'text',
1611 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1612 'dependency' => [
1613 'rules' => [
1614 [
1615 'item' => 'general.shipping_form.shipping_city',
1616 'value' => 'show',
1617 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1618 ],
1619 ],
1620 ],
1621 ],
1622 'shipping_state_heading' => [
1623 'id' => 'shipping_state_heading',
1624 'type' => 'title',
1625 'label' => esc_html__( 'Others', 'shopbuilder' ),
1626 ],
1627 'shipping_state' => [
1628 'id' => 'shipping_state',
1629 'label' => esc_html__( 'State', 'shopbuilder' ),
1630 'type' => 'checkbox',
1631 'orientation' => 'vertical',
1632 'value' => [ 'show', 'required' ],
1633 'options' => [
1634 [
1635 'value' => 'show',
1636 'label' => 'Show State?',
1637 ],
1638 [
1639 'value' => 'required',
1640 'label' => 'Required Field',
1641 ],
1642 ],
1643 ],
1644 'shipping_postcode' => [
1645 'id' => 'shipping_postcode',
1646 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1647 'type' => 'checkbox',
1648 'orientation' => 'vertical',
1649 'value' => [ 'show', 'required' ],
1650 'options' => [
1651 [
1652 'value' => 'show',
1653 'label' => 'Show Postcode / ZIP?',
1654 ],
1655 ],
1656 ],
1657
1658 ],
1659 ]
1660 ),
1661
1662 ];
1663
1664 if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1665 unset( $list['optimization']['fields']['load_elementor_scripts'] );
1666 }
1667 return apply_filters( 'rtsb/core/general_settings/raw_list', $list );
1668 }
1669
1670 /**
1671 * Get the Data Training Note field.
1672 *
1673 * @param string $tool Meta values.
1674 * @return array
1675 */
1676 public function get_data_training_note_field( $tool ): array {
1677 $progress = get_option( 'rtsb_embedding_progress', [ 'processed' => 0 ] );
1678 $total = AIFns::need_product_embedding();
1679 $processed = (int) $progress['processed'];
1680 $remaining = max( $total - $processed, 0 );
1681 $generate_url = add_query_arg(
1682 [
1683 rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
1684 'action' => 'rtsb_start_embedding_process',
1685 ],
1686 admin_url( 'admin.php?page=rtsb-settings' )
1687 );
1688
1689 if ( wp_next_scheduled( 'rtsb_embedding_cron_run' ) ) {
1690 $text = esc_html__( 'Processing embeddings in the background. You can continue using the site.', 'shopbuilder' );
1691 } else {
1692 if ( $remaining > 0 ) {
1693 // Build the correct text based on embedding progress.
1694 $text = sprintf(
1695 '%1$s <a class="rtsb-generate-embedding" href="%2$s">%3$s</a>',
1696 esc_html__( 'Make Compatible your existing products with semantic search process.', 'shopbuilder' ),
1697 esc_url( $generate_url ),
1698 esc_html__( 'Generate Embeddings', 'shopbuilder' )
1699 );
1700 } else {
1701 $text = esc_html__( '🎉 Congratulations! All your products are successfully embedded and up to date.', 'shopbuilder' );
1702 }
1703 }
1704 $note = [
1705 'OpenAI' => [
1706 'id' => 'data_training_note_openai',
1707 'type' => 'description',
1708 'text' => $text,
1709 'dependency' => [
1710 'rules' => [
1711 [
1712 'item' => 'general.ai_implementation.ai_tools',
1713 'value' => 'OpenAI',
1714 'operator' => '==',
1715 ],
1716 [
1717 'item' => 'general.ai_implementation.gpt_api_key',
1718 'value' => '',
1719 'operator' => '!=',
1720 ],
1721 ],
1722 ],
1723 ],
1724 'Gemini' => [
1725 'id' => 'data_training_note_gemini',
1726 'type' => 'description',
1727 'text' => $text,
1728 'dependency' => [
1729 'rules' => [
1730 [
1731 'item' => 'general.ai_implementation.ai_tools',
1732 'value' => 'Gemini',
1733 'operator' => '==',
1734 ],
1735 [
1736 'item' => 'general.ai_implementation.gemini_api_key',
1737 'value' => '',
1738 'operator' => '!=',
1739 ],
1740 ],
1741 ],
1742 ],
1743 'missingGeminiKey' => [
1744 'id' => 'data_training_note_missing_gemneni_key',
1745 'type' => 'description',
1746 'text' => esc_html__( 'Missing Gemini API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1747 'dependency' => [
1748 'rules' => [
1749 [
1750 'item' => 'general.ai_implementation.ai_tools',
1751 'value' => 'Gemini',
1752 'operator' => '==',
1753 ],
1754 [
1755 'item' => 'general.ai_implementation.gemini_api_key',
1756 'value' => '',
1757 'operator' => '==',
1758 ],
1759 ],
1760 ],
1761 ],
1762 'missingOpenAIKey' => [
1763 'id' => 'data_training_note_missing_openai_key',
1764 'type' => 'description',
1765 'text' => esc_html__( 'Missing OpenAI API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1766 'dependency' => [
1767 'rules' => [
1768 [
1769 'item' => 'general.ai_implementation.ai_tools',
1770 'value' => 'OpenAI',
1771 'operator' => '==',
1772 ],
1773 [
1774 'item' => 'general.ai_implementation.gpt_api_key',
1775 'value' => '',
1776 'operator' => '==',
1777 ],
1778 ],
1779 ],
1780 ],
1781 ];
1782 return $note[ $tool ] ?? [];
1783 }
1784 }
1785