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 +530 -163 2.1.123.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',
@@ -82,8 +454,21 @@
82 454 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
83 455 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
84 456 ],
85 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 + ],
86 471 'notification_color' => [
87 472 'id' => 'notification_color',
88 473 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
89 474 'type' => 'color',
@@ -109,9 +494,9 @@
109 494 ],
110 495 ],
111 496 ],
112 497 ),
113 - 'social_share' => apply_filters(
498 + 'social_share' => apply_filters(
114 499 'rtsb/settings/social_share/options',
115 500 [
116 501 'id' => 'social_share',
117 502 'category' => 'general',
@@ -139,25 +524,8 @@
139 524 'type' => 'switch',
140 525 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
141 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' ),
142 527 ],
143 - /*
144 - * TODO : Implement later.
145 - 'share_icon_show_to_product_page' => array(
146 - 'id' => 'share_icon_show_to_product_page',
147 - 'type' => 'switch',
148 - 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
149 - 'dependency' => [
150 - 'rules' => [
151 - [
152 - 'item' => 'general.social_share.share_platforms_to_product_page',
153 - 'value' => 'on',
154 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
155 - ],
156 - ],
157 - ],
158 - ),
159 - */
160 528 'share_icon_layout' => [
161 529 'type' => 'select',
162 530 'value' => 'share-layout1',
163 531 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -177,9 +545,9 @@
177 545 ],
178 546 ],
179 547 ],
180 548 ),
181 - 'guest_user' => apply_filters(
549 + 'guest_user' => apply_filters(
182 550 'rtsb/settings/guest_user/options',
183 551 [
184 552 'id' => 'guest_user',
185 553 'category' => 'general',
@@ -189,9 +557,9 @@
189 557 'disable' => true,
190 558 ],
191 559 ],
192 560 ),
193 - 'tooltip' => apply_filters(
561 + 'tooltip' => apply_filters(
194 562 'rtsb/settings/tooltip/options',
195 563 [
196 564 'id' => 'tooltip',
197 565 'category' => 'general',
@@ -201,9 +569,9 @@
201 569 'disable' => true,
202 570 ],
203 571 ],
204 572 ),
205 - 'billing_form' => apply_filters(
573 + 'billing_form' => apply_filters(
206 574 'rtsb/settings/billing_form/options',
207 575 [
208 576 'id' => 'billing_form',
209 577 'category' => 'checkout',
@@ -209,17 +577,22 @@
209 577 'category' => 'checkout',
210 578 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
211 579 'package' => 'free',
212 580 'active_field' => [
213 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
214 - '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' ),
215 583 ],
216 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 + ],
217 591 'billing_first_name_heading' => [
218 592 'id' => 'billing_first_name_heading',
219 593 'type' => 'title',
220 594 'label' => esc_html__( 'First Name', 'shopbuilder' ),
221 - // 'tab' => 'name',
222 595 ],
223 596 'billing_first_name' => [
224 597 'id' => 'billing_first_name',
225 598 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -235,9 +608,8 @@
235 608 'value' => 'required',
236 609 'label' => 'Required Field',
237 610 ],
238 611 ],
239 - // 'tab' => 'name',
240 612 ],
241 613 'billing_first_name_label' => [
242 614 'id' => 'billing_first_name_label',
243 615 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -242,15 +614,14 @@
242 614 'id' => 'billing_first_name_label',
243 615 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
244 616 'type' => 'text',
245 617 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
246 - // 'tab' => 'name',
247 618 'dependency' => [
248 619 'rules' => [
249 620 [
250 621 'item' => 'general.billing_form.billing_first_name',
251 622 'value' => 'show',
252 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
623 + 'operator' => '==',
253 624 ],
254 625 ],
255 626 ],
256 627 ],
@@ -258,15 +629,14 @@
258 629 'id' => 'billing_first_name_placeholder',
259 630 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
260 631 'type' => 'text',
261 632 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
262 - // 'tab' => 'name',
263 633 'dependency' => [
264 634 'rules' => [
265 635 [
266 636 'item' => 'general.billing_form.billing_first_name',
267 637 'value' => 'show',
268 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
638 + 'operator' => '==',
269 639 ],
270 640 ],
271 641 ],
272 642 ],
@@ -274,9 +644,8 @@
274 644 'billing_last_name_heading' => [
275 645 'id' => 'billing_last_name_heading',
276 646 'type' => 'title',
277 647 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
278 - // 'tab' => 'name',
279 648 ],
280 649 'billing_last_name' => [
281 650 'id' => 'billing_last_name',
282 651 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -292,9 +661,8 @@
292 661 'value' => 'required',
293 662 'label' => 'Required Field',
294 663 ],
295 664 ],
296 - // 'tab' => 'name',
297 665 ],
298 666
299 667 'billing_last_name_label' => [
300 668 'id' => 'billing_last_name_label',
@@ -300,9 +668,8 @@
300 668 'id' => 'billing_last_name_label',
301 669 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
302 670 'type' => 'text',
303 671 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
304 - // 'tab' => 'name',
305 672 'dependency' => [
306 673 'rules' => [
307 674 [
308 675 'item' => 'general.billing_form.billing_last_name',
@@ -316,9 +683,8 @@
316 683 'id' => 'billing_last_name_placeholder',
317 684 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
318 685 'type' => 'text',
319 686 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
320 - // 'tab' => 'name',
321 687 'dependency' => [
322 688 'rules' => [
323 689 [
324 690 'item' => 'general.billing_form.billing_last_name',
@@ -332,9 +698,8 @@
332 698 'billing_company_heading' => [
333 699 'id' => 'billing_company_heading',
334 700 'type' => 'title',
335 701 'label' => esc_html__( 'Company', 'shopbuilder' ),
336 - // 'tab' => 'company',
337 702 ],
338 703 'billing_company' => [
339 704 'id' => 'billing_company',
340 705 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -353,9 +718,8 @@
353 718 'value' => 'required',
354 719 'label' => 'Required Field',
355 720 ],
356 721 ],
357 - // 'tab' => 'company',
358 722 ],
359 723
360 724 'billing_company_label' => [
361 725 'id' => 'billing_company_label',
@@ -361,9 +725,8 @@
361 725 'id' => 'billing_company_label',
362 726 'label' => esc_html__( 'Company label', 'shopbuilder' ),
363 727 'type' => 'text',
364 728 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
365 - // 'tab' => 'company',
366 729 'dependency' => [
367 730 'rules' => [
368 731 [
369 732 'item' => 'general.billing_form.billing_company',
@@ -377,9 +740,8 @@
377 740 'id' => 'billing_company_placeholder',
378 741 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
379 742 'type' => 'text',
380 743 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
381 - // 'tab' => 'company',
382 744 'dependency' => [
383 745 'rules' => [
384 746 [
385 747 'item' => 'general.billing_form.billing_company',
@@ -393,9 +755,8 @@
393 755 'billing_country_heading' => [
394 756 'id' => 'billing_country_heading',
395 757 'type' => 'title',
396 758 'label' => esc_html__( 'Country', 'shopbuilder' ),
397 - // 'tab' => 'country',
398 759 ],
399 760 'billing_country' => [
400 761 'id' => 'billing_country',
401 762 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -401,22 +762,18 @@
401 762 'label' => esc_html__( 'Country', 'shopbuilder' ),
402 763 'type' => 'checkbox',
403 764 'orientation' => 'vertical',
404 765 'value' => [ 'show', 'required' ],
405 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
406 766 'options' => [
407 767 [
408 768 'value' => 'show',
409 769 'label' => 'Show Country?',
410 - // 'disabled' => true,
411 770 ],
412 771 [
413 772 'value' => 'required',
414 773 'label' => 'Required Field',
415 - // 'disabled' => true,
416 774 ],
417 775 ],
418 - // 'tab' => 'country',
419 776 ],
420 777
421 778 'billing_country_label' => [
422 779 'id' => 'billing_country_label',
@@ -422,9 +779,8 @@
422 779 'id' => 'billing_country_label',
423 780 'label' => esc_html__( 'Country label', 'shopbuilder' ),
424 781 'type' => 'text',
425 782 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
426 - // 'tab' => 'country',
427 783 'dependency' => [
428 784 'rules' => [
429 785 [
430 786 'item' => 'general.billing_form.billing_country',
@@ -437,9 +793,8 @@
437 793 'billing_address_1_heading' => [
438 794 'id' => 'billing_address_1_heading',
439 795 'type' => 'title',
440 796 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
441 - // 'tab' => 'address',
442 797 ],
443 798 'billing_address_1' => [
444 799 'id' => 'billing_address_1',
445 800 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -455,9 +810,8 @@
455 810 'value' => 'required',
456 811 'label' => 'Required Field',
457 812 ],
458 813 ],
459 - // 'tab' => 'address',
460 814 ],
461 815
462 816 'billing_address_1_label' => [
463 817 'id' => 'billing_address_1_label',
@@ -463,9 +817,8 @@
463 817 'id' => 'billing_address_1_label',
464 818 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
465 819 'type' => 'text',
466 820 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
467 - // 'tab' => 'address',
468 821 'dependency' => [
469 822 'rules' => [
470 823 [
471 824 'item' => 'general.billing_form.billing_address_1',
@@ -479,9 +832,8 @@
479 832 'id' => 'billing_address_1_placeholder',
480 833 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
481 834 'type' => 'text',
482 835 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
483 - // 'tab' => 'address',
484 836 'dependency' => [
485 837 'rules' => [
486 838 [
487 839 'item' => 'general.billing_form.billing_address_1',
@@ -494,9 +846,8 @@
494 846 'billing_address_2_heading' => [
495 847 'id' => 'billing_address_2_heading',
496 848 'type' => 'title',
497 849 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
498 - // 'tab' => 'address',
499 850 'dependency' => [
500 851 'rules' => [
501 852 [
502 853 'item' => 'general.billing_form.billing_address_1',
@@ -510,9 +861,8 @@
510 861 'id' => 'billing_address_2',
511 862 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
512 863 'type' => 'checkbox',
513 864 'orientation' => 'vertical',
514 - // 'tab' => 'address',
515 865 'value' => [
516 866 'show',
517 867 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
518 868 ],
@@ -538,9 +888,8 @@
538 888 'id' => 'billing_address_2_label',
539 889 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
540 890 'type' => 'text',
541 891 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
542 - // 'tab' => 'address',
543 892 'dependency' => [
544 893 'rules' => [
545 894 [
546 895 'item' => 'general.billing_form.billing_address_1',
@@ -559,9 +908,8 @@
559 908 'id' => 'billing_address_2_placeholder',
560 909 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
561 910 'type' => 'text',
562 911 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
563 - // 'tab' => 'address',
564 912 'dependency' => [
565 913 'rules' => [
566 914 [
567 915 'item' => 'general.billing_form.billing_address_1',
@@ -579,9 +927,8 @@
579 927 'billing_city_heading' => [
580 928 'id' => 'billing_city_heading',
581 929 'type' => 'title',
582 930 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
583 - // 'tab' => 'city',
584 931 ],
585 932 'billing_city' => [
586 933 'id' => 'billing_city',
587 934 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -587,9 +934,8 @@
587 934 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
588 935 'type' => 'checkbox',
589 936 'orientation' => 'vertical',
590 937 'value' => [ 'show', 'required' ],
591 - // 'tab' => 'city',
592 938 'options' => [
593 939 [
594 940 'value' => 'show',
595 941 'label' => 'Show Town / City?',
@@ -605,9 +951,8 @@
605 951 'id' => 'billing_city_label',
606 952 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
607 953 'type' => 'text',
608 954 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
609 - // 'tab' => 'city',
610 955 'dependency' => [
611 956 'rules' => [
612 957 [
613 958 'item' => 'general.billing_form.billing_city',
@@ -621,9 +966,8 @@
621 966 'id' => 'billing_city_placeholder',
622 967 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
623 968 'type' => 'text',
624 969 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
625 - // 'tab' => 'city',
626 970 'dependency' => [
627 971 'rules' => [
628 972 [
629 973 'item' => 'general.billing_form.billing_city',
@@ -636,9 +980,8 @@
636 980 'billing_state_heading' => [
637 981 'id' => 'billing_city_heading',
638 982 'type' => 'title',
639 983 'label' => esc_html__( 'State', 'shopbuilder' ),
640 - // 'tab' => 'state',
641 984 ],
642 985 'billing_state' => [
643 986 'id' => 'billing_state',
644 987 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -654,9 +997,8 @@
654 997 'value' => 'required',
655 998 'label' => 'Required Field',
656 999 ],
657 1000 ],
658 - // 'tab' => 'state',
659 1001 ],
660 1002
661 1003 'billing_state_label' => [
662 1004 'id' => 'billing_state_label',
@@ -662,10 +1004,8 @@
662 1004 'id' => 'billing_state_label',
663 1005 'label' => esc_html__( 'State label', 'shopbuilder' ),
664 1006 'type' => 'text',
665 1007 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
666 - // 'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
667 - // 'tab' => 'state',
668 1008 'dependency' => [
669 1009 'rules' => [
670 1010 [
671 1011 'item' => 'general.billing_form.billing_state',
@@ -678,9 +1018,8 @@
678 1018 'billing_postcode_heading' => [
679 1019 'id' => 'billing_postcode_heading',
680 1020 'type' => 'title',
681 1021 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
682 - // 'tab' => 'postcode',
683 1022 ],
684 1023 'billing_postcode' => [
685 1024 'id' => 'billing_postcode',
686 1025 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -696,9 +1035,8 @@
696 1035 'value' => 'required',
697 1036 'label' => 'Required Field',
698 1037 ],
699 1038 ],
700 - // 'tab' => 'postcode',
701 1039 ],
702 1040 'billing_postcode_label' => [
703 1041 'id' => 'billing_postcode_label',
704 1042 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -703,9 +1041,8 @@
703 1041 'id' => 'billing_postcode_label',
704 1042 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
705 1043 'type' => 'text',
706 1044 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
707 - // 'tab' => 'postcode',
708 1045 'dependency' => [
709 1046 'rules' => [
710 1047 [
711 1048 'item' => 'general.billing_form.billing_postcode',
@@ -719,9 +1056,8 @@
719 1056 'id' => 'billing_postcode_placeholder',
720 1057 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
721 1058 'type' => 'text',
722 1059 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
723 - // 'tab' => 'postcode',
724 1060 'dependency' => [
725 1061 'rules' => [
726 1062 [
727 1063 'item' => 'general.billing_form.billing_postcode',
@@ -734,9 +1070,8 @@
734 1070 'billing_phone_heading' => [
735 1071 'id' => 'billing_phone_heading',
736 1072 'type' => 'title',
737 1073 'label' => esc_html__( 'Phone', 'shopbuilder' ),
738 - // 'tab' => 'phone',
739 1074 ],
740 1075 'billing_phone' => [
741 1076 'id' => 'billing_phone',
742 1077 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -741,9 +1076,8 @@
741 1076 'id' => 'billing_phone',
742 1077 'label' => esc_html__( 'Phone', 'shopbuilder' ),
743 1078 'type' => 'checkbox',
744 1079 'orientation' => 'vertical',
745 - // 'tab' => 'phone',
746 1080 'value' => [
747 1081 'show',
748 1082 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
749 1083 ],
@@ -763,9 +1097,8 @@
763 1097 'id' => 'billing_phone_label',
764 1098 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
765 1099 'type' => 'text',
766 1100 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
767 - // 'tab' => 'phone',
768 1101 'dependency' => [
769 1102 'rules' => [
770 1103 [
771 1104 'item' => 'general.billing_form.billing_phone',
@@ -779,9 +1112,8 @@
779 1112 'id' => 'billing_phone_placeholder',
780 1113 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
781 1114 'type' => 'text',
782 1115 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
783 - // 'tab' => 'phone',
784 1116 'dependency' => [
785 1117 'rules' => [
786 1118 [
787 1119 'item' => 'general.billing_form.billing_phone',
@@ -794,9 +1126,8 @@
794 1126 'billing_email_heading' => [
795 1127 'id' => 'billing_email_heading',
796 1128 'type' => 'title',
797 1129 'label' => esc_html__( 'Email', 'shopbuilder' ),
798 - // 'tab' => 'email',
799 1130 ],
800 1131 'billing_email' => [
801 1132 'id' => 'billing_email',
802 1133 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -801,9 +1132,8 @@
801 1132 'id' => 'billing_email',
802 1133 'label' => esc_html__( 'Email address', 'shopbuilder' ),
803 1134 'type' => 'checkbox',
804 1135 'orientation' => 'vertical',
805 - // 'tab' => 'email',
806 1136 'value' => [ 'show', 'required' ],
807 1137 'options' => [
808 1138 [
809 1139 'value' => 'show',
@@ -819,9 +1149,8 @@
819 1149 'id' => 'billing_email_label',
820 1150 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
821 1151 'type' => 'text',
822 1152 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
823 - // 'tab' => 'email',
824 1153 'dependency' => [
825 1154 'rules' => [
826 1155 [
827 1156 'item' => 'general.billing_form.billing_email',
@@ -835,9 +1164,8 @@
835 1164 'id' => 'billing_email_placeholder',
836 1165 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
837 1166 'type' => 'text',
838 1167 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
839 - // 'tab' => 'email',
840 1168 'dependency' => [
841 1169 'rules' => [
842 1170 [
843 1171 'item' => 'general.billing_form.billing_email',
@@ -850,9 +1178,9 @@
850 1178 ],
851 1179
852 1180 ]
853 1181 ),
854 - 'shipping_form' => apply_filters(
1182 + 'shipping_form' => apply_filters(
855 1183 'rtsb/module/shipping_form/options',
856 1184 [
857 1185 'id' => 'shipping_form',
858 1186 'category' => 'checkout',
@@ -858,17 +1186,22 @@
858 1186 'category' => 'checkout',
859 1187 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
860 1188 'package' => 'free',
861 1189 'active_field' => [
862 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
863 - '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' ),
864 1192 ],
865 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 + ],
866 1200 'shipping_first_name_heading' => [
867 1201 'id' => 'shipping_first_name_heading',
868 1202 'type' => 'title',
869 1203 'label' => esc_html__( 'First Name', 'shopbuilder' ),
870 - // 'tab' => 'name',
871 1204 ],
872 1205 'shipping_first_name' => [
873 1206 'id' => 'shipping_first_name',
874 1207 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -884,9 +1217,8 @@
884 1217 'value' => 'required',
885 1218 'label' => 'Required Field',
886 1219 ],
887 1220 ],
888 - // 'tab' => 'name',
889 1221 ],
890 1222 'shipping_first_name_label' => [
891 1223 'id' => 'shipping_first_name_label',
892 1224 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -891,9 +1223,8 @@
891 1223 'id' => 'shipping_first_name_label',
892 1224 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
893 1225 'type' => 'text',
894 1226 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
895 - // 'tab' => 'name',
896 1227 'dependency' => [
897 1228 'rules' => [
898 1229 [
899 1230 'item' => 'general.shipping_form.shipping_first_name',
@@ -907,9 +1238,8 @@
907 1238 'id' => 'shipping_first_name_placeholder',
908 1239 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
909 1240 'type' => 'text',
910 1241 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
911 - // 'tab' => 'country',
912 1242 'dependency' => [
913 1243 'rules' => [
914 1244 [
915 1245 'item' => 'general.shipping_form.shipping_first_name',
@@ -922,9 +1252,8 @@
922 1252 'shipping_first_last_heading' => [
923 1253 'id' => 'shipping_first_last_heading',
924 1254 'type' => 'title',
925 1255 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
926 - // 'tab' => 'name',
927 1256 ],
928 1257 'shipping_last_name' => [
929 1258 'id' => 'shipping_last_name',
930 1259 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -940,9 +1269,8 @@
940 1269 'value' => 'required',
941 1270 'label' => 'Required Field',
942 1271 ],
943 1272 ],
944 - // 'tab' => 'name',
945 1273 ],
946 1274
947 1275 'shipping_last_name_label' => [
948 1276 'id' => 'shipping_last_name_label',
@@ -948,9 +1276,8 @@
948 1276 'id' => 'shipping_last_name_label',
949 1277 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
950 1278 'type' => 'text',
951 1279 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
952 - // 'tab' => 'name',
953 1280 'dependency' => [
954 1281 'rules' => [
955 1282 [
956 1283 'item' => 'general.shipping_form.shipping_last_name',
@@ -964,9 +1291,8 @@
964 1291 'id' => 'shipping_last_name_placeholder',
965 1292 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
966 1293 'type' => 'text',
967 1294 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
968 - // 'tab' => 'country',
969 1295 'dependency' => [
970 1296 'rules' => [
971 1297 [
972 1298 'item' => 'general.shipping_form.shipping_last_name',
@@ -979,9 +1305,8 @@
979 1305 'shipping_company_heading' => [
980 1306 'id' => 'shipping_company_heading',
981 1307 'type' => 'title',
982 1308 'label' => esc_html__( 'Company', 'shopbuilder' ),
983 - // 'tab' => 'name',
984 1309 ],
985 1310 'shipping_company' => [
986 1311 'id' => 'shipping_company',
987 1312 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -997,9 +1322,8 @@
997 1322 'value' => 'required',
998 1323 'label' => 'Required Field',
999 1324 ],
1000 1325 ],
1001 - // 'tab' => 'company',
1002 1326 ],
1003 1327
1004 1328 'shipping_company_label' => [
1005 1329 'id' => 'shipping_company_label',
@@ -1005,9 +1329,8 @@
1005 1329 'id' => 'shipping_company_label',
1006 1330 'label' => esc_html__( 'Company label', 'shopbuilder' ),
1007 1331 'type' => 'text',
1008 1332 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1009 - // 'tab' => 'company',
1010 1333 'dependency' => [
1011 1334 'rules' => [
1012 1335 [
1013 1336 'item' => 'general.shipping_form.shipping_company',
@@ -1021,9 +1344,8 @@
1021 1344 'id' => 'shipping_company_placeholder',
1022 1345 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1023 1346 'type' => 'text',
1024 1347 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1025 - // 'tab' => 'country',
1026 1348 'dependency' => [
1027 1349 'rules' => [
1028 1350 [
1029 1351 'item' => 'general.shipping_form.shipping_company',
@@ -1036,9 +1358,8 @@
1036 1358 'shipping_country_heading' => [
1037 1359 'id' => 'shipping_country_heading',
1038 1360 'type' => 'title',
1039 1361 'label' => esc_html__( 'Country', 'shopbuilder' ),
1040 - // 'tab' => 'name',
1041 1362 ],
1042 1363 'shipping_country' => [
1043 1364 'id' => 'shipping_country',
1044 1365 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1048,17 +1369,14 @@
1048 1369 'options' => [
1049 1370 [
1050 1371 'value' => 'show',
1051 1372 'label' => 'Show Country?',
1052 - // 'disabled' => true,
1053 1373 ],
1054 1374 [
1055 1375 'value' => 'required',
1056 1376 'label' => 'Required Field',
1057 - // 'disabled' => true,
1058 1377 ],
1059 1378 ],
1060 - // 'tab' => 'country',
1061 1379 ],
1062 1380
1063 1381 'shipping_country_label' => [
1064 1382 'id' => 'shipping_country_label',
@@ -1078,9 +1396,8 @@
1078 1396 'shipping_address_1_heading' => [
1079 1397 'id' => 'shipping_address_1_heading',
1080 1398 'type' => 'title',
1081 1399 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1082 - // 'tab' => 'name',
1083 1400 ],
1084 1401 'shipping_address_1' => [
1085 1402 'id' => 'shipping_address_1',
1086 1403 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1096,9 +1413,8 @@
1096 1413 'value' => 'required',
1097 1414 'label' => 'Required Field',
1098 1415 ],
1099 1416 ],
1100 - // 'tab' => 'country',
1101 1417 ],
1102 1418
1103 1419 'shipping_address_1_label' => [
1104 1420 'id' => 'shipping_address_1_label',
@@ -1104,9 +1420,8 @@
1104 1420 'id' => 'shipping_address_1_label',
1105 1421 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1106 1422 'type' => 'text',
1107 1423 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1108 - // 'tab' => 'country',
1109 1424 'dependency' => [
1110 1425 'rules' => [
1111 1426 [
1112 1427 'item' => 'general.shipping_form.shipping_address_1',
@@ -1120,9 +1435,8 @@
1120 1435 'id' => 'shipping_address_1_placeholder',
1121 1436 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1122 1437 'type' => 'text',
1123 1438 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1124 - // 'tab' => 'country',
1125 1439 'dependency' => [
1126 1440 'rules' => [
1127 1441 [
1128 1442 'item' => 'general.shipping_form.shipping_address_1',
@@ -1135,9 +1449,8 @@
1135 1449 'shipping_address_2_heading' => [
1136 1450 'id' => 'shipping_address_2_heading',
1137 1451 'type' => 'title',
1138 1452 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1139 - // 'tab' => 'name',
1140 1453 'dependency' => [
1141 1454 'rules' => [
1142 1455 [
1143 1456 'item' => 'general.shipping_form.shipping_address_1',
@@ -1159,9 +1472,8 @@
1159 1472 'label' => 'Show Address field?',
1160 1473 ],
1161 1474 ],
1162 1475 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1163 - // 'tab' => 'country',
1164 1476 'dependency' => [
1165 1477 'rules' => [
1166 1478 [
1167 1479 'item' => 'general.shipping_form.shipping_address_1',
@@ -1176,9 +1488,8 @@
1176 1488 'id' => 'shipping_address_2_label',
1177 1489 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1178 1490 'type' => 'text',
1179 1491 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1180 - // 'tab' => 'country',
1181 1492 'dependency' => [
1182 1493 'rules' => [
1183 1494 [
1184 1495 'item' => 'general.shipping_form.shipping_address_1',
@@ -1197,9 +1508,8 @@
1197 1508 'id' => 'shipping_address_2_placeholder',
1198 1509 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1199 1510 'type' => 'text',
1200 1511 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1201 - // 'tab' => 'country',
1202 1512 'dependency' => [
1203 1513 'rules' => [
1204 1514 [
1205 1515 'item' => 'general.shipping_form.shipping_address_1',
@@ -1217,9 +1527,8 @@
1217 1527 'shipping_city_heading' => [
1218 1528 'id' => 'shipping_city_heading',
1219 1529 'type' => 'title',
1220 1530 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1221 - // 'tab' => 'name',
1222 1531 ],
1223 1532 'shipping_city' => [
1224 1533 'id' => 'shipping_city',
1225 1534 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1235,9 +1544,8 @@
1235 1544 'value' => 'required',
1236 1545 'label' => 'Required Field',
1237 1546 ],
1238 1547 ],
1239 - // 'tab' => 'country',
1240 1548 ],
1241 1549 'shipping_city_label' => [
1242 1550 'id' => 'shipping_city_label',
1243 1551 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1242,9 +1550,8 @@
1242 1550 'id' => 'shipping_city_label',
1243 1551 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1244 1552 'type' => 'text',
1245 1553 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1246 - // 'tab' => 'country',
1247 1554 'dependency' => [
1248 1555 'rules' => [
1249 1556 [
1250 1557 'item' => 'general.shipping_form.shipping_city',
@@ -1258,9 +1565,8 @@
1258 1565 'id' => 'shipping_city_placeholder',
1259 1566 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1260 1567 'type' => 'text',
1261 1568 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1262 - // 'tab' => 'country',
1263 1569 'dependency' => [
1264 1570 'rules' => [
1265 1571 [
1266 1572 'item' => 'general.shipping_form.shipping_city',
@@ -1273,9 +1579,8 @@
1273 1579 'shipping_state_heading' => [
1274 1580 'id' => 'shipping_state_heading',
1275 1581 'type' => 'title',
1276 1582 'label' => esc_html__( 'Others', 'shopbuilder' ),
1277 - // 'tab' => 'name',
1278 1583 ],
1279 1584 'shipping_state' => [
1280 1585 'id' => 'shipping_state',
1281 1586 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1291,33 +1596,9 @@
1291 1596 'value' => 'required',
1292 1597 'label' => 'Required Field',
1293 1598 ],
1294 1599 ],
1295 - // 'tab' => 'country',
1296 1600 ],
1297 - //
1298 - // 'shipping_state_label' => [
1299 - // 'id' => 'shipping_state_label',
1300 - // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1301 - // 'type' => 'text',
1302 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1303 - // 'tab' => 'country',
1304 - // 'dependency' => [
1305 - // 'rules' => [
1306 - // [
1307 - // 'item' => 'general.shipping_form.shipping_state',
1308 - // 'value' => 'show',
1309 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1310 - // ],
1311 - // ],
1312 - // ],
1313 - // ],
1314 - // 'shipping_postcode_heading' => [
1315 - // 'id' => 'shipping_postcode_heading',
1316 - // 'type' => 'title',
1317 - // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1318 - // 'tab' => 'name',
1319 - // ],
1320 1601 'shipping_postcode' => [
1321 1602 'id' => 'shipping_postcode',
1322 1603 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1323 1604 'type' => 'checkbox',
@@ -1328,47 +1609,133 @@
1328 1609 'value' => 'show',
1329 1610 'label' => 'Show Postcode / ZIP?',
1330 1611 ],
1331 1612 ],
1332 - // 'tab' => 'country',
1333 1613 ],
1334 - // 'shipping_postcode_label' => [
1335 - // 'id' => 'shipping_postcode_label',
1336 - // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1337 - // 'type' => 'text',
1338 - // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1339 - // 'tab' => 'country',
1340 - // 'dependency' => [
1341 - // 'rules' => [
1342 - // [
1343 - // 'item' => 'general.shipping_form.shipping_postcode',
1344 - // 'value' => 'show',
1345 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1346 - // ],
1347 - // ],
1348 - // ],
1349 - // ],
1350 - // 'shipping_postcode_placeholder' => [
1351 - // 'id' => 'shipping_postcode_placeholder',
1352 - // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1353 - // 'type' => 'text',
1354 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1355 - // 'tab' => 'country',
1356 - // 'dependency' => [
1357 - // 'rules' => [
1358 - // [
1359 - // 'item' => 'general.shipping_form.shipping_postcode',
1360 - // 'value' => 'show',
1361 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1362 - // ],
1363 - // ],
1364 - // ],
1365 - // ],
1366 1614
1367 1615 ],
1368 1616 ]
1369 1617 ),
1618 +
1370 1619 ];
1371 1620
1621 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1622 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1623 + }
1372 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 ] ?? [];
1373 1740 }
1374 1741 }