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 +594 -162 2.1.23.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,19 +51,412 @@
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' => [
454 + 'notification_intro' => [
455 + 'id' => 'notification_intro',
456 + 'type' => 'description',
457 + 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
458 + ],
66 459 'notification_position' => [
67 460 'id' => 'notification_position',
68 461 'value' => 'center-center',
69 462 'type' => 'select',
@@ -77,8 +470,21 @@
77 470 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
78 471 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
79 472 ],
80 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 + ],
81 487 'notification_color' => [
82 488 'id' => 'notification_color',
83 489 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
84 490 'type' => 'color',
@@ -104,19 +510,29 @@
104 510 ],
105 511 ],
106 512 ],
107 513 ),
108 - 'social_share' => apply_filters(
514 + 'social_share' => apply_filters(
109 515 'rtsb/settings/social_share/options',
110 516 [
111 517 'id' => 'social_share',
518 + 'icon' => SvgIcons::get( 'social_share' ),
112 519 'category' => 'general',
113 520 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
114 521 'package' => 'free',
522 + 'links' => [
523 + 'doc' => '',
524 + 'video' => '',
525 + ],
115 526 'active_field' => [
116 527 'disable' => true,
117 528 ],
118 529 'fields' => [
530 + 'social_share_intro' => [
531 + 'id' => 'social_share_intro',
532 + 'type' => 'description',
533 + 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
534 + ],
119 535 'share_platforms' => [
120 536 'id' => 'share_platforms',
121 537 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
122 538 'type' => 'checkbox',
@@ -129,25 +545,8 @@
129 545 'type' => 'switch',
130 546 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
131 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' ),
132 548 ],
133 - /*
134 - * TODO : Implement later.
135 - 'share_icon_show_to_product_page' => array(
136 - 'id' => 'share_icon_show_to_product_page',
137 - 'type' => 'switch',
138 - 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
139 - 'dependency' => [
140 - 'rules' => [
141 - [
142 - 'item' => 'general.social_share.share_platforms_to_product_page',
143 - 'value' => 'on',
144 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
145 - ],
146 - ],
147 - ],
148 - ),
149 - */
150 549 'share_icon_layout' => [
151 550 'type' => 'select',
152 551 'value' => 'share-layout1',
153 552 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -167,37 +566,70 @@
167 566 ],
168 567 ],
169 568 ],
170 569 ),
171 - 'tooltip' => apply_filters(
570 + 'guest_user' => apply_filters(
571 + 'rtsb/settings/guest_user/options',
572 + [
573 + 'id' => 'guest_user',
574 + 'icon' => SvgIcons::get( 'guest_user' ),
575 + 'category' => 'general',
576 + 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
577 + 'package' => $this->pro_package(),
578 + 'links' => [
579 + 'doc' => '',
580 + 'video' => '',
581 + ],
582 + 'active_field' => [
583 + 'disable' => true,
584 + ],
585 + ],
586 + ),
587 + 'tooltip' => apply_filters(
172 588 'rtsb/settings/tooltip/options',
173 589 [
174 590 'id' => 'tooltip',
591 + 'icon' => SvgIcons::get( 'tooltip' ),
175 592 'category' => 'general',
176 593 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
177 594 'package' => $this->pro_package(),
595 + 'links' => [
596 + 'doc' => '',
597 + 'video' => '',
598 + ],
178 599 'active_field' => [
179 600 'disable' => true,
180 601 ],
181 602 ],
182 603 ),
183 - 'billing_form' => apply_filters(
604 + 'billing_form' => apply_filters(
184 605 'rtsb/settings/billing_form/options',
185 606 [
186 607 'id' => 'billing_form',
608 + 'icon' => SvgIcons::get( 'billing_form' ),
187 609 'category' => 'checkout',
188 610 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
189 611 'package' => 'free',
612 + 'links' => [
613 + 'doc' => '',
614 + 'video' => '',
615 + ],
190 616 'active_field' => [
191 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
192 - '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' ),
193 619 ],
194 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 + ],
195 628 'billing_first_name_heading' => [
196 629 'id' => 'billing_first_name_heading',
197 630 'type' => 'title',
198 631 'label' => esc_html__( 'First Name', 'shopbuilder' ),
199 - // 'tab' => 'name',
200 632 ],
201 633 'billing_first_name' => [
202 634 'id' => 'billing_first_name',
203 635 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -213,9 +645,8 @@
213 645 'value' => 'required',
214 646 'label' => 'Required Field',
215 647 ],
216 648 ],
217 - // 'tab' => 'name',
218 649 ],
219 650 'billing_first_name_label' => [
220 651 'id' => 'billing_first_name_label',
221 652 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -220,15 +651,14 @@
220 651 'id' => 'billing_first_name_label',
221 652 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
222 653 'type' => 'text',
223 654 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
224 - // 'tab' => 'name',
225 655 'dependency' => [
226 656 'rules' => [
227 657 [
228 658 'item' => 'general.billing_form.billing_first_name',
229 659 'value' => 'show',
230 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
660 + 'operator' => '==',
231 661 ],
232 662 ],
233 663 ],
234 664 ],
@@ -236,15 +666,14 @@
236 666 'id' => 'billing_first_name_placeholder',
237 667 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
238 668 'type' => 'text',
239 669 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
240 - // 'tab' => 'name',
241 670 'dependency' => [
242 671 'rules' => [
243 672 [
244 673 'item' => 'general.billing_form.billing_first_name',
245 674 'value' => 'show',
246 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
675 + 'operator' => '==',
247 676 ],
248 677 ],
249 678 ],
250 679 ],
@@ -252,9 +681,8 @@
252 681 'billing_last_name_heading' => [
253 682 'id' => 'billing_last_name_heading',
254 683 'type' => 'title',
255 684 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
256 - // 'tab' => 'name',
257 685 ],
258 686 'billing_last_name' => [
259 687 'id' => 'billing_last_name',
260 688 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -270,9 +698,8 @@
270 698 'value' => 'required',
271 699 'label' => 'Required Field',
272 700 ],
273 701 ],
274 - // 'tab' => 'name',
275 702 ],
276 703
277 704 'billing_last_name_label' => [
278 705 'id' => 'billing_last_name_label',
@@ -278,9 +705,8 @@
278 705 'id' => 'billing_last_name_label',
279 706 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
280 707 'type' => 'text',
281 708 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
282 - // 'tab' => 'name',
283 709 'dependency' => [
284 710 'rules' => [
285 711 [
286 712 'item' => 'general.billing_form.billing_last_name',
@@ -294,9 +720,8 @@
294 720 'id' => 'billing_last_name_placeholder',
295 721 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
296 722 'type' => 'text',
297 723 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
298 - // 'tab' => 'name',
299 724 'dependency' => [
300 725 'rules' => [
301 726 [
302 727 'item' => 'general.billing_form.billing_last_name',
@@ -310,9 +735,8 @@
310 735 'billing_company_heading' => [
311 736 'id' => 'billing_company_heading',
312 737 'type' => 'title',
313 738 'label' => esc_html__( 'Company', 'shopbuilder' ),
314 - // 'tab' => 'company',
315 739 ],
316 740 'billing_company' => [
317 741 'id' => 'billing_company',
318 742 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -331,9 +755,8 @@
331 755 'value' => 'required',
332 756 'label' => 'Required Field',
333 757 ],
334 758 ],
335 - // 'tab' => 'company',
336 759 ],
337 760
338 761 'billing_company_label' => [
339 762 'id' => 'billing_company_label',
@@ -339,9 +762,8 @@
339 762 'id' => 'billing_company_label',
340 763 'label' => esc_html__( 'Company label', 'shopbuilder' ),
341 764 'type' => 'text',
342 765 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
343 - // 'tab' => 'company',
344 766 'dependency' => [
345 767 'rules' => [
346 768 [
347 769 'item' => 'general.billing_form.billing_company',
@@ -355,9 +777,8 @@
355 777 'id' => 'billing_company_placeholder',
356 778 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
357 779 'type' => 'text',
358 780 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
359 - // 'tab' => 'company',
360 781 'dependency' => [
361 782 'rules' => [
362 783 [
363 784 'item' => 'general.billing_form.billing_company',
@@ -371,9 +792,8 @@
371 792 'billing_country_heading' => [
372 793 'id' => 'billing_country_heading',
373 794 'type' => 'title',
374 795 'label' => esc_html__( 'Country', 'shopbuilder' ),
375 - // 'tab' => 'country',
376 796 ],
377 797 'billing_country' => [
378 798 'id' => 'billing_country',
379 799 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -379,22 +799,18 @@
379 799 'label' => esc_html__( 'Country', 'shopbuilder' ),
380 800 'type' => 'checkbox',
381 801 'orientation' => 'vertical',
382 802 'value' => [ 'show', 'required' ],
383 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
384 803 'options' => [
385 804 [
386 805 'value' => 'show',
387 806 'label' => 'Show Country?',
388 - // 'disabled' => true,
389 807 ],
390 808 [
391 809 'value' => 'required',
392 810 'label' => 'Required Field',
393 - // 'disabled' => true,
394 811 ],
395 812 ],
396 - // 'tab' => 'country',
397 813 ],
398 814
399 815 'billing_country_label' => [
400 816 'id' => 'billing_country_label',
@@ -400,9 +816,8 @@
400 816 'id' => 'billing_country_label',
401 817 'label' => esc_html__( 'Country label', 'shopbuilder' ),
402 818 'type' => 'text',
403 819 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
404 - // 'tab' => 'country',
405 820 'dependency' => [
406 821 'rules' => [
407 822 [
408 823 'item' => 'general.billing_form.billing_country',
@@ -415,9 +830,8 @@
415 830 'billing_address_1_heading' => [
416 831 'id' => 'billing_address_1_heading',
417 832 'type' => 'title',
418 833 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
419 - // 'tab' => 'address',
420 834 ],
421 835 'billing_address_1' => [
422 836 'id' => 'billing_address_1',
423 837 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -433,9 +847,8 @@
433 847 'value' => 'required',
434 848 'label' => 'Required Field',
435 849 ],
436 850 ],
437 - // 'tab' => 'address',
438 851 ],
439 852
440 853 'billing_address_1_label' => [
441 854 'id' => 'billing_address_1_label',
@@ -441,9 +854,8 @@
441 854 'id' => 'billing_address_1_label',
442 855 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
443 856 'type' => 'text',
444 857 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
445 - // 'tab' => 'address',
446 858 'dependency' => [
447 859 'rules' => [
448 860 [
449 861 'item' => 'general.billing_form.billing_address_1',
@@ -457,9 +869,8 @@
457 869 'id' => 'billing_address_1_placeholder',
458 870 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
459 871 'type' => 'text',
460 872 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
461 - // 'tab' => 'address',
462 873 'dependency' => [
463 874 'rules' => [
464 875 [
465 876 'item' => 'general.billing_form.billing_address_1',
@@ -472,9 +883,8 @@
472 883 'billing_address_2_heading' => [
473 884 'id' => 'billing_address_2_heading',
474 885 'type' => 'title',
475 886 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
476 - // 'tab' => 'address',
477 887 'dependency' => [
478 888 'rules' => [
479 889 [
480 890 'item' => 'general.billing_form.billing_address_1',
@@ -488,9 +898,8 @@
488 898 'id' => 'billing_address_2',
489 899 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
490 900 'type' => 'checkbox',
491 901 'orientation' => 'vertical',
492 - // 'tab' => 'address',
493 902 'value' => [
494 903 'show',
495 904 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
496 905 ],
@@ -516,9 +925,8 @@
516 925 'id' => 'billing_address_2_label',
517 926 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
518 927 'type' => 'text',
519 928 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
520 - // 'tab' => 'address',
521 929 'dependency' => [
522 930 'rules' => [
523 931 [
524 932 'item' => 'general.billing_form.billing_address_1',
@@ -537,9 +945,8 @@
537 945 'id' => 'billing_address_2_placeholder',
538 946 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
539 947 'type' => 'text',
540 948 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
541 - // 'tab' => 'address',
542 949 'dependency' => [
543 950 'rules' => [
544 951 [
545 952 'item' => 'general.billing_form.billing_address_1',
@@ -557,9 +964,8 @@
557 964 'billing_city_heading' => [
558 965 'id' => 'billing_city_heading',
559 966 'type' => 'title',
560 967 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
561 - // 'tab' => 'city',
562 968 ],
563 969 'billing_city' => [
564 970 'id' => 'billing_city',
565 971 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -565,9 +971,8 @@
565 971 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
566 972 'type' => 'checkbox',
567 973 'orientation' => 'vertical',
568 974 'value' => [ 'show', 'required' ],
569 - // 'tab' => 'city',
570 975 'options' => [
571 976 [
572 977 'value' => 'show',
573 978 'label' => 'Show Town / City?',
@@ -583,9 +988,8 @@
583 988 'id' => 'billing_city_label',
584 989 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
585 990 'type' => 'text',
586 991 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
587 - // 'tab' => 'city',
588 992 'dependency' => [
589 993 'rules' => [
590 994 [
591 995 'item' => 'general.billing_form.billing_city',
@@ -599,9 +1003,8 @@
599 1003 'id' => 'billing_city_placeholder',
600 1004 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
601 1005 'type' => 'text',
602 1006 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
603 - // 'tab' => 'city',
604 1007 'dependency' => [
605 1008 'rules' => [
606 1009 [
607 1010 'item' => 'general.billing_form.billing_city',
@@ -614,9 +1017,8 @@
614 1017 'billing_state_heading' => [
615 1018 'id' => 'billing_city_heading',
616 1019 'type' => 'title',
617 1020 'label' => esc_html__( 'State', 'shopbuilder' ),
618 - // 'tab' => 'state',
619 1021 ],
620 1022 'billing_state' => [
621 1023 'id' => 'billing_state',
622 1024 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -632,9 +1034,8 @@
632 1034 'value' => 'required',
633 1035 'label' => 'Required Field',
634 1036 ],
635 1037 ],
636 - // 'tab' => 'state',
637 1038 ],
638 1039
639 1040 'billing_state_label' => [
640 1041 'id' => 'billing_state_label',
@@ -640,10 +1041,8 @@
640 1041 'id' => 'billing_state_label',
641 1042 'label' => esc_html__( 'State label', 'shopbuilder' ),
642 1043 'type' => 'text',
643 1044 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
644 - // 'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
645 - // 'tab' => 'state',
646 1045 'dependency' => [
647 1046 'rules' => [
648 1047 [
649 1048 'item' => 'general.billing_form.billing_state',
@@ -656,9 +1055,8 @@
656 1055 'billing_postcode_heading' => [
657 1056 'id' => 'billing_postcode_heading',
658 1057 'type' => 'title',
659 1058 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
660 - // 'tab' => 'postcode',
661 1059 ],
662 1060 'billing_postcode' => [
663 1061 'id' => 'billing_postcode',
664 1062 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -674,9 +1072,8 @@
674 1072 'value' => 'required',
675 1073 'label' => 'Required Field',
676 1074 ],
677 1075 ],
678 - // 'tab' => 'postcode',
679 1076 ],
680 1077 'billing_postcode_label' => [
681 1078 'id' => 'billing_postcode_label',
682 1079 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -681,9 +1078,8 @@
681 1078 'id' => 'billing_postcode_label',
682 1079 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
683 1080 'type' => 'text',
684 1081 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
685 - // 'tab' => 'postcode',
686 1082 'dependency' => [
687 1083 'rules' => [
688 1084 [
689 1085 'item' => 'general.billing_form.billing_postcode',
@@ -697,9 +1093,8 @@
697 1093 'id' => 'billing_postcode_placeholder',
698 1094 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
699 1095 'type' => 'text',
700 1096 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
701 - // 'tab' => 'postcode',
702 1097 'dependency' => [
703 1098 'rules' => [
704 1099 [
705 1100 'item' => 'general.billing_form.billing_postcode',
@@ -712,9 +1107,8 @@
712 1107 'billing_phone_heading' => [
713 1108 'id' => 'billing_phone_heading',
714 1109 'type' => 'title',
715 1110 'label' => esc_html__( 'Phone', 'shopbuilder' ),
716 - // 'tab' => 'phone',
717 1111 ],
718 1112 'billing_phone' => [
719 1113 'id' => 'billing_phone',
720 1114 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -719,9 +1113,8 @@
719 1113 'id' => 'billing_phone',
720 1114 'label' => esc_html__( 'Phone', 'shopbuilder' ),
721 1115 'type' => 'checkbox',
722 1116 'orientation' => 'vertical',
723 - // 'tab' => 'phone',
724 1117 'value' => [
725 1118 'show',
726 1119 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
727 1120 ],
@@ -741,9 +1134,8 @@
741 1134 'id' => 'billing_phone_label',
742 1135 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
743 1136 'type' => 'text',
744 1137 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
745 - // 'tab' => 'phone',
746 1138 'dependency' => [
747 1139 'rules' => [
748 1140 [
749 1141 'item' => 'general.billing_form.billing_phone',
@@ -757,9 +1149,8 @@
757 1149 'id' => 'billing_phone_placeholder',
758 1150 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
759 1151 'type' => 'text',
760 1152 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
761 - // 'tab' => 'phone',
762 1153 'dependency' => [
763 1154 'rules' => [
764 1155 [
765 1156 'item' => 'general.billing_form.billing_phone',
@@ -772,9 +1163,8 @@
772 1163 'billing_email_heading' => [
773 1164 'id' => 'billing_email_heading',
774 1165 'type' => 'title',
775 1166 'label' => esc_html__( 'Email', 'shopbuilder' ),
776 - // 'tab' => 'email',
777 1167 ],
778 1168 'billing_email' => [
779 1169 'id' => 'billing_email',
780 1170 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -779,9 +1169,8 @@
779 1169 'id' => 'billing_email',
780 1170 'label' => esc_html__( 'Email address', 'shopbuilder' ),
781 1171 'type' => 'checkbox',
782 1172 'orientation' => 'vertical',
783 - // 'tab' => 'email',
784 1173 'value' => [ 'show', 'required' ],
785 1174 'options' => [
786 1175 [
787 1176 'value' => 'show',
@@ -797,9 +1186,8 @@
797 1186 'id' => 'billing_email_label',
798 1187 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
799 1188 'type' => 'text',
800 1189 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
801 - // 'tab' => 'email',
802 1190 'dependency' => [
803 1191 'rules' => [
804 1192 [
805 1193 'item' => 'general.billing_form.billing_email',
@@ -813,9 +1201,8 @@
813 1201 'id' => 'billing_email_placeholder',
814 1202 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
815 1203 'type' => 'text',
816 1204 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
817 - // 'tab' => 'email',
818 1205 'dependency' => [
819 1206 'rules' => [
820 1207 [
821 1208 'item' => 'general.billing_form.billing_email',
@@ -828,25 +1215,36 @@
828 1215 ],
829 1216
830 1217 ]
831 1218 ),
832 - 'shipping_form' => apply_filters(
1219 + 'shipping_form' => apply_filters(
833 1220 'rtsb/module/shipping_form/options',
834 1221 [
835 1222 'id' => 'shipping_form',
1223 + 'icon' => SvgIcons::get( 'shipping_form' ),
836 1224 'category' => 'checkout',
837 1225 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
838 1226 'package' => 'free',
1227 + 'links' => [
1228 + 'doc' => '',
1229 + 'video' => '',
1230 + ],
839 1231 'active_field' => [
840 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
841 - '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' ),
842 1234 ],
843 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 + ],
844 1243 'shipping_first_name_heading' => [
845 1244 'id' => 'shipping_first_name_heading',
846 1245 'type' => 'title',
847 1246 'label' => esc_html__( 'First Name', 'shopbuilder' ),
848 - // 'tab' => 'name',
849 1247 ],
850 1248 'shipping_first_name' => [
851 1249 'id' => 'shipping_first_name',
852 1250 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -862,9 +1260,8 @@
862 1260 'value' => 'required',
863 1261 'label' => 'Required Field',
864 1262 ],
865 1263 ],
866 - // 'tab' => 'name',
867 1264 ],
868 1265 'shipping_first_name_label' => [
869 1266 'id' => 'shipping_first_name_label',
870 1267 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -869,9 +1266,8 @@
869 1266 'id' => 'shipping_first_name_label',
870 1267 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
871 1268 'type' => 'text',
872 1269 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
873 - // 'tab' => 'name',
874 1270 'dependency' => [
875 1271 'rules' => [
876 1272 [
877 1273 'item' => 'general.shipping_form.shipping_first_name',
@@ -885,9 +1281,8 @@
885 1281 'id' => 'shipping_first_name_placeholder',
886 1282 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
887 1283 'type' => 'text',
888 1284 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
889 - // 'tab' => 'country',
890 1285 'dependency' => [
891 1286 'rules' => [
892 1287 [
893 1288 'item' => 'general.shipping_form.shipping_first_name',
@@ -900,9 +1295,8 @@
900 1295 'shipping_first_last_heading' => [
901 1296 'id' => 'shipping_first_last_heading',
902 1297 'type' => 'title',
903 1298 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
904 - // 'tab' => 'name',
905 1299 ],
906 1300 'shipping_last_name' => [
907 1301 'id' => 'shipping_last_name',
908 1302 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -918,9 +1312,8 @@
918 1312 'value' => 'required',
919 1313 'label' => 'Required Field',
920 1314 ],
921 1315 ],
922 - // 'tab' => 'name',
923 1316 ],
924 1317
925 1318 'shipping_last_name_label' => [
926 1319 'id' => 'shipping_last_name_label',
@@ -926,9 +1319,8 @@
926 1319 'id' => 'shipping_last_name_label',
927 1320 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
928 1321 'type' => 'text',
929 1322 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
930 - // 'tab' => 'name',
931 1323 'dependency' => [
932 1324 'rules' => [
933 1325 [
934 1326 'item' => 'general.shipping_form.shipping_last_name',
@@ -942,9 +1334,8 @@
942 1334 'id' => 'shipping_last_name_placeholder',
943 1335 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
944 1336 'type' => 'text',
945 1337 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
946 - // 'tab' => 'country',
947 1338 'dependency' => [
948 1339 'rules' => [
949 1340 [
950 1341 'item' => 'general.shipping_form.shipping_last_name',
@@ -957,9 +1348,8 @@
957 1348 'shipping_company_heading' => [
958 1349 'id' => 'shipping_company_heading',
959 1350 'type' => 'title',
960 1351 'label' => esc_html__( 'Company', 'shopbuilder' ),
961 - // 'tab' => 'name',
962 1352 ],
963 1353 'shipping_company' => [
964 1354 'id' => 'shipping_company',
965 1355 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -975,9 +1365,8 @@
975 1365 'value' => 'required',
976 1366 'label' => 'Required Field',
977 1367 ],
978 1368 ],
979 - // 'tab' => 'company',
980 1369 ],
981 1370
982 1371 'shipping_company_label' => [
983 1372 'id' => 'shipping_company_label',
@@ -983,9 +1372,8 @@
983 1372 'id' => 'shipping_company_label',
984 1373 'label' => esc_html__( 'Company label', 'shopbuilder' ),
985 1374 'type' => 'text',
986 1375 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
987 - // 'tab' => 'company',
988 1376 'dependency' => [
989 1377 'rules' => [
990 1378 [
991 1379 'item' => 'general.shipping_form.shipping_company',
@@ -999,9 +1387,8 @@
999 1387 'id' => 'shipping_company_placeholder',
1000 1388 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1001 1389 'type' => 'text',
1002 1390 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1003 - // 'tab' => 'country',
1004 1391 'dependency' => [
1005 1392 'rules' => [
1006 1393 [
1007 1394 'item' => 'general.shipping_form.shipping_company',
@@ -1014,9 +1401,8 @@
1014 1401 'shipping_country_heading' => [
1015 1402 'id' => 'shipping_country_heading',
1016 1403 'type' => 'title',
1017 1404 'label' => esc_html__( 'Country', 'shopbuilder' ),
1018 - // 'tab' => 'name',
1019 1405 ],
1020 1406 'shipping_country' => [
1021 1407 'id' => 'shipping_country',
1022 1408 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1026,17 +1412,14 @@
1026 1412 'options' => [
1027 1413 [
1028 1414 'value' => 'show',
1029 1415 'label' => 'Show Country?',
1030 - // 'disabled' => true,
1031 1416 ],
1032 1417 [
1033 1418 'value' => 'required',
1034 1419 'label' => 'Required Field',
1035 - // 'disabled' => true,
1036 1420 ],
1037 1421 ],
1038 - // 'tab' => 'country',
1039 1422 ],
1040 1423
1041 1424 'shipping_country_label' => [
1042 1425 'id' => 'shipping_country_label',
@@ -1056,9 +1439,8 @@
1056 1439 'shipping_address_1_heading' => [
1057 1440 'id' => 'shipping_address_1_heading',
1058 1441 'type' => 'title',
1059 1442 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1060 - // 'tab' => 'name',
1061 1443 ],
1062 1444 'shipping_address_1' => [
1063 1445 'id' => 'shipping_address_1',
1064 1446 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1074,9 +1456,8 @@
1074 1456 'value' => 'required',
1075 1457 'label' => 'Required Field',
1076 1458 ],
1077 1459 ],
1078 - // 'tab' => 'country',
1079 1460 ],
1080 1461
1081 1462 'shipping_address_1_label' => [
1082 1463 'id' => 'shipping_address_1_label',
@@ -1082,9 +1463,8 @@
1082 1463 'id' => 'shipping_address_1_label',
1083 1464 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1084 1465 'type' => 'text',
1085 1466 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1086 - // 'tab' => 'country',
1087 1467 'dependency' => [
1088 1468 'rules' => [
1089 1469 [
1090 1470 'item' => 'general.shipping_form.shipping_address_1',
@@ -1098,9 +1478,8 @@
1098 1478 'id' => 'shipping_address_1_placeholder',
1099 1479 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1100 1480 'type' => 'text',
1101 1481 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1102 - // 'tab' => 'country',
1103 1482 'dependency' => [
1104 1483 'rules' => [
1105 1484 [
1106 1485 'item' => 'general.shipping_form.shipping_address_1',
@@ -1113,9 +1492,8 @@
1113 1492 'shipping_address_2_heading' => [
1114 1493 'id' => 'shipping_address_2_heading',
1115 1494 'type' => 'title',
1116 1495 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1117 - // 'tab' => 'name',
1118 1496 'dependency' => [
1119 1497 'rules' => [
1120 1498 [
1121 1499 'item' => 'general.shipping_form.shipping_address_1',
@@ -1137,9 +1515,8 @@
1137 1515 'label' => 'Show Address field?',
1138 1516 ],
1139 1517 ],
1140 1518 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1141 - // 'tab' => 'country',
1142 1519 'dependency' => [
1143 1520 'rules' => [
1144 1521 [
1145 1522 'item' => 'general.shipping_form.shipping_address_1',
@@ -1154,9 +1531,8 @@
1154 1531 'id' => 'shipping_address_2_label',
1155 1532 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1156 1533 'type' => 'text',
1157 1534 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1158 - // 'tab' => 'country',
1159 1535 'dependency' => [
1160 1536 'rules' => [
1161 1537 [
1162 1538 'item' => 'general.shipping_form.shipping_address_1',
@@ -1175,9 +1551,8 @@
1175 1551 'id' => 'shipping_address_2_placeholder',
1176 1552 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1177 1553 'type' => 'text',
1178 1554 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1179 - // 'tab' => 'country',
1180 1555 'dependency' => [
1181 1556 'rules' => [
1182 1557 [
1183 1558 'item' => 'general.shipping_form.shipping_address_1',
@@ -1195,9 +1570,8 @@
1195 1570 'shipping_city_heading' => [
1196 1571 'id' => 'shipping_city_heading',
1197 1572 'type' => 'title',
1198 1573 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1199 - // 'tab' => 'name',
1200 1574 ],
1201 1575 'shipping_city' => [
1202 1576 'id' => 'shipping_city',
1203 1577 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1213,9 +1587,8 @@
1213 1587 'value' => 'required',
1214 1588 'label' => 'Required Field',
1215 1589 ],
1216 1590 ],
1217 - // 'tab' => 'country',
1218 1591 ],
1219 1592 'shipping_city_label' => [
1220 1593 'id' => 'shipping_city_label',
1221 1594 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1220,9 +1593,8 @@
1220 1593 'id' => 'shipping_city_label',
1221 1594 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1222 1595 'type' => 'text',
1223 1596 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1224 - // 'tab' => 'country',
1225 1597 'dependency' => [
1226 1598 'rules' => [
1227 1599 [
1228 1600 'item' => 'general.shipping_form.shipping_city',
@@ -1236,9 +1608,8 @@
1236 1608 'id' => 'shipping_city_placeholder',
1237 1609 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1238 1610 'type' => 'text',
1239 1611 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1240 - // 'tab' => 'country',
1241 1612 'dependency' => [
1242 1613 'rules' => [
1243 1614 [
1244 1615 'item' => 'general.shipping_form.shipping_city',
@@ -1251,9 +1622,8 @@
1251 1622 'shipping_state_heading' => [
1252 1623 'id' => 'shipping_state_heading',
1253 1624 'type' => 'title',
1254 1625 'label' => esc_html__( 'Others', 'shopbuilder' ),
1255 - // 'tab' => 'name',
1256 1626 ],
1257 1627 'shipping_state' => [
1258 1628 'id' => 'shipping_state',
1259 1629 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1269,33 +1639,9 @@
1269 1639 'value' => 'required',
1270 1640 'label' => 'Required Field',
1271 1641 ],
1272 1642 ],
1273 - // 'tab' => 'country',
1274 1643 ],
1275 - //
1276 - // 'shipping_state_label' => [
1277 - // 'id' => 'shipping_state_label',
1278 - // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1279 - // 'type' => 'text',
1280 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1281 - // 'tab' => 'country',
1282 - // 'dependency' => [
1283 - // 'rules' => [
1284 - // [
1285 - // 'item' => 'general.shipping_form.shipping_state',
1286 - // 'value' => 'show',
1287 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1288 - // ],
1289 - // ],
1290 - // ],
1291 - // ],
1292 - // 'shipping_postcode_heading' => [
1293 - // 'id' => 'shipping_postcode_heading',
1294 - // 'type' => 'title',
1295 - // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1296 - // 'tab' => 'name',
1297 - // ],
1298 1644 'shipping_postcode' => [
1299 1645 'id' => 'shipping_postcode',
1300 1646 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1301 1647 'type' => 'checkbox',
@@ -1306,47 +1652,133 @@
1306 1652 'value' => 'show',
1307 1653 'label' => 'Show Postcode / ZIP?',
1308 1654 ],
1309 1655 ],
1310 - // 'tab' => 'country',
1311 1656 ],
1312 - // 'shipping_postcode_label' => [
1313 - // 'id' => 'shipping_postcode_label',
1314 - // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1315 - // 'type' => 'text',
1316 - // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1317 - // 'tab' => 'country',
1318 - // 'dependency' => [
1319 - // 'rules' => [
1320 - // [
1321 - // 'item' => 'general.shipping_form.shipping_postcode',
1322 - // 'value' => 'show',
1323 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1324 - // ],
1325 - // ],
1326 - // ],
1327 - // ],
1328 - // 'shipping_postcode_placeholder' => [
1329 - // 'id' => 'shipping_postcode_placeholder',
1330 - // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1331 - // 'type' => 'text',
1332 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1333 - // 'tab' => 'country',
1334 - // 'dependency' => [
1335 - // 'rules' => [
1336 - // [
1337 - // 'item' => 'general.shipping_form.shipping_postcode',
1338 - // 'value' => 'show',
1339 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1340 - // ],
1341 - // ],
1342 - // ],
1343 - // ],
1344 1657
1345 1658 ],
1346 1659 ]
1347 1660 ),
1661 +
1348 1662 ];
1349 1663
1664 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1665 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1666 + }
1350 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 ] ?? [];
1351 1783 }
1352 1784 }