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