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