PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
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 +551 -162 2.1.23.2.6 View file →
@@ -1,10 +1,9 @@
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;
8 7 use RadiusTheme\SB\Models\Base\ListModel;
9 8 use RadiusTheme\SB\Traits\SingletonTrait;
10 9
@@ -51,9 +50,382 @@
51 50 * @return array
52 51 */
53 52 protected function raw_list() {
54 53 $list = [
55 - 'notification' => apply_filters(
54 + 'optimization' => apply_filters(
55 + 'rtsb/settings/optimization/options',
56 + [
57 + 'id' => 'optimization',
58 + 'category' => 'general',
59 + 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ),
60 + 'package' => $this->pro_version_checker(),
61 + 'badge' => 'new',
62 + 'active_field' => [
63 + 'disable' => true,
64 + ],
65 + 'fields' => [
66 + 'optimization_intro' => [
67 + 'id' => 'optimization_intro',
68 + 'type' => 'description',
69 + 'text' => __( 'Optimize your website for maximum performance from these advanced options. <br /> <span style="color: #dc3545; display: block; margin-top: 10px;">⚠️ Note: After enabling or disabling any of these settings, clear the ShopBuilder cache to ensure changes are applied correctly.</span>', 'shopbuilder' ),
70 + ],
71 + 'enable_optimization' => [
72 + 'id' => 'enable',
73 + 'type' => 'switch',
74 + 'value' => 'on',
75 + 'label' => esc_html__( 'Enable Asset Optimization?', 'shopbuilder' ),
76 + 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website\'s performance', 'shopbuilder' ),
77 + ],
78 + 'load_elementor_scripts' => [
79 + 'id' => 'enable',
80 + 'type' => 'switch',
81 + 'label' => esc_html__( 'Load Elementor Assets?', 'shopbuilder' ),
82 + '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' ),
83 + 'value' => 'on',
84 + 'dependency' => [
85 + 'rules' => [
86 + [
87 + 'item' => 'general.optimization.enable_optimization',
88 + 'value' => 'on',
89 + 'operator' => '==',
90 + ],
91 + ],
92 + ],
93 + ],
94 + 'context_asset_loading' => [
95 + 'id' => 'enable',
96 + 'type' => 'switch',
97 + 'label' => esc_html__( 'Context-Aware Asset Loading?', 'shopbuilder' ),
98 + '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' ),
99 + 'dependency' => [
100 + 'rules' => [
101 + [
102 + 'item' => 'general.optimization.enable_optimization',
103 + 'value' => 'on',
104 + 'operator' => '==',
105 + ],
106 + ],
107 + ],
108 + ],
109 + 'wp_rocket_compatibility' => [
110 + 'id' => 'wp_rocket_compatibility',
111 + 'type' => 'switch',
112 + 'label' => esc_html__( 'WP Rocket Compatibility', 'shopbuilder' ),
113 + 'help' => esc_html__( 'Enable this option to ensure compatibility with the WP Rocket plugin for optimized asset loading.', 'shopbuilder' ),
114 + ],
115 +
116 + 'remove_pre_loader' => [
117 + 'id' => 'remove_pre_loader',
118 + 'type' => 'switch',
119 + 'label' => esc_html__( 'Disable Element Preloader', 'shopbuilder' ),
120 + 'help' => esc_html__( 'Enable this option to remove the element preloader.', 'shopbuilder' ),
121 + ],
122 + /**
123 + 'load_gutenberg_scripts' => [
124 + 'id' => 'enable',
125 + 'type' => 'switch',
126 + 'label' => esc_html__( 'Load Gutenberg Scripts?', 'shopbuilder' ),
127 + 'help' => esc_html__( 'Switch on to load elementor scripts by dynamically loading scripts', 'shopbuilder' ),
128 + ],
129 + */
130 + ],
131 + ],
132 + ),
133 + 'ai_implementation' => apply_filters(
134 + 'rtsb/settings/ai_implementation/options',
135 + [
136 + 'id' => 'ai_implementation',
137 + 'category' => 'general',
138 + 'title' => esc_html__( 'AI-implementation', 'shopbuilder' ),
139 + 'package' => 'free',
140 + 'badge' => 'beta',
141 + 'active_field' => [
142 + 'disable' => true,
143 + ],
144 + 'fields' => [
145 + 'data_ai_feature_beta_message' => [
146 + 'id' => 'data_ai_feature_beta_message',
147 + 'type' => 'description',
148 + 'text' => esc_html__( '🧠 AI feature is in beta — stable and fully functional, with more enhancements coming soon.', 'shopbuilder' ),
149 + ],
150 + 'ai_tools' => [
151 + 'id' => 'ai_tools',
152 + 'label' => esc_html__( 'AI Tools', 'shopbuilder' ),
153 + 'type' => 'select',
154 + 'value' => '',
155 + 'options' => [
156 + '' => esc_html__( '----', 'shopbuilder' ),
157 + 'OpenAI' => esc_html__( 'ChatGPT', 'shopbuilder' ),
158 + 'Gemini' => esc_html__( 'Google Gemini', 'shopbuilder' ),
159 + // phpcs:ignore Generic.Commenting
160 + // DeepSeek' => esc_html__( 'DeepSeek', 'shopbuilder' ), .
161 + ],
162 + ],
163 + // GPT.
164 + 'gpt_models' => [
165 + 'id' => 'gpt_models',
166 + 'label' => esc_html__( 'GPT Model', 'shopbuilder' ),
167 + 'type' => 'select',
168 + 'value' => 'gpt-4o',
169 + 'options' => [
170 + 'gpt-4o' => esc_html__( 'GPT-4o (Full Version)', 'shopbuilder' ),
171 + 'gpt-4o-mini' => esc_html__( 'GPT-4o Mini (Light Version)', 'shopbuilder' ),
172 + ],
173 + 'dependency' => [
174 + 'rules' => [
175 + [
176 + 'item' => 'general.ai_implementation.ai_tools',
177 + 'value' => 'OpenAI',
178 + 'operator' => '==',
179 + ],
180 + ],
181 + ],
182 + ],
183 + 'gpt_api_key' => [
184 + 'id' => 'gpt_api_key',
185 + 'label' => esc_html__( 'ChatGPT API Key', 'shopbuilder' ),
186 + 'type' => 'password',
187 + 'placeholder' => esc_html__( 'sk-p********', 'shopbuilder' ),
188 + 'help' => wp_kses(
189 + __(
190 + '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.',
191 + 'shopbuilder'
192 + ),
193 + [
194 + 'a' => [
195 + 'href' => [],
196 + 'target' => [],
197 + ],
198 + ]
199 + ),
200 + 'dependency' => [
201 + 'rules' => [
202 + [
203 + 'item' => 'general.ai_implementation.ai_tools',
204 + 'value' => 'OpenAI',
205 + 'operator' => '==',
206 + ],
207 + ],
208 + ],
209 + ],
210 + 'gpt_max_token' => [
211 + 'id' => 'gpt_max_token',
212 + 'label' => esc_html__( 'ChatGPT Maximum Characters in Prompt Input', 'shopbuilder' ),
213 + 'type' => 'number',
214 + 'help' => esc_html__(
215 + '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.',
216 + 'shopbuilder'
217 + ),
218 + 'value' => 200,
219 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
220 + 'dependency' => [
221 + 'rules' => [
222 + [
223 + 'item' => 'general.ai_implementation.ai_tools',
224 + 'value' => 'OpenAI',
225 + 'operator' => '==',
226 + ],
227 + ],
228 + ],
229 + ],
230 + // Gemini.
231 + 'gemini_api_key' => [
232 + 'id' => 'gemini_api_key',
233 + 'label' => esc_html__( 'Gemini API Key', 'shopbuilder' ),
234 + 'type' => 'password',
235 + 'placeholder' => esc_html__( 'AIzaSy***********************', 'shopbuilder' ),
236 + 'help' => wp_kses(
237 + __(
238 + '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.',
239 + 'shopbuilder'
240 + ),
241 + [
242 + 'a' => [
243 + 'href' => [],
244 + 'target' => [],
245 + ],
246 + ]
247 + ),
248 + 'dependency' => [
249 + 'rules' => [
250 + [
251 + 'item' => 'general.ai_implementation.ai_tools',
252 + 'value' => 'Gemini',
253 + 'operator' => '==',
254 + ],
255 + ],
256 + ],
257 + ],
258 + /**
259 + * User Will Not Understand how Its Works.
260 + 'gemini_models' => [
261 + 'id' => 'gemini_models',
262 + 'label' => esc_html__( 'Gemini Model', 'shopbuilder' ),
263 + 'type' => 'select',
264 + 'value' => 'gemini-2.5-flash',
265 + 'options' => [
266 + 'gemini-2.5-flash' => esc_html__( 'Gemini 2.5 Flash', 'shopbuilder' ),
267 + 'gemini-2.5-pro' => esc_html__( 'Gemini 2.5 Pro', 'shopbuilder' ),
268 + ],
269 + 'dependency' => [
270 + 'rules' => [
271 + [
272 + 'item' => 'general.ai_implementation.ai_tools',
273 + 'value' => 'Gemini',
274 + 'operator' => '==',
275 + ],
276 + ],
277 + ],
278 + ],
279 + */
280 + 'gemini_max_token' => [
281 + 'id' => 'gemini_max_token',
282 + 'label' => esc_html__( 'Gemini Maximum Characters', 'shopbuilder' ),
283 + 'type' => 'number',
284 + 'help' => esc_html__(
285 + 'Set the maximum character limit for Gemini model prompts. Adjust according to model capabilities and performance.',
286 + 'shopbuilder'
287 + ),
288 + 'value' => 200,
289 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
290 + 'dependency' => [
291 + 'rules' => [
292 + [
293 + 'item' => 'general.ai_implementation.ai_tools',
294 + 'value' => 'Gemini',
295 + 'operator' => '==',
296 + ],
297 + ],
298 + ],
299 + ],
300 + // DeepSeek.
301 + 'deepseek_api_key' => [
302 + 'id' => 'deepseek_api_key',
303 + 'label' => esc_html__( 'DeepSeek API Key', 'shopbuilder' ),
304 + 'type' => 'password',
305 + 'placeholder' => esc_html__( 'ds-***********************', 'shopbuilder' ),
306 + 'help' => wp_kses(
307 + __(
308 + '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.',
309 + 'shopbuilder'
310 + ),
311 + [
312 + 'a' => [
313 + 'href' => [],
314 + 'target' => [],
315 + ],
316 + ]
317 + ),
318 + 'dependency' => [
319 + 'rules' => [
320 + [
321 + 'item' => 'general.ai_implementation.ai_tools',
322 + 'value' => 'DeepSeek',
323 + 'operator' => '==',
324 + ],
325 + ],
326 + ],
327 + ],
328 + 'deepseek_models' => [
329 + 'id' => 'deepseek_models',
330 + 'label' => esc_html__( 'DeepSeek Model', 'shopbuilder' ),
331 + 'type' => 'select',
332 + 'value' => 'gpt-4o',
333 + 'options' => [
334 + 'deepseek-chat' => __( 'DeepSeek Chat (Full Version)', 'shopbuilder' ),
335 + 'deepseek-reasoner' => __( 'DeepSeek Reasoner Mini (Light Version)', 'shopbuilder' ),
336 + ],
337 + 'dependency' => [
338 + 'rules' => [
339 + [
340 + 'item' => 'general.ai_implementation.ai_tools',
341 + 'value' => 'DeepSeek',
342 + 'operator' => '==',
343 + ],
344 + ],
345 + ],
346 + ],
347 + 'deepseek_max_token' => [
348 + 'id' => 'deepseek_max_token',
349 + 'label' => esc_html__( 'Deepshek Maximum Characters', 'shopbuilder' ),
350 + 'type' => 'number',
351 + 'help' => esc_html__(
352 + 'Set the maximum character limit for Deepshek model prompts. Adjust according to model configuration and speed requirements.',
353 + 'shopbuilder'
354 + ),
355 + 'value' => 200,
356 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
357 + 'dependency' => [
358 + 'rules' => [
359 + [
360 + 'item' => 'general.ai_implementation.ai_tools',
361 + 'value' => 'DeepSeek',
362 + 'operator' => '==',
363 + ],
364 + ],
365 + ],
366 + ],
367 + 'enable_semantic_search' => [
368 + 'id' => 'enable_semantic_search',
369 + 'type' => 'switch',
370 + 'label' => esc_html__( 'Enable Semantic Search?', 'shopbuilder' ),
371 + 'help' => esc_html__( 'Enable AI product search instead of keyword matching to get product', 'shopbuilder' ),
372 + 'dependency' => [
373 + 'rules' => [
374 + [
375 + 'item' => 'general.ai_implementation.ai_tools',
376 + 'value' => [ 'OpenAI', 'Gemini' ],
377 + 'operator' => 'in',
378 + ],
379 + ],
380 + ],
381 + ],
382 + 'minimum_matching_percentage' => [
383 + 'id' => 'minimum_matching_percentage',
384 + 'label' => esc_html__( 'Minimum Accuracy (in percentage)', 'shopbuilder' ),
385 + 'help' => esc_html__( 'Set the minimum Accuracy. It is good between 40 and 60', 'shopbuilder' ),
386 + 'type' => 'number',
387 + 'min' => 1,
388 + 'max' => 99,
389 + 'value' => 40,
390 + 'placeholder' => esc_html__( '40', 'shopbuilder' ),
391 + 'dependency' => [
392 + 'rules' => [
393 + [
394 + 'item' => 'general.ai_implementation.ai_tools',
395 + 'value' => [ 'OpenAI', 'Gemini' ],
396 + 'operator' => 'in',
397 + ],
398 + [
399 + 'item' => 'general.ai_implementation.enable_semantic_search',
400 + 'value' => 'on',
401 + 'operator' => '==',
402 + ],
403 + ],
404 + ],
405 + ],
406 + 'data_training' => [
407 + 'id' => 'data_training',
408 + 'type' => 'title',
409 + 'label' => esc_html__( 'Data Training', 'shopbuilder' ),
410 + 'dependency' => [
411 + 'rules' => [
412 + [
413 + 'item' => 'general.ai_implementation.ai_tools',
414 + 'value' => [ 'OpenAI', 'Gemini' ],
415 + 'operator' => 'in',
416 + ],
417 + ],
418 + ],
419 + ],
420 + 'data_training_note_gemini' => $this->get_data_training_note_field( 'Gemini' ),
421 + 'data_training_note_openai' => $this->get_data_training_note_field( 'OpenAI' ),
422 + 'data_training_note_missing_openai_key' => $this->get_data_training_note_field( 'missingOpenAIKey' ),
423 + 'data_training_note_missing_gemneni_key' => $this->get_data_training_note_field( 'missingGeminiKey' ),
424 + ],
425 + ],
426 + ),
427 + 'notification' => apply_filters(
56 428 'rtsb/settings/notification/options',
57 429 [
58 430 'id' => 'notification',
59 431 'category' => 'general',
@@ -62,8 +434,13 @@
62 434 'active_field' => [
63 435 'disable' => true,
64 436 ],
65 437 'fields' => [
438 + 'notification_intro' => [
439 + 'id' => 'notification_intro',
440 + 'type' => 'description',
441 + 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
442 + ],
66 443 'notification_position' => [
67 444 'id' => 'notification_position',
68 445 'value' => 'center-center',
69 446 'type' => 'select',
@@ -77,8 +454,21 @@
77 454 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
78 455 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
79 456 ],
80 457 ],
458 + 'notification_timeOut' => [
459 + 'id' => 'notification_timeOut',
460 + 'label' => esc_html__( 'Notification Time-Out (in seconds)', 'shopbuilder' ),
461 + 'type' => 'number',
462 + 'help' => esc_html__(
463 + 'Duration (in seconds) before the notification hides automatically.',
464 + 'shopbuilder'
465 + ),
466 + 'min' => 1,
467 + 'max' => 20,
468 + 'value' => 5,
469 + 'placeholder' => esc_html__( '3', 'shopbuilder' ),
470 + ],
81 471 'notification_color' => [
82 472 'id' => 'notification_color',
83 473 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
84 474 'type' => 'color',
@@ -104,9 +494,9 @@
104 494 ],
105 495 ],
106 496 ],
107 497 ),
108 - 'social_share' => apply_filters(
498 + 'social_share' => apply_filters(
109 499 'rtsb/settings/social_share/options',
110 500 [
111 501 'id' => 'social_share',
112 502 'category' => 'general',
@@ -115,8 +505,13 @@
115 505 'active_field' => [
116 506 'disable' => true,
117 507 ],
118 508 'fields' => [
509 + 'social_share_intro' => [
510 + 'id' => 'social_share_intro',
511 + 'type' => 'description',
512 + 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
513 + ],
119 514 'share_platforms' => [
120 515 'id' => 'share_platforms',
121 516 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
122 517 'type' => 'checkbox',
@@ -129,25 +524,8 @@
129 524 'type' => 'switch',
130 525 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
131 526 '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 527 ],
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 528 'share_icon_layout' => [
151 529 'type' => 'select',
152 530 'value' => 'share-layout1',
153 531 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -167,9 +545,21 @@
167 545 ],
168 546 ],
169 547 ],
170 548 ),
171 - 'tooltip' => apply_filters(
549 + 'guest_user' => apply_filters(
550 + 'rtsb/settings/guest_user/options',
551 + [
552 + 'id' => 'guest_user',
553 + 'category' => 'general',
554 + 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
555 + 'package' => $this->pro_package(),
556 + 'active_field' => [
557 + 'disable' => true,
558 + ],
559 + ],
560 + ),
561 + 'tooltip' => apply_filters(
172 562 'rtsb/settings/tooltip/options',
173 563 [
174 564 'id' => 'tooltip',
175 565 'category' => 'general',
@@ -179,9 +569,9 @@
179 569 'disable' => true,
180 570 ],
181 571 ],
182 572 ),
183 - 'billing_form' => apply_filters(
573 + 'billing_form' => apply_filters(
184 574 'rtsb/settings/billing_form/options',
185 575 [
186 576 'id' => 'billing_form',
187 577 'category' => 'checkout',
@@ -187,17 +577,22 @@
187 577 'category' => 'checkout',
188 578 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
189 579 'package' => 'free',
190 580 'active_field' => [
191 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
192 - 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
581 + 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
582 + 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
193 583 ],
194 584 'fields' => [
585 + 'checkout_billing_info' => [
586 + 'id' => 'checkout_billing_info',
587 + 'type' => 'title',
588 + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ),
589 + 'customClass' => 'checkout-notice',
590 + ],
195 591 'billing_first_name_heading' => [
196 592 'id' => 'billing_first_name_heading',
197 593 'type' => 'title',
198 594 'label' => esc_html__( 'First Name', 'shopbuilder' ),
199 - // 'tab' => 'name',
200 595 ],
201 596 'billing_first_name' => [
202 597 'id' => 'billing_first_name',
203 598 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -213,9 +608,8 @@
213 608 'value' => 'required',
214 609 'label' => 'Required Field',
215 610 ],
216 611 ],
217 - // 'tab' => 'name',
218 612 ],
219 613 'billing_first_name_label' => [
220 614 'id' => 'billing_first_name_label',
221 615 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -220,15 +614,14 @@
220 614 'id' => 'billing_first_name_label',
221 615 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
222 616 'type' => 'text',
223 617 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
224 - // 'tab' => 'name',
225 618 'dependency' => [
226 619 'rules' => [
227 620 [
228 621 'item' => 'general.billing_form.billing_first_name',
229 622 'value' => 'show',
230 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
623 + 'operator' => '==',
231 624 ],
232 625 ],
233 626 ],
234 627 ],
@@ -236,15 +629,14 @@
236 629 'id' => 'billing_first_name_placeholder',
237 630 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
238 631 'type' => 'text',
239 632 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
240 - // 'tab' => 'name',
241 633 'dependency' => [
242 634 'rules' => [
243 635 [
244 636 'item' => 'general.billing_form.billing_first_name',
245 637 'value' => 'show',
246 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
638 + 'operator' => '==',
247 639 ],
248 640 ],
249 641 ],
250 642 ],
@@ -252,9 +644,8 @@
252 644 'billing_last_name_heading' => [
253 645 'id' => 'billing_last_name_heading',
254 646 'type' => 'title',
255 647 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
256 - // 'tab' => 'name',
257 648 ],
258 649 'billing_last_name' => [
259 650 'id' => 'billing_last_name',
260 651 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -270,9 +661,8 @@
270 661 'value' => 'required',
271 662 'label' => 'Required Field',
272 663 ],
273 664 ],
274 - // 'tab' => 'name',
275 665 ],
276 666
277 667 'billing_last_name_label' => [
278 668 'id' => 'billing_last_name_label',
@@ -278,9 +668,8 @@
278 668 'id' => 'billing_last_name_label',
279 669 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
280 670 'type' => 'text',
281 671 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
282 - // 'tab' => 'name',
283 672 'dependency' => [
284 673 'rules' => [
285 674 [
286 675 'item' => 'general.billing_form.billing_last_name',
@@ -294,9 +683,8 @@
294 683 'id' => 'billing_last_name_placeholder',
295 684 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
296 685 'type' => 'text',
297 686 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
298 - // 'tab' => 'name',
299 687 'dependency' => [
300 688 'rules' => [
301 689 [
302 690 'item' => 'general.billing_form.billing_last_name',
@@ -310,9 +698,8 @@
310 698 'billing_company_heading' => [
311 699 'id' => 'billing_company_heading',
312 700 'type' => 'title',
313 701 'label' => esc_html__( 'Company', 'shopbuilder' ),
314 - // 'tab' => 'company',
315 702 ],
316 703 'billing_company' => [
317 704 'id' => 'billing_company',
318 705 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -331,9 +718,8 @@
331 718 'value' => 'required',
332 719 'label' => 'Required Field',
333 720 ],
334 721 ],
335 - // 'tab' => 'company',
336 722 ],
337 723
338 724 'billing_company_label' => [
339 725 'id' => 'billing_company_label',
@@ -339,9 +725,8 @@
339 725 'id' => 'billing_company_label',
340 726 'label' => esc_html__( 'Company label', 'shopbuilder' ),
341 727 'type' => 'text',
342 728 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
343 - // 'tab' => 'company',
344 729 'dependency' => [
345 730 'rules' => [
346 731 [
347 732 'item' => 'general.billing_form.billing_company',
@@ -355,9 +740,8 @@
355 740 'id' => 'billing_company_placeholder',
356 741 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
357 742 'type' => 'text',
358 743 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
359 - // 'tab' => 'company',
360 744 'dependency' => [
361 745 'rules' => [
362 746 [
363 747 'item' => 'general.billing_form.billing_company',
@@ -371,9 +755,8 @@
371 755 'billing_country_heading' => [
372 756 'id' => 'billing_country_heading',
373 757 'type' => 'title',
374 758 'label' => esc_html__( 'Country', 'shopbuilder' ),
375 - // 'tab' => 'country',
376 759 ],
377 760 'billing_country' => [
378 761 'id' => 'billing_country',
379 762 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -379,22 +762,18 @@
379 762 'label' => esc_html__( 'Country', 'shopbuilder' ),
380 763 'type' => 'checkbox',
381 764 'orientation' => 'vertical',
382 765 'value' => [ 'show', 'required' ],
383 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
384 766 'options' => [
385 767 [
386 768 'value' => 'show',
387 769 'label' => 'Show Country?',
388 - // 'disabled' => true,
389 770 ],
390 771 [
391 772 'value' => 'required',
392 773 'label' => 'Required Field',
393 - // 'disabled' => true,
394 774 ],
395 775 ],
396 - // 'tab' => 'country',
397 776 ],
398 777
399 778 'billing_country_label' => [
400 779 'id' => 'billing_country_label',
@@ -400,9 +779,8 @@
400 779 'id' => 'billing_country_label',
401 780 'label' => esc_html__( 'Country label', 'shopbuilder' ),
402 781 'type' => 'text',
403 782 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
404 - // 'tab' => 'country',
405 783 'dependency' => [
406 784 'rules' => [
407 785 [
408 786 'item' => 'general.billing_form.billing_country',
@@ -415,9 +793,8 @@
415 793 'billing_address_1_heading' => [
416 794 'id' => 'billing_address_1_heading',
417 795 'type' => 'title',
418 796 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
419 - // 'tab' => 'address',
420 797 ],
421 798 'billing_address_1' => [
422 799 'id' => 'billing_address_1',
423 800 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -433,9 +810,8 @@
433 810 'value' => 'required',
434 811 'label' => 'Required Field',
435 812 ],
436 813 ],
437 - // 'tab' => 'address',
438 814 ],
439 815
440 816 'billing_address_1_label' => [
441 817 'id' => 'billing_address_1_label',
@@ -441,9 +817,8 @@
441 817 'id' => 'billing_address_1_label',
442 818 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
443 819 'type' => 'text',
444 820 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
445 - // 'tab' => 'address',
446 821 'dependency' => [
447 822 'rules' => [
448 823 [
449 824 'item' => 'general.billing_form.billing_address_1',
@@ -457,9 +832,8 @@
457 832 'id' => 'billing_address_1_placeholder',
458 833 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
459 834 'type' => 'text',
460 835 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
461 - // 'tab' => 'address',
462 836 'dependency' => [
463 837 'rules' => [
464 838 [
465 839 'item' => 'general.billing_form.billing_address_1',
@@ -472,9 +846,8 @@
472 846 'billing_address_2_heading' => [
473 847 'id' => 'billing_address_2_heading',
474 848 'type' => 'title',
475 849 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
476 - // 'tab' => 'address',
477 850 'dependency' => [
478 851 'rules' => [
479 852 [
480 853 'item' => 'general.billing_form.billing_address_1',
@@ -488,9 +861,8 @@
488 861 'id' => 'billing_address_2',
489 862 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
490 863 'type' => 'checkbox',
491 864 'orientation' => 'vertical',
492 - // 'tab' => 'address',
493 865 'value' => [
494 866 'show',
495 867 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
496 868 ],
@@ -516,9 +888,8 @@
516 888 'id' => 'billing_address_2_label',
517 889 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
518 890 'type' => 'text',
519 891 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
520 - // 'tab' => 'address',
521 892 'dependency' => [
522 893 'rules' => [
523 894 [
524 895 'item' => 'general.billing_form.billing_address_1',
@@ -537,9 +908,8 @@
537 908 'id' => 'billing_address_2_placeholder',
538 909 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
539 910 'type' => 'text',
540 911 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
541 - // 'tab' => 'address',
542 912 'dependency' => [
543 913 'rules' => [
544 914 [
545 915 'item' => 'general.billing_form.billing_address_1',
@@ -557,9 +927,8 @@
557 927 'billing_city_heading' => [
558 928 'id' => 'billing_city_heading',
559 929 'type' => 'title',
560 930 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
561 - // 'tab' => 'city',
562 931 ],
563 932 'billing_city' => [
564 933 'id' => 'billing_city',
565 934 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -565,9 +934,8 @@
565 934 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
566 935 'type' => 'checkbox',
567 936 'orientation' => 'vertical',
568 937 'value' => [ 'show', 'required' ],
569 - // 'tab' => 'city',
570 938 'options' => [
571 939 [
572 940 'value' => 'show',
573 941 'label' => 'Show Town / City?',
@@ -583,9 +951,8 @@
583 951 'id' => 'billing_city_label',
584 952 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
585 953 'type' => 'text',
586 954 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
587 - // 'tab' => 'city',
588 955 'dependency' => [
589 956 'rules' => [
590 957 [
591 958 'item' => 'general.billing_form.billing_city',
@@ -599,9 +966,8 @@
599 966 'id' => 'billing_city_placeholder',
600 967 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
601 968 'type' => 'text',
602 969 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
603 - // 'tab' => 'city',
604 970 'dependency' => [
605 971 'rules' => [
606 972 [
607 973 'item' => 'general.billing_form.billing_city',
@@ -614,9 +980,8 @@
614 980 'billing_state_heading' => [
615 981 'id' => 'billing_city_heading',
616 982 'type' => 'title',
617 983 'label' => esc_html__( 'State', 'shopbuilder' ),
618 - // 'tab' => 'state',
619 984 ],
620 985 'billing_state' => [
621 986 'id' => 'billing_state',
622 987 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -632,9 +997,8 @@
632 997 'value' => 'required',
633 998 'label' => 'Required Field',
634 999 ],
635 1000 ],
636 - // 'tab' => 'state',
637 1001 ],
638 1002
639 1003 'billing_state_label' => [
640 1004 'id' => 'billing_state_label',
@@ -640,10 +1004,8 @@
640 1004 'id' => 'billing_state_label',
641 1005 'label' => esc_html__( 'State label', 'shopbuilder' ),
642 1006 'type' => 'text',
643 1007 '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 1008 'dependency' => [
647 1009 'rules' => [
648 1010 [
649 1011 'item' => 'general.billing_form.billing_state',
@@ -656,9 +1018,8 @@
656 1018 'billing_postcode_heading' => [
657 1019 'id' => 'billing_postcode_heading',
658 1020 'type' => 'title',
659 1021 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
660 - // 'tab' => 'postcode',
661 1022 ],
662 1023 'billing_postcode' => [
663 1024 'id' => 'billing_postcode',
664 1025 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -674,9 +1035,8 @@
674 1035 'value' => 'required',
675 1036 'label' => 'Required Field',
676 1037 ],
677 1038 ],
678 - // 'tab' => 'postcode',
679 1039 ],
680 1040 'billing_postcode_label' => [
681 1041 'id' => 'billing_postcode_label',
682 1042 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -681,9 +1041,8 @@
681 1041 'id' => 'billing_postcode_label',
682 1042 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
683 1043 'type' => 'text',
684 1044 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
685 - // 'tab' => 'postcode',
686 1045 'dependency' => [
687 1046 'rules' => [
688 1047 [
689 1048 'item' => 'general.billing_form.billing_postcode',
@@ -697,9 +1056,8 @@
697 1056 'id' => 'billing_postcode_placeholder',
698 1057 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
699 1058 'type' => 'text',
700 1059 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
701 - // 'tab' => 'postcode',
702 1060 'dependency' => [
703 1061 'rules' => [
704 1062 [
705 1063 'item' => 'general.billing_form.billing_postcode',
@@ -712,9 +1070,8 @@
712 1070 'billing_phone_heading' => [
713 1071 'id' => 'billing_phone_heading',
714 1072 'type' => 'title',
715 1073 'label' => esc_html__( 'Phone', 'shopbuilder' ),
716 - // 'tab' => 'phone',
717 1074 ],
718 1075 'billing_phone' => [
719 1076 'id' => 'billing_phone',
720 1077 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -719,9 +1076,8 @@
719 1076 'id' => 'billing_phone',
720 1077 'label' => esc_html__( 'Phone', 'shopbuilder' ),
721 1078 'type' => 'checkbox',
722 1079 'orientation' => 'vertical',
723 - // 'tab' => 'phone',
724 1080 'value' => [
725 1081 'show',
726 1082 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
727 1083 ],
@@ -741,9 +1097,8 @@
741 1097 'id' => 'billing_phone_label',
742 1098 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
743 1099 'type' => 'text',
744 1100 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
745 - // 'tab' => 'phone',
746 1101 'dependency' => [
747 1102 'rules' => [
748 1103 [
749 1104 'item' => 'general.billing_form.billing_phone',
@@ -757,9 +1112,8 @@
757 1112 'id' => 'billing_phone_placeholder',
758 1113 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
759 1114 'type' => 'text',
760 1115 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
761 - // 'tab' => 'phone',
762 1116 'dependency' => [
763 1117 'rules' => [
764 1118 [
765 1119 'item' => 'general.billing_form.billing_phone',
@@ -772,9 +1126,8 @@
772 1126 'billing_email_heading' => [
773 1127 'id' => 'billing_email_heading',
774 1128 'type' => 'title',
775 1129 'label' => esc_html__( 'Email', 'shopbuilder' ),
776 - // 'tab' => 'email',
777 1130 ],
778 1131 'billing_email' => [
779 1132 'id' => 'billing_email',
780 1133 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -779,9 +1132,8 @@
779 1132 'id' => 'billing_email',
780 1133 'label' => esc_html__( 'Email address', 'shopbuilder' ),
781 1134 'type' => 'checkbox',
782 1135 'orientation' => 'vertical',
783 - // 'tab' => 'email',
784 1136 'value' => [ 'show', 'required' ],
785 1137 'options' => [
786 1138 [
787 1139 'value' => 'show',
@@ -797,9 +1149,8 @@
797 1149 'id' => 'billing_email_label',
798 1150 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
799 1151 'type' => 'text',
800 1152 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
801 - // 'tab' => 'email',
802 1153 'dependency' => [
803 1154 'rules' => [
804 1155 [
805 1156 'item' => 'general.billing_form.billing_email',
@@ -813,9 +1164,8 @@
813 1164 'id' => 'billing_email_placeholder',
814 1165 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
815 1166 'type' => 'text',
816 1167 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
817 - // 'tab' => 'email',
818 1168 'dependency' => [
819 1169 'rules' => [
820 1170 [
821 1171 'item' => 'general.billing_form.billing_email',
@@ -828,9 +1178,9 @@
828 1178 ],
829 1179
830 1180 ]
831 1181 ),
832 - 'shipping_form' => apply_filters(
1182 + 'shipping_form' => apply_filters(
833 1183 'rtsb/module/shipping_form/options',
834 1184 [
835 1185 'id' => 'shipping_form',
836 1186 'category' => 'checkout',
@@ -836,17 +1186,22 @@
836 1186 'category' => 'checkout',
837 1187 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
838 1188 'package' => 'free',
839 1189 'active_field' => [
840 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
841 - 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
1190 + 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1191 + 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
842 1192 ],
843 1193 'fields' => [
1194 + 'checkout_shipping_info' => [
1195 + 'id' => 'checkout_shipping_info',
1196 + 'type' => 'title',
1197 + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ),
1198 + 'customClass' => 'checkout-notice',
1199 + ],
844 1200 'shipping_first_name_heading' => [
845 1201 'id' => 'shipping_first_name_heading',
846 1202 'type' => 'title',
847 1203 'label' => esc_html__( 'First Name', 'shopbuilder' ),
848 - // 'tab' => 'name',
849 1204 ],
850 1205 'shipping_first_name' => [
851 1206 'id' => 'shipping_first_name',
852 1207 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -862,9 +1217,8 @@
862 1217 'value' => 'required',
863 1218 'label' => 'Required Field',
864 1219 ],
865 1220 ],
866 - // 'tab' => 'name',
867 1221 ],
868 1222 'shipping_first_name_label' => [
869 1223 'id' => 'shipping_first_name_label',
870 1224 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -869,9 +1223,8 @@
869 1223 'id' => 'shipping_first_name_label',
870 1224 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
871 1225 'type' => 'text',
872 1226 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
873 - // 'tab' => 'name',
874 1227 'dependency' => [
875 1228 'rules' => [
876 1229 [
877 1230 'item' => 'general.shipping_form.shipping_first_name',
@@ -885,9 +1238,8 @@
885 1238 'id' => 'shipping_first_name_placeholder',
886 1239 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
887 1240 'type' => 'text',
888 1241 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
889 - // 'tab' => 'country',
890 1242 'dependency' => [
891 1243 'rules' => [
892 1244 [
893 1245 'item' => 'general.shipping_form.shipping_first_name',
@@ -900,9 +1252,8 @@
900 1252 'shipping_first_last_heading' => [
901 1253 'id' => 'shipping_first_last_heading',
902 1254 'type' => 'title',
903 1255 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
904 - // 'tab' => 'name',
905 1256 ],
906 1257 'shipping_last_name' => [
907 1258 'id' => 'shipping_last_name',
908 1259 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -918,9 +1269,8 @@
918 1269 'value' => 'required',
919 1270 'label' => 'Required Field',
920 1271 ],
921 1272 ],
922 - // 'tab' => 'name',
923 1273 ],
924 1274
925 1275 'shipping_last_name_label' => [
926 1276 'id' => 'shipping_last_name_label',
@@ -926,9 +1276,8 @@
926 1276 'id' => 'shipping_last_name_label',
927 1277 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
928 1278 'type' => 'text',
929 1279 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
930 - // 'tab' => 'name',
931 1280 'dependency' => [
932 1281 'rules' => [
933 1282 [
934 1283 'item' => 'general.shipping_form.shipping_last_name',
@@ -942,9 +1291,8 @@
942 1291 'id' => 'shipping_last_name_placeholder',
943 1292 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
944 1293 'type' => 'text',
945 1294 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
946 - // 'tab' => 'country',
947 1295 'dependency' => [
948 1296 'rules' => [
949 1297 [
950 1298 'item' => 'general.shipping_form.shipping_last_name',
@@ -957,9 +1305,8 @@
957 1305 'shipping_company_heading' => [
958 1306 'id' => 'shipping_company_heading',
959 1307 'type' => 'title',
960 1308 'label' => esc_html__( 'Company', 'shopbuilder' ),
961 - // 'tab' => 'name',
962 1309 ],
963 1310 'shipping_company' => [
964 1311 'id' => 'shipping_company',
965 1312 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -975,9 +1322,8 @@
975 1322 'value' => 'required',
976 1323 'label' => 'Required Field',
977 1324 ],
978 1325 ],
979 - // 'tab' => 'company',
980 1326 ],
981 1327
982 1328 'shipping_company_label' => [
983 1329 'id' => 'shipping_company_label',
@@ -983,9 +1329,8 @@
983 1329 'id' => 'shipping_company_label',
984 1330 'label' => esc_html__( 'Company label', 'shopbuilder' ),
985 1331 'type' => 'text',
986 1332 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
987 - // 'tab' => 'company',
988 1333 'dependency' => [
989 1334 'rules' => [
990 1335 [
991 1336 'item' => 'general.shipping_form.shipping_company',
@@ -999,9 +1344,8 @@
999 1344 'id' => 'shipping_company_placeholder',
1000 1345 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1001 1346 'type' => 'text',
1002 1347 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1003 - // 'tab' => 'country',
1004 1348 'dependency' => [
1005 1349 'rules' => [
1006 1350 [
1007 1351 'item' => 'general.shipping_form.shipping_company',
@@ -1014,9 +1358,8 @@
1014 1358 'shipping_country_heading' => [
1015 1359 'id' => 'shipping_country_heading',
1016 1360 'type' => 'title',
1017 1361 'label' => esc_html__( 'Country', 'shopbuilder' ),
1018 - // 'tab' => 'name',
1019 1362 ],
1020 1363 'shipping_country' => [
1021 1364 'id' => 'shipping_country',
1022 1365 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1026,17 +1369,14 @@
1026 1369 'options' => [
1027 1370 [
1028 1371 'value' => 'show',
1029 1372 'label' => 'Show Country?',
1030 - // 'disabled' => true,
1031 1373 ],
1032 1374 [
1033 1375 'value' => 'required',
1034 1376 'label' => 'Required Field',
1035 - // 'disabled' => true,
1036 1377 ],
1037 1378 ],
1038 - // 'tab' => 'country',
1039 1379 ],
1040 1380
1041 1381 'shipping_country_label' => [
1042 1382 'id' => 'shipping_country_label',
@@ -1056,9 +1396,8 @@
1056 1396 'shipping_address_1_heading' => [
1057 1397 'id' => 'shipping_address_1_heading',
1058 1398 'type' => 'title',
1059 1399 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1060 - // 'tab' => 'name',
1061 1400 ],
1062 1401 'shipping_address_1' => [
1063 1402 'id' => 'shipping_address_1',
1064 1403 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1074,9 +1413,8 @@
1074 1413 'value' => 'required',
1075 1414 'label' => 'Required Field',
1076 1415 ],
1077 1416 ],
1078 - // 'tab' => 'country',
1079 1417 ],
1080 1418
1081 1419 'shipping_address_1_label' => [
1082 1420 'id' => 'shipping_address_1_label',
@@ -1082,9 +1420,8 @@
1082 1420 'id' => 'shipping_address_1_label',
1083 1421 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1084 1422 'type' => 'text',
1085 1423 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1086 - // 'tab' => 'country',
1087 1424 'dependency' => [
1088 1425 'rules' => [
1089 1426 [
1090 1427 'item' => 'general.shipping_form.shipping_address_1',
@@ -1098,9 +1435,8 @@
1098 1435 'id' => 'shipping_address_1_placeholder',
1099 1436 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1100 1437 'type' => 'text',
1101 1438 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1102 - // 'tab' => 'country',
1103 1439 'dependency' => [
1104 1440 'rules' => [
1105 1441 [
1106 1442 'item' => 'general.shipping_form.shipping_address_1',
@@ -1113,9 +1449,8 @@
1113 1449 'shipping_address_2_heading' => [
1114 1450 'id' => 'shipping_address_2_heading',
1115 1451 'type' => 'title',
1116 1452 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1117 - // 'tab' => 'name',
1118 1453 'dependency' => [
1119 1454 'rules' => [
1120 1455 [
1121 1456 'item' => 'general.shipping_form.shipping_address_1',
@@ -1137,9 +1472,8 @@
1137 1472 'label' => 'Show Address field?',
1138 1473 ],
1139 1474 ],
1140 1475 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1141 - // 'tab' => 'country',
1142 1476 'dependency' => [
1143 1477 'rules' => [
1144 1478 [
1145 1479 'item' => 'general.shipping_form.shipping_address_1',
@@ -1154,9 +1488,8 @@
1154 1488 'id' => 'shipping_address_2_label',
1155 1489 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1156 1490 'type' => 'text',
1157 1491 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1158 - // 'tab' => 'country',
1159 1492 'dependency' => [
1160 1493 'rules' => [
1161 1494 [
1162 1495 'item' => 'general.shipping_form.shipping_address_1',
@@ -1175,9 +1508,8 @@
1175 1508 'id' => 'shipping_address_2_placeholder',
1176 1509 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1177 1510 'type' => 'text',
1178 1511 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1179 - // 'tab' => 'country',
1180 1512 'dependency' => [
1181 1513 'rules' => [
1182 1514 [
1183 1515 'item' => 'general.shipping_form.shipping_address_1',
@@ -1195,9 +1527,8 @@
1195 1527 'shipping_city_heading' => [
1196 1528 'id' => 'shipping_city_heading',
1197 1529 'type' => 'title',
1198 1530 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1199 - // 'tab' => 'name',
1200 1531 ],
1201 1532 'shipping_city' => [
1202 1533 'id' => 'shipping_city',
1203 1534 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1213,9 +1544,8 @@
1213 1544 'value' => 'required',
1214 1545 'label' => 'Required Field',
1215 1546 ],
1216 1547 ],
1217 - // 'tab' => 'country',
1218 1548 ],
1219 1549 'shipping_city_label' => [
1220 1550 'id' => 'shipping_city_label',
1221 1551 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1220,9 +1550,8 @@
1220 1550 'id' => 'shipping_city_label',
1221 1551 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1222 1552 'type' => 'text',
1223 1553 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1224 - // 'tab' => 'country',
1225 1554 'dependency' => [
1226 1555 'rules' => [
1227 1556 [
1228 1557 'item' => 'general.shipping_form.shipping_city',
@@ -1236,9 +1565,8 @@
1236 1565 'id' => 'shipping_city_placeholder',
1237 1566 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1238 1567 'type' => 'text',
1239 1568 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1240 - // 'tab' => 'country',
1241 1569 'dependency' => [
1242 1570 'rules' => [
1243 1571 [
1244 1572 'item' => 'general.shipping_form.shipping_city',
@@ -1251,9 +1579,8 @@
1251 1579 'shipping_state_heading' => [
1252 1580 'id' => 'shipping_state_heading',
1253 1581 'type' => 'title',
1254 1582 'label' => esc_html__( 'Others', 'shopbuilder' ),
1255 - // 'tab' => 'name',
1256 1583 ],
1257 1584 'shipping_state' => [
1258 1585 'id' => 'shipping_state',
1259 1586 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1269,33 +1596,9 @@
1269 1596 'value' => 'required',
1270 1597 'label' => 'Required Field',
1271 1598 ],
1272 1599 ],
1273 - // 'tab' => 'country',
1274 1600 ],
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 1601 'shipping_postcode' => [
1299 1602 'id' => 'shipping_postcode',
1300 1603 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1301 1604 'type' => 'checkbox',
@@ -1306,47 +1609,133 @@
1306 1609 'value' => 'show',
1307 1610 'label' => 'Show Postcode / ZIP?',
1308 1611 ],
1309 1612 ],
1310 - // 'tab' => 'country',
1311 1613 ],
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 1614
1345 1615 ],
1346 1616 ]
1347 1617 ),
1618 +
1348 1619 ];
1349 1620
1621 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1622 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1623 + }
1350 1624 return apply_filters( 'rtsb/core/general_settings/raw_list', $list );
1625 + }
1626 +
1627 + /**
1628 + * Get the Data Training Note field.
1629 + *
1630 + * @param string $tool Meta values.
1631 + * @return array
1632 + */
1633 + public function get_data_training_note_field( $tool ): array {
1634 + $progress = get_option( 'rtsb_embedding_progress', [ 'processed' => 0 ] );
1635 + $total = AIFns::need_product_embedding();
1636 + $processed = (int) $progress['processed'];
1637 + $remaining = max( $total - $processed, 0 );
1638 + $generate_url = add_query_arg(
1639 + [
1640 + rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
1641 + 'action' => 'rtsb_start_embedding_process',
1642 + ],
1643 + admin_url( 'admin.php?page=rtsb-settings' )
1644 + );
1645 +
1646 + if ( wp_next_scheduled( 'rtsb_embedding_cron_run' ) ) {
1647 + $text = esc_html__( 'Processing embeddings in the background. You can continue using the site.', 'shopbuilder' );
1648 + } else {
1649 + if ( $remaining > 0 ) {
1650 + // Build the correct text based on embedding progress.
1651 + $text = sprintf(
1652 + '%1$s <a class="rtsb-generate-embedding" href="%2$s">%3$s</a>',
1653 + esc_html__( 'Make Compatible your existing products with semantic search process.', 'shopbuilder' ),
1654 + esc_url( $generate_url ),
1655 + esc_html__( 'Generate Embeddings', 'shopbuilder' )
1656 + );
1657 + } else {
1658 + $text = esc_html__( '🎉 Congratulations! All your products are successfully embedded and up to date.', 'shopbuilder' );
1659 + }
1660 + }
1661 + $note = [
1662 + 'OpenAI' => [
1663 + 'id' => 'data_training_note_openai',
1664 + 'type' => 'description',
1665 + 'text' => $text,
1666 + 'dependency' => [
1667 + 'rules' => [
1668 + [
1669 + 'item' => 'general.ai_implementation.ai_tools',
1670 + 'value' => 'OpenAI',
1671 + 'operator' => '==',
1672 + ],
1673 + [
1674 + 'item' => 'general.ai_implementation.gpt_api_key',
1675 + 'value' => '',
1676 + 'operator' => '!=',
1677 + ],
1678 + ],
1679 + ],
1680 + ],
1681 + 'Gemini' => [
1682 + 'id' => 'data_training_note_gemini',
1683 + 'type' => 'description',
1684 + 'text' => $text,
1685 + 'dependency' => [
1686 + 'rules' => [
1687 + [
1688 + 'item' => 'general.ai_implementation.ai_tools',
1689 + 'value' => 'Gemini',
1690 + 'operator' => '==',
1691 + ],
1692 + [
1693 + 'item' => 'general.ai_implementation.gemini_api_key',
1694 + 'value' => '',
1695 + 'operator' => '!=',
1696 + ],
1697 + ],
1698 + ],
1699 + ],
1700 + 'missingGeminiKey' => [
1701 + 'id' => 'data_training_note_missing_gemneni_key',
1702 + 'type' => 'description',
1703 + 'text' => esc_html__( 'Missing Gemini API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1704 + 'dependency' => [
1705 + 'rules' => [
1706 + [
1707 + 'item' => 'general.ai_implementation.ai_tools',
1708 + 'value' => 'Gemini',
1709 + 'operator' => '==',
1710 + ],
1711 + [
1712 + 'item' => 'general.ai_implementation.gemini_api_key',
1713 + 'value' => '',
1714 + 'operator' => '==',
1715 + ],
1716 + ],
1717 + ],
1718 + ],
1719 + 'missingOpenAIKey' => [
1720 + 'id' => 'data_training_note_missing_openai_key',
1721 + 'type' => 'description',
1722 + 'text' => esc_html__( 'Missing OpenAI API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1723 + 'dependency' => [
1724 + 'rules' => [
1725 + [
1726 + 'item' => 'general.ai_implementation.ai_tools',
1727 + 'value' => 'OpenAI',
1728 + 'operator' => '==',
1729 + ],
1730 + [
1731 + 'item' => 'general.ai_implementation.gpt_api_key',
1732 + 'value' => '',
1733 + 'operator' => '==',
1734 + ],
1735 + ],
1736 + ],
1737 + ],
1738 + ];
1739 + return $note[ $tool ] ?? [];
1351 1740 }
1352 1741 }