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