PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.13
ShopBuilder – WooCommerce Builder For Elementor v2.1.13
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
← All changes | app/Models/GeneralList.php +163 -573 3.4.12.1.13 View file →
@@ -1,11 +1,11 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Models;
4 4
5 -use RadiusTheme\SB\AI\AIFns;
5 +// use RadiusTheme\SB\Helpers\Fns;
6 +use RadiusTheme\SB\Elementor\Helper\ControlHelper;
6 7 use RadiusTheme\SB\Helpers\Fns;
7 -use RadiusTheme\SB\Helpers\SvgIcons;
8 8 use RadiusTheme\SB\Models\Base\ListModel;
9 9 use RadiusTheme\SB\Traits\SingletonTrait;
10 10
11 11 defined( 'ABSPATH' ) || exit;
@@ -51,403 +51,15 @@
51 51 * @return array
52 52 */
53 53 protected function raw_list() {
54 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;">✅ 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' ),
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(
55 + 'notification' => apply_filters(
439 56 'rtsb/settings/notification/options',
440 57 [
441 58 'id' => 'notification',
442 - 'icon' => SvgIcons::get( 'notification' ),
443 59 'category' => 'general',
444 60 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ),
445 61 'package' => 'free',
446 - 'links' => [
447 - 'doc' => '',
448 - 'video' => '',
449 - ],
450 62 'active_field' => [
451 63 'disable' => true,
452 64 ],
453 65 'fields' => [
@@ -470,21 +82,8 @@
470 82 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
471 83 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
472 84 ],
473 85 ],
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 86 'notification_color' => [
488 87 'id' => 'notification_color',
489 88 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
490 89 'type' => 'color',
@@ -510,20 +109,15 @@
510 109 ],
511 110 ],
512 111 ],
513 112 ),
514 - 'social_share' => apply_filters(
113 + 'social_share' => apply_filters(
515 114 'rtsb/settings/social_share/options',
516 115 [
517 116 'id' => 'social_share',
518 - 'icon' => SvgIcons::get( 'social_share' ),
519 117 'category' => 'general',
520 118 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
521 119 'package' => 'free',
522 - 'links' => [
523 - 'doc' => '',
524 - 'video' => '',
525 - ],
526 120 'active_field' => [
527 121 'disable' => true,
528 122 ],
529 123 'fields' => [
@@ -545,8 +139,25 @@
545 139 'type' => 'switch',
546 140 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
547 141 '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 142 ],
143 + /*
144 + * TODO : Implement later.
145 + 'share_icon_show_to_product_page' => array(
146 + 'id' => 'share_icon_show_to_product_page',
147 + 'type' => 'switch',
148 + 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
149 + 'dependency' => [
150 + 'rules' => [
151 + [
152 + 'item' => 'general.social_share.share_platforms_to_product_page',
153 + 'value' => 'on',
154 + 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
155 + ],
156 + ],
157 + ],
158 + ),
159 + */
549 160 'share_icon_layout' => [
550 161 'type' => 'select',
551 162 'value' => 'share-layout1',
552 163 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -566,70 +177,49 @@
566 177 ],
567 178 ],
568 179 ],
569 180 ),
570 - 'guest_user' => apply_filters(
181 + 'guest_user' => apply_filters(
571 182 'rtsb/settings/guest_user/options',
572 183 [
573 184 'id' => 'guest_user',
574 - 'icon' => SvgIcons::get( 'guest_user' ),
575 185 'category' => 'general',
576 186 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
577 187 'package' => $this->pro_package(),
578 - 'links' => [
579 - 'doc' => '',
580 - 'video' => '',
581 - ],
582 188 'active_field' => [
583 189 'disable' => true,
584 190 ],
585 191 ],
586 192 ),
587 - 'tooltip' => apply_filters(
193 + 'tooltip' => apply_filters(
588 194 'rtsb/settings/tooltip/options',
589 195 [
590 196 'id' => 'tooltip',
591 - 'icon' => SvgIcons::get( 'tooltip' ),
592 197 'category' => 'general',
593 198 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
594 199 'package' => $this->pro_package(),
595 - 'links' => [
596 - 'doc' => '',
597 - 'video' => '',
598 - ],
599 200 'active_field' => [
600 201 'disable' => true,
601 202 ],
602 203 ],
603 204 ),
604 - 'billing_form' => apply_filters(
205 + 'billing_form' => apply_filters(
605 206 'rtsb/settings/billing_form/options',
606 207 [
607 208 'id' => 'billing_form',
608 - 'icon' => SvgIcons::get( 'billing_form' ),
609 209 'category' => 'checkout',
610 210 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
611 211 'package' => 'free',
612 - 'links' => [
613 - 'doc' => '',
614 - 'video' => '',
615 - ],
616 212 'active_field' => [
617 - 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
618 - 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
213 + 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
214 + 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
619 215 ],
620 216 '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 217 'billing_first_name_heading' => [
629 218 'id' => 'billing_first_name_heading',
630 219 'type' => 'title',
631 220 'label' => esc_html__( 'First Name', 'shopbuilder' ),
221 + // 'tab' => 'name',
632 222 ],
633 223 'billing_first_name' => [
634 224 'id' => 'billing_first_name',
635 225 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -645,8 +235,9 @@
645 235 'value' => 'required',
646 236 'label' => 'Required Field',
647 237 ],
648 238 ],
239 + // 'tab' => 'name',
649 240 ],
650 241 'billing_first_name_label' => [
651 242 'id' => 'billing_first_name_label',
652 243 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -651,14 +242,15 @@
651 242 'id' => 'billing_first_name_label',
652 243 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
653 244 'type' => 'text',
654 245 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
246 + // 'tab' => 'name',
655 247 'dependency' => [
656 248 'rules' => [
657 249 [
658 250 'item' => 'general.billing_form.billing_first_name',
659 251 'value' => 'show',
660 - 'operator' => '==',
252 + 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
661 253 ],
662 254 ],
663 255 ],
664 256 ],
@@ -666,14 +258,15 @@
666 258 'id' => 'billing_first_name_placeholder',
667 259 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
668 260 'type' => 'text',
669 261 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
262 + // 'tab' => 'name',
670 263 'dependency' => [
671 264 'rules' => [
672 265 [
673 266 'item' => 'general.billing_form.billing_first_name',
674 267 'value' => 'show',
675 - 'operator' => '==',
268 + 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
676 269 ],
677 270 ],
678 271 ],
679 272 ],
@@ -681,8 +274,9 @@
681 274 'billing_last_name_heading' => [
682 275 'id' => 'billing_last_name_heading',
683 276 'type' => 'title',
684 277 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
278 + // 'tab' => 'name',
685 279 ],
686 280 'billing_last_name' => [
687 281 'id' => 'billing_last_name',
688 282 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -698,8 +292,9 @@
698 292 'value' => 'required',
699 293 'label' => 'Required Field',
700 294 ],
701 295 ],
296 + // 'tab' => 'name',
702 297 ],
703 298
704 299 'billing_last_name_label' => [
705 300 'id' => 'billing_last_name_label',
@@ -705,8 +300,9 @@
705 300 'id' => 'billing_last_name_label',
706 301 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
707 302 'type' => 'text',
708 303 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
304 + // 'tab' => 'name',
709 305 'dependency' => [
710 306 'rules' => [
711 307 [
712 308 'item' => 'general.billing_form.billing_last_name',
@@ -720,8 +316,9 @@
720 316 'id' => 'billing_last_name_placeholder',
721 317 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
722 318 'type' => 'text',
723 319 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
320 + // 'tab' => 'name',
724 321 'dependency' => [
725 322 'rules' => [
726 323 [
727 324 'item' => 'general.billing_form.billing_last_name',
@@ -735,8 +332,9 @@
735 332 'billing_company_heading' => [
736 333 'id' => 'billing_company_heading',
737 334 'type' => 'title',
738 335 'label' => esc_html__( 'Company', 'shopbuilder' ),
336 + // 'tab' => 'company',
739 337 ],
740 338 'billing_company' => [
741 339 'id' => 'billing_company',
742 340 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -755,8 +353,9 @@
755 353 'value' => 'required',
756 354 'label' => 'Required Field',
757 355 ],
758 356 ],
357 + // 'tab' => 'company',
759 358 ],
760 359
761 360 'billing_company_label' => [
762 361 'id' => 'billing_company_label',
@@ -762,8 +361,9 @@
762 361 'id' => 'billing_company_label',
763 362 'label' => esc_html__( 'Company label', 'shopbuilder' ),
764 363 'type' => 'text',
765 364 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
365 + // 'tab' => 'company',
766 366 'dependency' => [
767 367 'rules' => [
768 368 [
769 369 'item' => 'general.billing_form.billing_company',
@@ -777,8 +377,9 @@
777 377 'id' => 'billing_company_placeholder',
778 378 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
779 379 'type' => 'text',
780 380 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
381 + // 'tab' => 'company',
781 382 'dependency' => [
782 383 'rules' => [
783 384 [
784 385 'item' => 'general.billing_form.billing_company',
@@ -792,8 +393,9 @@
792 393 'billing_country_heading' => [
793 394 'id' => 'billing_country_heading',
794 395 'type' => 'title',
795 396 'label' => esc_html__( 'Country', 'shopbuilder' ),
397 + // 'tab' => 'country',
796 398 ],
797 399 'billing_country' => [
798 400 'id' => 'billing_country',
799 401 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -799,18 +401,22 @@
799 401 'label' => esc_html__( 'Country', 'shopbuilder' ),
800 402 'type' => 'checkbox',
801 403 'orientation' => 'vertical',
802 404 'value' => [ 'show', 'required' ],
405 + // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
803 406 'options' => [
804 407 [
805 408 'value' => 'show',
806 409 'label' => 'Show Country?',
410 + // 'disabled' => true,
807 411 ],
808 412 [
809 413 'value' => 'required',
810 414 'label' => 'Required Field',
415 + // 'disabled' => true,
811 416 ],
812 417 ],
418 + // 'tab' => 'country',
813 419 ],
814 420
815 421 'billing_country_label' => [
816 422 'id' => 'billing_country_label',
@@ -816,8 +422,9 @@
816 422 'id' => 'billing_country_label',
817 423 'label' => esc_html__( 'Country label', 'shopbuilder' ),
818 424 'type' => 'text',
819 425 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
426 + // 'tab' => 'country',
820 427 'dependency' => [
821 428 'rules' => [
822 429 [
823 430 'item' => 'general.billing_form.billing_country',
@@ -830,8 +437,9 @@
830 437 'billing_address_1_heading' => [
831 438 'id' => 'billing_address_1_heading',
832 439 'type' => 'title',
833 440 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
441 + // 'tab' => 'address',
834 442 ],
835 443 'billing_address_1' => [
836 444 'id' => 'billing_address_1',
837 445 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -847,8 +455,9 @@
847 455 'value' => 'required',
848 456 'label' => 'Required Field',
849 457 ],
850 458 ],
459 + // 'tab' => 'address',
851 460 ],
852 461
853 462 'billing_address_1_label' => [
854 463 'id' => 'billing_address_1_label',
@@ -854,8 +463,9 @@
854 463 'id' => 'billing_address_1_label',
855 464 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
856 465 'type' => 'text',
857 466 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
467 + // 'tab' => 'address',
858 468 'dependency' => [
859 469 'rules' => [
860 470 [
861 471 'item' => 'general.billing_form.billing_address_1',
@@ -869,8 +479,9 @@
869 479 'id' => 'billing_address_1_placeholder',
870 480 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
871 481 'type' => 'text',
872 482 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
483 + // 'tab' => 'address',
873 484 'dependency' => [
874 485 'rules' => [
875 486 [
876 487 'item' => 'general.billing_form.billing_address_1',
@@ -883,8 +494,9 @@
883 494 'billing_address_2_heading' => [
884 495 'id' => 'billing_address_2_heading',
885 496 'type' => 'title',
886 497 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
498 + // 'tab' => 'address',
887 499 'dependency' => [
888 500 'rules' => [
889 501 [
890 502 'item' => 'general.billing_form.billing_address_1',
@@ -898,8 +510,9 @@
898 510 'id' => 'billing_address_2',
899 511 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
900 512 'type' => 'checkbox',
901 513 'orientation' => 'vertical',
514 + // 'tab' => 'address',
902 515 'value' => [
903 516 'show',
904 517 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
905 518 ],
@@ -925,8 +538,9 @@
925 538 'id' => 'billing_address_2_label',
926 539 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
927 540 'type' => 'text',
928 541 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
542 + // 'tab' => 'address',
929 543 'dependency' => [
930 544 'rules' => [
931 545 [
932 546 'item' => 'general.billing_form.billing_address_1',
@@ -945,8 +559,9 @@
945 559 'id' => 'billing_address_2_placeholder',
946 560 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
947 561 'type' => 'text',
948 562 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
563 + // 'tab' => 'address',
949 564 'dependency' => [
950 565 'rules' => [
951 566 [
952 567 'item' => 'general.billing_form.billing_address_1',
@@ -964,8 +579,9 @@
964 579 'billing_city_heading' => [
965 580 'id' => 'billing_city_heading',
966 581 'type' => 'title',
967 582 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
583 + // 'tab' => 'city',
968 584 ],
969 585 'billing_city' => [
970 586 'id' => 'billing_city',
971 587 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -971,8 +587,9 @@
971 587 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
972 588 'type' => 'checkbox',
973 589 'orientation' => 'vertical',
974 590 'value' => [ 'show', 'required' ],
591 + // 'tab' => 'city',
975 592 'options' => [
976 593 [
977 594 'value' => 'show',
978 595 'label' => 'Show Town / City?',
@@ -988,8 +605,9 @@
988 605 'id' => 'billing_city_label',
989 606 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
990 607 'type' => 'text',
991 608 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
609 + // 'tab' => 'city',
992 610 'dependency' => [
993 611 'rules' => [
994 612 [
995 613 'item' => 'general.billing_form.billing_city',
@@ -1003,8 +621,9 @@
1003 621 'id' => 'billing_city_placeholder',
1004 622 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
1005 623 'type' => 'text',
1006 624 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
625 + // 'tab' => 'city',
1007 626 'dependency' => [
1008 627 'rules' => [
1009 628 [
1010 629 'item' => 'general.billing_form.billing_city',
@@ -1017,8 +636,9 @@
1017 636 'billing_state_heading' => [
1018 637 'id' => 'billing_city_heading',
1019 638 'type' => 'title',
1020 639 'label' => esc_html__( 'State', 'shopbuilder' ),
640 + // 'tab' => 'state',
1021 641 ],
1022 642 'billing_state' => [
1023 643 'id' => 'billing_state',
1024 644 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1034,8 +654,9 @@
1034 654 'value' => 'required',
1035 655 'label' => 'Required Field',
1036 656 ],
1037 657 ],
658 + // 'tab' => 'state',
1038 659 ],
1039 660
1040 661 'billing_state_label' => [
1041 662 'id' => 'billing_state_label',
@@ -1041,8 +662,10 @@
1041 662 'id' => 'billing_state_label',
1042 663 'label' => esc_html__( 'State label', 'shopbuilder' ),
1043 664 'type' => 'text',
1044 665 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
666 + // 'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
667 + // 'tab' => 'state',
1045 668 'dependency' => [
1046 669 'rules' => [
1047 670 [
1048 671 'item' => 'general.billing_form.billing_state',
@@ -1055,8 +678,9 @@
1055 678 'billing_postcode_heading' => [
1056 679 'id' => 'billing_postcode_heading',
1057 680 'type' => 'title',
1058 681 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
682 + // 'tab' => 'postcode',
1059 683 ],
1060 684 'billing_postcode' => [
1061 685 'id' => 'billing_postcode',
1062 686 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -1072,8 +696,9 @@
1072 696 'value' => 'required',
1073 697 'label' => 'Required Field',
1074 698 ],
1075 699 ],
700 + // 'tab' => 'postcode',
1076 701 ],
1077 702 'billing_postcode_label' => [
1078 703 'id' => 'billing_postcode_label',
1079 704 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -1078,8 +703,9 @@
1078 703 'id' => 'billing_postcode_label',
1079 704 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1080 705 'type' => 'text',
1081 706 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
707 + // 'tab' => 'postcode',
1082 708 'dependency' => [
1083 709 'rules' => [
1084 710 [
1085 711 'item' => 'general.billing_form.billing_postcode',
@@ -1093,8 +719,9 @@
1093 719 'id' => 'billing_postcode_placeholder',
1094 720 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1095 721 'type' => 'text',
1096 722 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
723 + // 'tab' => 'postcode',
1097 724 'dependency' => [
1098 725 'rules' => [
1099 726 [
1100 727 'item' => 'general.billing_form.billing_postcode',
@@ -1107,8 +734,9 @@
1107 734 'billing_phone_heading' => [
1108 735 'id' => 'billing_phone_heading',
1109 736 'type' => 'title',
1110 737 'label' => esc_html__( 'Phone', 'shopbuilder' ),
738 + // 'tab' => 'phone',
1111 739 ],
1112 740 'billing_phone' => [
1113 741 'id' => 'billing_phone',
1114 742 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -1113,8 +741,9 @@
1113 741 'id' => 'billing_phone',
1114 742 'label' => esc_html__( 'Phone', 'shopbuilder' ),
1115 743 'type' => 'checkbox',
1116 744 'orientation' => 'vertical',
745 + // 'tab' => 'phone',
1117 746 'value' => [
1118 747 'show',
1119 748 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
1120 749 ],
@@ -1134,8 +763,9 @@
1134 763 'id' => 'billing_phone_label',
1135 764 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
1136 765 'type' => 'text',
1137 766 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
767 + // 'tab' => 'phone',
1138 768 'dependency' => [
1139 769 'rules' => [
1140 770 [
1141 771 'item' => 'general.billing_form.billing_phone',
@@ -1149,8 +779,9 @@
1149 779 'id' => 'billing_phone_placeholder',
1150 780 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
1151 781 'type' => 'text',
1152 782 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
783 + // 'tab' => 'phone',
1153 784 'dependency' => [
1154 785 'rules' => [
1155 786 [
1156 787 'item' => 'general.billing_form.billing_phone',
@@ -1163,8 +794,9 @@
1163 794 'billing_email_heading' => [
1164 795 'id' => 'billing_email_heading',
1165 796 'type' => 'title',
1166 797 'label' => esc_html__( 'Email', 'shopbuilder' ),
798 + // 'tab' => 'email',
1167 799 ],
1168 800 'billing_email' => [
1169 801 'id' => 'billing_email',
1170 802 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -1169,8 +801,9 @@
1169 801 'id' => 'billing_email',
1170 802 'label' => esc_html__( 'Email address', 'shopbuilder' ),
1171 803 'type' => 'checkbox',
1172 804 'orientation' => 'vertical',
805 + // 'tab' => 'email',
1173 806 'value' => [ 'show', 'required' ],
1174 807 'options' => [
1175 808 [
1176 809 'value' => 'show',
@@ -1186,8 +819,9 @@
1186 819 'id' => 'billing_email_label',
1187 820 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
1188 821 'type' => 'text',
1189 822 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
823 + // 'tab' => 'email',
1190 824 'dependency' => [
1191 825 'rules' => [
1192 826 [
1193 827 'item' => 'general.billing_form.billing_email',
@@ -1201,8 +835,9 @@
1201 835 'id' => 'billing_email_placeholder',
1202 836 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
1203 837 'type' => 'text',
1204 838 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
839 + // 'tab' => 'email',
1205 840 'dependency' => [
1206 841 'rules' => [
1207 842 [
1208 843 'item' => 'general.billing_form.billing_email',
@@ -1215,36 +850,25 @@
1215 850 ],
1216 851
1217 852 ]
1218 853 ),
1219 - 'shipping_form' => apply_filters(
854 + 'shipping_form' => apply_filters(
1220 855 'rtsb/module/shipping_form/options',
1221 856 [
1222 857 'id' => 'shipping_form',
1223 - 'icon' => SvgIcons::get( 'shipping_form' ),
1224 858 'category' => 'checkout',
1225 859 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
1226 860 'package' => 'free',
1227 - 'links' => [
1228 - 'doc' => '',
1229 - 'video' => '',
1230 - ],
1231 861 'active_field' => [
1232 - 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1233 - 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
862 + 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
863 + 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
1234 864 ],
1235 865 '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 866 'shipping_first_name_heading' => [
1244 867 'id' => 'shipping_first_name_heading',
1245 868 'type' => 'title',
1246 869 'label' => esc_html__( 'First Name', 'shopbuilder' ),
870 + // 'tab' => 'name',
1247 871 ],
1248 872 'shipping_first_name' => [
1249 873 'id' => 'shipping_first_name',
1250 874 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -1260,8 +884,9 @@
1260 884 'value' => 'required',
1261 885 'label' => 'Required Field',
1262 886 ],
1263 887 ],
888 + // 'tab' => 'name',
1264 889 ],
1265 890 'shipping_first_name_label' => [
1266 891 'id' => 'shipping_first_name_label',
1267 892 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -1266,8 +891,9 @@
1266 891 'id' => 'shipping_first_name_label',
1267 892 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
1268 893 'type' => 'text',
1269 894 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
895 + // 'tab' => 'name',
1270 896 'dependency' => [
1271 897 'rules' => [
1272 898 [
1273 899 'item' => 'general.shipping_form.shipping_first_name',
@@ -1281,8 +907,9 @@
1281 907 'id' => 'shipping_first_name_placeholder',
1282 908 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
1283 909 'type' => 'text',
1284 910 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
911 + // 'tab' => 'country',
1285 912 'dependency' => [
1286 913 'rules' => [
1287 914 [
1288 915 'item' => 'general.shipping_form.shipping_first_name',
@@ -1295,8 +922,9 @@
1295 922 'shipping_first_last_heading' => [
1296 923 'id' => 'shipping_first_last_heading',
1297 924 'type' => 'title',
1298 925 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
926 + // 'tab' => 'name',
1299 927 ],
1300 928 'shipping_last_name' => [
1301 929 'id' => 'shipping_last_name',
1302 930 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -1312,8 +940,9 @@
1312 940 'value' => 'required',
1313 941 'label' => 'Required Field',
1314 942 ],
1315 943 ],
944 + // 'tab' => 'name',
1316 945 ],
1317 946
1318 947 'shipping_last_name_label' => [
1319 948 'id' => 'shipping_last_name_label',
@@ -1319,8 +948,9 @@
1319 948 'id' => 'shipping_last_name_label',
1320 949 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
1321 950 'type' => 'text',
1322 951 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
952 + // 'tab' => 'name',
1323 953 'dependency' => [
1324 954 'rules' => [
1325 955 [
1326 956 'item' => 'general.shipping_form.shipping_last_name',
@@ -1334,8 +964,9 @@
1334 964 'id' => 'shipping_last_name_placeholder',
1335 965 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
1336 966 'type' => 'text',
1337 967 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
968 + // 'tab' => 'country',
1338 969 'dependency' => [
1339 970 'rules' => [
1340 971 [
1341 972 'item' => 'general.shipping_form.shipping_last_name',
@@ -1348,8 +979,9 @@
1348 979 'shipping_company_heading' => [
1349 980 'id' => 'shipping_company_heading',
1350 981 'type' => 'title',
1351 982 'label' => esc_html__( 'Company', 'shopbuilder' ),
983 + // 'tab' => 'name',
1352 984 ],
1353 985 'shipping_company' => [
1354 986 'id' => 'shipping_company',
1355 987 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -1365,8 +997,9 @@
1365 997 'value' => 'required',
1366 998 'label' => 'Required Field',
1367 999 ],
1368 1000 ],
1001 + // 'tab' => 'company',
1369 1002 ],
1370 1003
1371 1004 'shipping_company_label' => [
1372 1005 'id' => 'shipping_company_label',
@@ -1372,8 +1005,9 @@
1372 1005 'id' => 'shipping_company_label',
1373 1006 'label' => esc_html__( 'Company label', 'shopbuilder' ),
1374 1007 'type' => 'text',
1375 1008 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1009 + // 'tab' => 'company',
1376 1010 'dependency' => [
1377 1011 'rules' => [
1378 1012 [
1379 1013 'item' => 'general.shipping_form.shipping_company',
@@ -1387,8 +1021,9 @@
1387 1021 'id' => 'shipping_company_placeholder',
1388 1022 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1389 1023 'type' => 'text',
1390 1024 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1025 + // 'tab' => 'country',
1391 1026 'dependency' => [
1392 1027 'rules' => [
1393 1028 [
1394 1029 'item' => 'general.shipping_form.shipping_company',
@@ -1401,8 +1036,9 @@
1401 1036 'shipping_country_heading' => [
1402 1037 'id' => 'shipping_country_heading',
1403 1038 'type' => 'title',
1404 1039 'label' => esc_html__( 'Country', 'shopbuilder' ),
1040 + // 'tab' => 'name',
1405 1041 ],
1406 1042 'shipping_country' => [
1407 1043 'id' => 'shipping_country',
1408 1044 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1412,14 +1048,17 @@
1412 1048 'options' => [
1413 1049 [
1414 1050 'value' => 'show',
1415 1051 'label' => 'Show Country?',
1052 + // 'disabled' => true,
1416 1053 ],
1417 1054 [
1418 1055 'value' => 'required',
1419 1056 'label' => 'Required Field',
1057 + // 'disabled' => true,
1420 1058 ],
1421 1059 ],
1060 + // 'tab' => 'country',
1422 1061 ],
1423 1062
1424 1063 'shipping_country_label' => [
1425 1064 'id' => 'shipping_country_label',
@@ -1439,8 +1078,9 @@
1439 1078 'shipping_address_1_heading' => [
1440 1079 'id' => 'shipping_address_1_heading',
1441 1080 'type' => 'title',
1442 1081 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1082 + // 'tab' => 'name',
1443 1083 ],
1444 1084 'shipping_address_1' => [
1445 1085 'id' => 'shipping_address_1',
1446 1086 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1456,8 +1096,9 @@
1456 1096 'value' => 'required',
1457 1097 'label' => 'Required Field',
1458 1098 ],
1459 1099 ],
1100 + // 'tab' => 'country',
1460 1101 ],
1461 1102
1462 1103 'shipping_address_1_label' => [
1463 1104 'id' => 'shipping_address_1_label',
@@ -1463,8 +1104,9 @@
1463 1104 'id' => 'shipping_address_1_label',
1464 1105 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1465 1106 'type' => 'text',
1466 1107 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1108 + // 'tab' => 'country',
1467 1109 'dependency' => [
1468 1110 'rules' => [
1469 1111 [
1470 1112 'item' => 'general.shipping_form.shipping_address_1',
@@ -1478,8 +1120,9 @@
1478 1120 'id' => 'shipping_address_1_placeholder',
1479 1121 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1480 1122 'type' => 'text',
1481 1123 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1124 + // 'tab' => 'country',
1482 1125 'dependency' => [
1483 1126 'rules' => [
1484 1127 [
1485 1128 'item' => 'general.shipping_form.shipping_address_1',
@@ -1492,8 +1135,9 @@
1492 1135 'shipping_address_2_heading' => [
1493 1136 'id' => 'shipping_address_2_heading',
1494 1137 'type' => 'title',
1495 1138 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1139 + // 'tab' => 'name',
1496 1140 'dependency' => [
1497 1141 'rules' => [
1498 1142 [
1499 1143 'item' => 'general.shipping_form.shipping_address_1',
@@ -1515,8 +1159,9 @@
1515 1159 'label' => 'Show Address field?',
1516 1160 ],
1517 1161 ],
1518 1162 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1163 + // 'tab' => 'country',
1519 1164 'dependency' => [
1520 1165 'rules' => [
1521 1166 [
1522 1167 'item' => 'general.shipping_form.shipping_address_1',
@@ -1531,8 +1176,9 @@
1531 1176 'id' => 'shipping_address_2_label',
1532 1177 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1533 1178 'type' => 'text',
1534 1179 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1180 + // 'tab' => 'country',
1535 1181 'dependency' => [
1536 1182 'rules' => [
1537 1183 [
1538 1184 'item' => 'general.shipping_form.shipping_address_1',
@@ -1551,8 +1197,9 @@
1551 1197 'id' => 'shipping_address_2_placeholder',
1552 1198 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1553 1199 'type' => 'text',
1554 1200 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1201 + // 'tab' => 'country',
1555 1202 'dependency' => [
1556 1203 'rules' => [
1557 1204 [
1558 1205 'item' => 'general.shipping_form.shipping_address_1',
@@ -1570,8 +1217,9 @@
1570 1217 'shipping_city_heading' => [
1571 1218 'id' => 'shipping_city_heading',
1572 1219 'type' => 'title',
1573 1220 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1221 + // 'tab' => 'name',
1574 1222 ],
1575 1223 'shipping_city' => [
1576 1224 'id' => 'shipping_city',
1577 1225 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1587,8 +1235,9 @@
1587 1235 'value' => 'required',
1588 1236 'label' => 'Required Field',
1589 1237 ],
1590 1238 ],
1239 + // 'tab' => 'country',
1591 1240 ],
1592 1241 'shipping_city_label' => [
1593 1242 'id' => 'shipping_city_label',
1594 1243 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1593,8 +1242,9 @@
1593 1242 'id' => 'shipping_city_label',
1594 1243 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1595 1244 'type' => 'text',
1596 1245 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1246 + // 'tab' => 'country',
1597 1247 'dependency' => [
1598 1248 'rules' => [
1599 1249 [
1600 1250 'item' => 'general.shipping_form.shipping_city',
@@ -1608,8 +1258,9 @@
1608 1258 'id' => 'shipping_city_placeholder',
1609 1259 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1610 1260 'type' => 'text',
1611 1261 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1262 + // 'tab' => 'country',
1612 1263 'dependency' => [
1613 1264 'rules' => [
1614 1265 [
1615 1266 'item' => 'general.shipping_form.shipping_city',
@@ -1622,8 +1273,9 @@
1622 1273 'shipping_state_heading' => [
1623 1274 'id' => 'shipping_state_heading',
1624 1275 'type' => 'title',
1625 1276 'label' => esc_html__( 'Others', 'shopbuilder' ),
1277 + // 'tab' => 'name',
1626 1278 ],
1627 1279 'shipping_state' => [
1628 1280 'id' => 'shipping_state',
1629 1281 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1639,9 +1291,33 @@
1639 1291 'value' => 'required',
1640 1292 'label' => 'Required Field',
1641 1293 ],
1642 1294 ],
1295 + // 'tab' => 'country',
1643 1296 ],
1297 + //
1298 + // 'shipping_state_label' => [
1299 + // 'id' => 'shipping_state_label',
1300 + // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1301 + // 'type' => 'text',
1302 + // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1303 + // 'tab' => 'country',
1304 + // 'dependency' => [
1305 + // 'rules' => [
1306 + // [
1307 + // 'item' => 'general.shipping_form.shipping_state',
1308 + // 'value' => 'show',
1309 + // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1310 + // ],
1311 + // ],
1312 + // ],
1313 + // ],
1314 + // 'shipping_postcode_heading' => [
1315 + // 'id' => 'shipping_postcode_heading',
1316 + // 'type' => 'title',
1317 + // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1318 + // 'tab' => 'name',
1319 + // ],
1644 1320 'shipping_postcode' => [
1645 1321 'id' => 'shipping_postcode',
1646 1322 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1647 1323 'type' => 'checkbox',
@@ -1652,133 +1328,47 @@
1652 1328 'value' => 'show',
1653 1329 'label' => 'Show Postcode / ZIP?',
1654 1330 ],
1655 1331 ],
1332 + // 'tab' => 'country',
1656 1333 ],
1334 + // 'shipping_postcode_label' => [
1335 + // 'id' => 'shipping_postcode_label',
1336 + // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1337 + // 'type' => 'text',
1338 + // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1339 + // 'tab' => 'country',
1340 + // 'dependency' => [
1341 + // 'rules' => [
1342 + // [
1343 + // 'item' => 'general.shipping_form.shipping_postcode',
1344 + // 'value' => 'show',
1345 + // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1346 + // ],
1347 + // ],
1348 + // ],
1349 + // ],
1350 + // 'shipping_postcode_placeholder' => [
1351 + // 'id' => 'shipping_postcode_placeholder',
1352 + // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1353 + // 'type' => 'text',
1354 + // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1355 + // 'tab' => 'country',
1356 + // 'dependency' => [
1357 + // 'rules' => [
1358 + // [
1359 + // 'item' => 'general.shipping_form.shipping_postcode',
1360 + // 'value' => 'show',
1361 + // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1362 + // ],
1363 + // ],
1364 + // ],
1365 + // ],
1657 1366
1658 1367 ],
1659 1368 ]
1660 1369 ),
1661 -
1662 1370 ];
1663 1371
1664 - if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1665 - unset( $list['optimization']['fields']['load_elementor_scripts'] );
1666 - }
1667 1372 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 1373 }
1784 1374 }