PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.0
ShopBuilder – WooCommerce Builder For Elementor v3.4.0
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 2.3.0 All 62 releases
shopbuilder / app / Models / GeneralList.php

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

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