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