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 +594 -202 2.0.13.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',
@@ -62,8 +433,13 @@
62 433 'active_field' => [
63 434 'disable' => true,
64 435 ],
65 436 'fields' => [
437 + 'notification_intro' => [
438 + 'id' => 'notification_intro',
439 + 'type' => 'description',
440 + 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
441 + ],
66 442 'notification_position' => [
67 443 'id' => 'notification_position',
68 444 'value' => 'center-center',
69 445 'type' => 'select',
@@ -68,19 +444,30 @@
68 444 'value' => 'center-center',
69 445 'type' => 'select',
70 446 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
71 447 'options' => [
72 - 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
73 - 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
74 - 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
75 - 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
76 - 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
77 - //'top-full-width' => esc_html__( 'Top Full Width', 'shopbuilder' ),
78 - //'bottom-full-width' => esc_html__( 'Bottom Full Width', 'shopbuilder' ),
79 - 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
80 - 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
448 + 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
449 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
450 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
451 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
452 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
453 + 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
454 + 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
81 455 ],
82 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 + ],
83 470 'notification_color' => [
84 471 'id' => 'notification_color',
85 472 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
86 473 'type' => 'color',
@@ -97,13 +484,18 @@
97 484 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
98 485 'type' => 'color',
99 486 'tab' => 'floating_button',
100 487 ],
101 -
488 + 'hide_notification' => [
489 + 'id' => 'hide_notification',
490 + 'type' => 'switch',
491 + 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ),
492 + 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ),
493 + ],
102 494 ],
103 495 ],
104 496 ),
105 - 'social_share' => apply_filters(
497 + 'social_share' => apply_filters(
106 498 'rtsb/settings/social_share/options',
107 499 [
108 500 'id' => 'social_share',
109 501 'category' => 'general',
@@ -112,8 +504,13 @@
112 504 'active_field' => [
113 505 'disable' => true,
114 506 ],
115 507 'fields' => [
508 + 'social_share_intro' => [
509 + 'id' => 'social_share_intro',
510 + 'type' => 'description',
511 + 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
512 + ],
116 513 'share_platforms' => [
117 514 'id' => 'share_platforms',
118 515 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
119 516 'type' => 'checkbox',
@@ -126,25 +523,8 @@
126 523 'type' => 'switch',
127 524 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
128 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' ),
129 526 ],
130 - /*
131 - * TODO : Implement later.
132 - 'share_icon_show_to_product_page' => array(
133 - 'id' => 'share_icon_show_to_product_page',
134 - 'type' => 'switch',
135 - 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
136 - 'dependency' => [
137 - 'rules' => [
138 - [
139 - 'item' => 'general.social_share.share_platforms_to_product_page',
140 - 'value' => 'on',
141 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
142 - ],
143 - ],
144 - ],
145 - ),
146 - */
147 527 'share_icon_layout' => [
148 528 'type' => 'select',
149 529 'value' => 'share-layout1',
150 530 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -164,9 +544,21 @@
164 544 ],
165 545 ],
166 546 ],
167 547 ),
168 - 'tooltip' => apply_filters(
548 + 'guest_user' => apply_filters(
549 + 'rtsb/settings/guest_user/options',
550 + [
551 + 'id' => 'guest_user',
552 + 'category' => 'general',
553 + 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
554 + 'package' => $this->pro_package(),
555 + 'active_field' => [
556 + 'disable' => true,
557 + ],
558 + ],
559 + ),
560 + 'tooltip' => apply_filters(
169 561 'rtsb/settings/tooltip/options',
170 562 [
171 563 'id' => 'tooltip',
172 564 'category' => 'general',
@@ -176,9 +568,9 @@
176 568 'disable' => true,
177 569 ],
178 570 ],
179 571 ),
180 - 'billing_form' => apply_filters(
572 + 'billing_form' => apply_filters(
181 573 'rtsb/settings/billing_form/options',
182 574 [
183 575 'id' => 'billing_form',
184 576 'category' => 'checkout',
@@ -184,17 +576,22 @@
184 576 'category' => 'checkout',
185 577 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
186 578 'package' => 'free',
187 579 'active_field' => [
188 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
189 - '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' ),
190 582 ],
191 583 'fields' => [
192 - 'billing_first_name_heading' => [
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 + ],
590 + 'billing_first_name_heading' => [
193 591 'id' => 'billing_first_name_heading',
194 592 'type' => 'title',
195 593 'label' => esc_html__( 'First Name', 'shopbuilder' ),
196 - // 'tab' => 'name',
197 594 ],
198 595 'billing_first_name' => [
199 596 'id' => 'billing_first_name',
200 597 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -210,9 +607,8 @@
210 607 'value' => 'required',
211 608 'label' => 'Required Field',
212 609 ],
213 610 ],
214 - // 'tab' => 'name',
215 611 ],
216 612 'billing_first_name_label' => [
217 613 'id' => 'billing_first_name_label',
218 614 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -217,15 +613,14 @@
217 613 'id' => 'billing_first_name_label',
218 614 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
219 615 'type' => 'text',
220 616 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
221 - // 'tab' => 'name',
222 617 'dependency' => [
223 618 'rules' => [
224 619 [
225 620 'item' => 'general.billing_form.billing_first_name',
226 621 'value' => 'show',
227 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
622 + 'operator' => '==',
228 623 ],
229 624 ],
230 625 ],
231 626 ],
@@ -233,25 +628,23 @@
233 628 'id' => 'billing_first_name_placeholder',
234 629 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
235 630 'type' => 'text',
236 631 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
237 - // 'tab' => 'name',
238 632 'dependency' => [
239 633 'rules' => [
240 634 [
241 635 'item' => 'general.billing_form.billing_first_name',
242 636 'value' => 'show',
243 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
637 + 'operator' => '==',
244 638 ],
245 639 ],
246 640 ],
247 641 ],
248 642
249 - 'billing_last_name_heading' => [
643 + 'billing_last_name_heading' => [
250 644 'id' => 'billing_last_name_heading',
251 645 'type' => 'title',
252 646 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
253 - //'tab' => 'name',
254 647 ],
255 648 'billing_last_name' => [
256 649 'id' => 'billing_last_name',
257 650 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -267,9 +660,8 @@
267 660 'value' => 'required',
268 661 'label' => 'Required Field',
269 662 ],
270 663 ],
271 - // 'tab' => 'name',
272 664 ],
273 665
274 666 'billing_last_name_label' => [
275 667 'id' => 'billing_last_name_label',
@@ -275,9 +667,8 @@
275 667 'id' => 'billing_last_name_label',
276 668 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
277 669 'type' => 'text',
278 670 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
279 - // 'tab' => 'name',
280 671 'dependency' => [
281 672 'rules' => [
282 673 [
283 674 'item' => 'general.billing_form.billing_last_name',
@@ -291,9 +682,8 @@
291 682 'id' => 'billing_last_name_placeholder',
292 683 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
293 684 'type' => 'text',
294 685 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
295 - // 'tab' => 'name',
296 686 'dependency' => [
297 687 'rules' => [
298 688 [
299 689 'item' => 'general.billing_form.billing_last_name',
@@ -303,13 +693,12 @@
303 693 ],
304 694 ],
305 695 ],
306 696
307 - 'billing_company_heading' => [
697 + 'billing_company_heading' => [
308 698 'id' => 'billing_company_heading',
309 699 'type' => 'title',
310 700 'label' => esc_html__( 'Company', 'shopbuilder' ),
311 - //'tab' => 'company',
312 701 ],
313 702 'billing_company' => [
314 703 'id' => 'billing_company',
315 704 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -328,9 +717,8 @@
328 717 'value' => 'required',
329 718 'label' => 'Required Field',
330 719 ],
331 720 ],
332 - // 'tab' => 'company',
333 721 ],
334 722
335 723 'billing_company_label' => [
336 724 'id' => 'billing_company_label',
@@ -336,9 +724,8 @@
336 724 'id' => 'billing_company_label',
337 725 'label' => esc_html__( 'Company label', 'shopbuilder' ),
338 726 'type' => 'text',
339 727 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
340 - // 'tab' => 'company',
341 728 'dependency' => [
342 729 'rules' => [
343 730 [
344 731 'item' => 'general.billing_form.billing_company',
@@ -352,9 +739,8 @@
352 739 'id' => 'billing_company_placeholder',
353 740 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
354 741 'type' => 'text',
355 742 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
356 - // 'tab' => 'company',
357 743 'dependency' => [
358 744 'rules' => [
359 745 [
360 746 'item' => 'general.billing_form.billing_company',
@@ -364,13 +750,12 @@
364 750 ],
365 751 ],
366 752 ],
367 753
368 - 'billing_country_heading' => [
754 + 'billing_country_heading' => [
369 755 'id' => 'billing_country_heading',
370 756 'type' => 'title',
371 757 'label' => esc_html__( 'Country', 'shopbuilder' ),
372 - //'tab' => 'country',
373 758 ],
374 759 'billing_country' => [
375 760 'id' => 'billing_country',
376 761 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -376,22 +761,18 @@
376 761 'label' => esc_html__( 'Country', 'shopbuilder' ),
377 762 'type' => 'checkbox',
378 763 'orientation' => 'vertical',
379 764 'value' => [ 'show', 'required' ],
380 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
381 765 'options' => [
382 766 [
383 767 'value' => 'show',
384 768 'label' => 'Show Country?',
385 - // 'disabled' => true,
386 769 ],
387 770 [
388 771 'value' => 'required',
389 772 'label' => 'Required Field',
390 - // 'disabled' => true,
391 773 ],
392 774 ],
393 - // 'tab' => 'country',
394 775 ],
395 776
396 777 'billing_country_label' => [
397 778 'id' => 'billing_country_label',
@@ -397,9 +778,8 @@
397 778 'id' => 'billing_country_label',
398 779 'label' => esc_html__( 'Country label', 'shopbuilder' ),
399 780 'type' => 'text',
400 781 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
401 - // 'tab' => 'country',
402 782 'dependency' => [
403 783 'rules' => [
404 784 [
405 785 'item' => 'general.billing_form.billing_country',
@@ -408,13 +788,12 @@
408 788 ],
409 789 ],
410 790 ],
411 791 ],
412 - 'billing_address_1_heading' => [
792 + 'billing_address_1_heading' => [
413 793 'id' => 'billing_address_1_heading',
414 794 'type' => 'title',
415 795 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
416 - //'tab' => 'address',
417 796 ],
418 797 'billing_address_1' => [
419 798 'id' => 'billing_address_1',
420 799 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -430,9 +809,8 @@
430 809 'value' => 'required',
431 810 'label' => 'Required Field',
432 811 ],
433 812 ],
434 - // 'tab' => 'address',
435 813 ],
436 814
437 815 'billing_address_1_label' => [
438 816 'id' => 'billing_address_1_label',
@@ -438,9 +816,8 @@
438 816 'id' => 'billing_address_1_label',
439 817 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
440 818 'type' => 'text',
441 819 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
442 - // 'tab' => 'address',
443 820 'dependency' => [
444 821 'rules' => [
445 822 [
446 823 'item' => 'general.billing_form.billing_address_1',
@@ -454,9 +831,8 @@
454 831 'id' => 'billing_address_1_placeholder',
455 832 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
456 833 'type' => 'text',
457 834 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
458 - // 'tab' => 'address',
459 835 'dependency' => [
460 836 'rules' => [
461 837 [
462 838 'item' => 'general.billing_form.billing_address_1',
@@ -465,14 +841,13 @@
465 841 ],
466 842 ],
467 843 ],
468 844 ],
469 - 'billing_address_2_heading' => [
470 - 'id' => 'billing_address_2_heading',
471 - 'type' => 'title',
472 - 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
473 - //'tab' => 'address',
474 - 'dependency' => [
845 + 'billing_address_2_heading' => [
846 + 'id' => 'billing_address_2_heading',
847 + 'type' => 'title',
848 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
849 + 'dependency' => [
475 850 'rules' => [
476 851 [
477 852 'item' => 'general.billing_form.billing_address_1',
478 853 'value' => 'show',
@@ -485,11 +860,11 @@
485 860 'id' => 'billing_address_2',
486 861 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
487 862 'type' => 'checkbox',
488 863 'orientation' => 'vertical',
489 - // 'tab' => 'address',
490 - 'value' => [ 'show',
491 - 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
864 + 'value' => [
865 + 'show',
866 + 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
492 867 ],
493 868 'options' => [
494 869 [
495 870 'value' => 'show',
@@ -512,9 +887,8 @@
512 887 'id' => 'billing_address_2_label',
513 888 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
514 889 'type' => 'text',
515 890 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
516 - // 'tab' => 'address',
517 891 'dependency' => [
518 892 'rules' => [
519 893 [
520 894 'item' => 'general.billing_form.billing_address_1',
@@ -533,9 +907,8 @@
533 907 'id' => 'billing_address_2_placeholder',
534 908 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
535 909 'type' => 'text',
536 910 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
537 - // 'tab' => 'address',
538 911 'dependency' => [
539 912 'rules' => [
540 913 [
541 914 'item' => 'general.billing_form.billing_address_1',
@@ -549,13 +922,12 @@
549 922 ],
550 923 ],
551 924 ],
552 925 ],
553 - 'billing_city_heading' => [
926 + 'billing_city_heading' => [
554 927 'id' => 'billing_city_heading',
555 928 'type' => 'title',
556 929 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
557 - // 'tab' => 'city',
558 930 ],
559 931 'billing_city' => [
560 932 'id' => 'billing_city',
561 933 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -561,9 +933,8 @@
561 933 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
562 934 'type' => 'checkbox',
563 935 'orientation' => 'vertical',
564 936 'value' => [ 'show', 'required' ],
565 - // 'tab' => 'city',
566 937 'options' => [
567 938 [
568 939 'value' => 'show',
569 940 'label' => 'Show Town / City?',
@@ -579,9 +950,8 @@
579 950 'id' => 'billing_city_label',
580 951 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
581 952 'type' => 'text',
582 953 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
583 - // 'tab' => 'city',
584 954 'dependency' => [
585 955 'rules' => [
586 956 [
587 957 'item' => 'general.billing_form.billing_city',
@@ -595,9 +965,8 @@
595 965 'id' => 'billing_city_placeholder',
596 966 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
597 967 'type' => 'text',
598 968 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
599 - // 'tab' => 'city',
600 969 'dependency' => [
601 970 'rules' => [
602 971 [
603 972 'item' => 'general.billing_form.billing_city',
@@ -606,13 +975,12 @@
606 975 ],
607 976 ],
608 977 ],
609 978 ],
610 - 'billing_state_heading' => [
979 + 'billing_state_heading' => [
611 980 'id' => 'billing_city_heading',
612 981 'type' => 'title',
613 982 'label' => esc_html__( 'State', 'shopbuilder' ),
614 - // 'tab' => 'state',
615 983 ],
616 984 'billing_state' => [
617 985 'id' => 'billing_state',
618 986 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -628,9 +996,8 @@
628 996 'value' => 'required',
629 997 'label' => 'Required Field',
630 998 ],
631 999 ],
632 - // 'tab' => 'state',
633 1000 ],
634 1001
635 1002 'billing_state_label' => [
636 1003 'id' => 'billing_state_label',
@@ -636,10 +1003,8 @@
636 1003 'id' => 'billing_state_label',
637 1004 'label' => esc_html__( 'State label', 'shopbuilder' ),
638 1005 'type' => 'text',
639 1006 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
640 - //'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
641 - // 'tab' => 'state',
642 1007 'dependency' => [
643 1008 'rules' => [
644 1009 [
645 1010 'item' => 'general.billing_form.billing_state',
@@ -648,13 +1013,12 @@
648 1013 ],
649 1014 ],
650 1015 ],
651 1016 ],
652 - 'billing_postcode_heading' => [
1017 + 'billing_postcode_heading' => [
653 1018 'id' => 'billing_postcode_heading',
654 1019 'type' => 'title',
655 1020 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
656 - // 'tab' => 'postcode',
657 1021 ],
658 1022 'billing_postcode' => [
659 1023 'id' => 'billing_postcode',
660 1024 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -670,9 +1034,8 @@
670 1034 'value' => 'required',
671 1035 'label' => 'Required Field',
672 1036 ],
673 1037 ],
674 - // 'tab' => 'postcode',
675 1038 ],
676 1039 'billing_postcode_label' => [
677 1040 'id' => 'billing_postcode_label',
678 1041 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -677,9 +1040,8 @@
677 1040 'id' => 'billing_postcode_label',
678 1041 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
679 1042 'type' => 'text',
680 1043 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
681 - // 'tab' => 'postcode',
682 1044 'dependency' => [
683 1045 'rules' => [
684 1046 [
685 1047 'item' => 'general.billing_form.billing_postcode',
@@ -693,9 +1055,8 @@
693 1055 'id' => 'billing_postcode_placeholder',
694 1056 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
695 1057 'type' => 'text',
696 1058 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
697 - // 'tab' => 'postcode',
698 1059 'dependency' => [
699 1060 'rules' => [
700 1061 [
701 1062 'item' => 'general.billing_form.billing_postcode',
@@ -704,13 +1065,12 @@
704 1065 ],
705 1066 ],
706 1067 ],
707 1068 ],
708 - 'billing_phone_heading' => [
1069 + 'billing_phone_heading' => [
709 1070 'id' => 'billing_phone_heading',
710 1071 'type' => 'title',
711 1072 'label' => esc_html__( 'Phone', 'shopbuilder' ),
712 - // 'tab' => 'phone',
713 1073 ],
714 1074 'billing_phone' => [
715 1075 'id' => 'billing_phone',
716 1076 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -715,9 +1075,8 @@
715 1075 'id' => 'billing_phone',
716 1076 'label' => esc_html__( 'Phone', 'shopbuilder' ),
717 1077 'type' => 'checkbox',
718 1078 'orientation' => 'vertical',
719 - // 'tab' => 'phone',
720 1079 'value' => [
721 1080 'show',
722 1081 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
723 1082 ],
@@ -737,9 +1096,8 @@
737 1096 'id' => 'billing_phone_label',
738 1097 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
739 1098 'type' => 'text',
740 1099 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
741 - // 'tab' => 'phone',
742 1100 'dependency' => [
743 1101 'rules' => [
744 1102 [
745 1103 'item' => 'general.billing_form.billing_phone',
@@ -753,9 +1111,8 @@
753 1111 'id' => 'billing_phone_placeholder',
754 1112 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
755 1113 'type' => 'text',
756 1114 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
757 - // 'tab' => 'phone',
758 1115 'dependency' => [
759 1116 'rules' => [
760 1117 [
761 1118 'item' => 'general.billing_form.billing_phone',
@@ -764,13 +1121,12 @@
764 1121 ],
765 1122 ],
766 1123 ],
767 1124 ],
768 - 'billing_email_heading' => [
1125 + 'billing_email_heading' => [
769 1126 'id' => 'billing_email_heading',
770 1127 'type' => 'title',
771 1128 'label' => esc_html__( 'Email', 'shopbuilder' ),
772 - // 'tab' => 'email',
773 1129 ],
774 1130 'billing_email' => [
775 1131 'id' => 'billing_email',
776 1132 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -775,9 +1131,8 @@
775 1131 'id' => 'billing_email',
776 1132 'label' => esc_html__( 'Email address', 'shopbuilder' ),
777 1133 'type' => 'checkbox',
778 1134 'orientation' => 'vertical',
779 - // 'tab' => 'email',
780 1135 'value' => [ 'show', 'required' ],
781 1136 'options' => [
782 1137 [
783 1138 'value' => 'show',
@@ -793,9 +1148,8 @@
793 1148 'id' => 'billing_email_label',
794 1149 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
795 1150 'type' => 'text',
796 1151 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
797 - // 'tab' => 'email',
798 1152 'dependency' => [
799 1153 'rules' => [
800 1154 [
801 1155 'item' => 'general.billing_form.billing_email',
@@ -809,9 +1163,8 @@
809 1163 'id' => 'billing_email_placeholder',
810 1164 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
811 1165 'type' => 'text',
812 1166 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
813 - // 'tab' => 'email',
814 1167 'dependency' => [
815 1168 'rules' => [
816 1169 [
817 1170 'item' => 'general.billing_form.billing_email',
@@ -824,9 +1177,9 @@
824 1177 ],
825 1178
826 1179 ]
827 1180 ),
828 - 'shipping_form' => apply_filters(
1181 + 'shipping_form' => apply_filters(
829 1182 'rtsb/module/shipping_form/options',
830 1183 [
831 1184 'id' => 'shipping_form',
832 1185 'category' => 'checkout',
@@ -832,17 +1185,22 @@
832 1185 'category' => 'checkout',
833 1186 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
834 1187 'package' => 'free',
835 1188 'active_field' => [
836 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
837 - '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' ),
838 1191 ],
839 1192 'fields' => [
840 - 'shipping_first_name_heading' => [
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 + ],
1199 + 'shipping_first_name_heading' => [
841 1200 'id' => 'shipping_first_name_heading',
842 1201 'type' => 'title',
843 1202 'label' => esc_html__( 'First Name', 'shopbuilder' ),
844 - // 'tab' => 'name',
845 1203 ],
846 1204 'shipping_first_name' => [
847 1205 'id' => 'shipping_first_name',
848 1206 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -858,9 +1216,8 @@
858 1216 'value' => 'required',
859 1217 'label' => 'Required Field',
860 1218 ],
861 1219 ],
862 - // 'tab' => 'name',
863 1220 ],
864 1221 'shipping_first_name_label' => [
865 1222 'id' => 'shipping_first_name_label',
866 1223 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -865,9 +1222,8 @@
865 1222 'id' => 'shipping_first_name_label',
866 1223 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
867 1224 'type' => 'text',
868 1225 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
869 - // 'tab' => 'name',
870 1226 'dependency' => [
871 1227 'rules' => [
872 1228 [
873 1229 'item' => 'general.shipping_form.shipping_first_name',
@@ -881,9 +1237,8 @@
881 1237 'id' => 'shipping_first_name_placeholder',
882 1238 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
883 1239 'type' => 'text',
884 1240 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
885 - // 'tab' => 'country',
886 1241 'dependency' => [
887 1242 'rules' => [
888 1243 [
889 1244 'item' => 'general.shipping_form.shipping_first_name',
@@ -892,13 +1247,12 @@
892 1247 ],
893 1248 ],
894 1249 ],
895 1250 ],
896 - 'shipping_first_last_heading' => [
1251 + 'shipping_first_last_heading' => [
897 1252 'id' => 'shipping_first_last_heading',
898 1253 'type' => 'title',
899 1254 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
900 - // 'tab' => 'name',
901 1255 ],
902 1256 'shipping_last_name' => [
903 1257 'id' => 'shipping_last_name',
904 1258 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -914,9 +1268,8 @@
914 1268 'value' => 'required',
915 1269 'label' => 'Required Field',
916 1270 ],
917 1271 ],
918 - // 'tab' => 'name',
919 1272 ],
920 1273
921 1274 'shipping_last_name_label' => [
922 1275 'id' => 'shipping_last_name_label',
@@ -922,9 +1275,8 @@
922 1275 'id' => 'shipping_last_name_label',
923 1276 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
924 1277 'type' => 'text',
925 1278 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
926 - // 'tab' => 'name',
927 1279 'dependency' => [
928 1280 'rules' => [
929 1281 [
930 1282 'item' => 'general.shipping_form.shipping_last_name',
@@ -938,9 +1290,8 @@
938 1290 'id' => 'shipping_last_name_placeholder',
939 1291 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
940 1292 'type' => 'text',
941 1293 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
942 - // 'tab' => 'country',
943 1294 'dependency' => [
944 1295 'rules' => [
945 1296 [
946 1297 'item' => 'general.shipping_form.shipping_last_name',
@@ -949,13 +1300,12 @@
949 1300 ],
950 1301 ],
951 1302 ],
952 1303 ],
953 - 'shipping_company_heading' => [
1304 + 'shipping_company_heading' => [
954 1305 'id' => 'shipping_company_heading',
955 1306 'type' => 'title',
956 1307 'label' => esc_html__( 'Company', 'shopbuilder' ),
957 - // 'tab' => 'name',
958 1308 ],
959 1309 'shipping_company' => [
960 1310 'id' => 'shipping_company',
961 1311 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -971,9 +1321,8 @@
971 1321 'value' => 'required',
972 1322 'label' => 'Required Field',
973 1323 ],
974 1324 ],
975 - // 'tab' => 'company',
976 1325 ],
977 1326
978 1327 'shipping_company_label' => [
979 1328 'id' => 'shipping_company_label',
@@ -979,9 +1328,8 @@
979 1328 'id' => 'shipping_company_label',
980 1329 'label' => esc_html__( 'Company label', 'shopbuilder' ),
981 1330 'type' => 'text',
982 1331 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
983 - // 'tab' => 'company',
984 1332 'dependency' => [
985 1333 'rules' => [
986 1334 [
987 1335 'item' => 'general.shipping_form.shipping_company',
@@ -995,9 +1343,8 @@
995 1343 'id' => 'shipping_company_placeholder',
996 1344 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
997 1345 'type' => 'text',
998 1346 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
999 - // 'tab' => 'country',
1000 1347 'dependency' => [
1001 1348 'rules' => [
1002 1349 [
1003 1350 'item' => 'general.shipping_form.shipping_company',
@@ -1006,13 +1353,12 @@
1006 1353 ],
1007 1354 ],
1008 1355 ],
1009 1356 ],
1010 - 'shipping_country_heading' => [
1357 + 'shipping_country_heading' => [
1011 1358 'id' => 'shipping_country_heading',
1012 1359 'type' => 'title',
1013 1360 'label' => esc_html__( 'Country', 'shopbuilder' ),
1014 - // 'tab' => 'name',
1015 1361 ],
1016 1362 'shipping_country' => [
1017 1363 'id' => 'shipping_country',
1018 1364 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1022,17 +1368,14 @@
1022 1368 'options' => [
1023 1369 [
1024 1370 'value' => 'show',
1025 1371 'label' => 'Show Country?',
1026 - // 'disabled' => true,
1027 1372 ],
1028 1373 [
1029 1374 'value' => 'required',
1030 1375 'label' => 'Required Field',
1031 - // 'disabled' => true,
1032 1376 ],
1033 1377 ],
1034 - // 'tab' => 'country',
1035 1378 ],
1036 1379
1037 1380 'shipping_country_label' => [
1038 1381 'id' => 'shipping_country_label',
@@ -1048,13 +1391,12 @@
1048 1391 ],
1049 1392 ],
1050 1393 ],
1051 1394 ],
1052 - 'shipping_address_1_heading' => [
1395 + 'shipping_address_1_heading' => [
1053 1396 'id' => 'shipping_address_1_heading',
1054 1397 'type' => 'title',
1055 1398 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1056 - // 'tab' => 'name',
1057 1399 ],
1058 1400 'shipping_address_1' => [
1059 1401 'id' => 'shipping_address_1',
1060 1402 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1070,9 +1412,8 @@
1070 1412 'value' => 'required',
1071 1413 'label' => 'Required Field',
1072 1414 ],
1073 1415 ],
1074 - // 'tab' => 'country',
1075 1416 ],
1076 1417
1077 1418 'shipping_address_1_label' => [
1078 1419 'id' => 'shipping_address_1_label',
@@ -1078,9 +1419,8 @@
1078 1419 'id' => 'shipping_address_1_label',
1079 1420 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1080 1421 'type' => 'text',
1081 1422 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1082 - // 'tab' => 'country',
1083 1423 'dependency' => [
1084 1424 'rules' => [
1085 1425 [
1086 1426 'item' => 'general.shipping_form.shipping_address_1',
@@ -1094,9 +1434,8 @@
1094 1434 'id' => 'shipping_address_1_placeholder',
1095 1435 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1096 1436 'type' => 'text',
1097 1437 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1098 - // 'tab' => 'country',
1099 1438 'dependency' => [
1100 1439 'rules' => [
1101 1440 [
1102 1441 'item' => 'general.shipping_form.shipping_address_1',
@@ -1105,14 +1444,13 @@
1105 1444 ],
1106 1445 ],
1107 1446 ],
1108 1447 ],
1109 - 'shipping_address_2_heading' => [
1110 - 'id' => 'shipping_address_2_heading',
1111 - 'type' => 'title',
1112 - 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1113 - // 'tab' => 'name',
1114 - 'dependency' => [
1448 + 'shipping_address_2_heading' => [
1449 + 'id' => 'shipping_address_2_heading',
1450 + 'type' => 'title',
1451 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1452 + 'dependency' => [
1115 1453 'rules' => [
1116 1454 [
1117 1455 'item' => 'general.shipping_form.shipping_address_1',
1118 1456 'value' => 'show',
@@ -1133,9 +1471,8 @@
1133 1471 'label' => 'Show Address field?',
1134 1472 ],
1135 1473 ],
1136 1474 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1137 - // 'tab' => 'country',
1138 1475 'dependency' => [
1139 1476 'rules' => [
1140 1477 [
1141 1478 'item' => 'general.shipping_form.shipping_address_1',
@@ -1150,9 +1487,8 @@
1150 1487 'id' => 'shipping_address_2_label',
1151 1488 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1152 1489 'type' => 'text',
1153 1490 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1154 - // 'tab' => 'country',
1155 1491 'dependency' => [
1156 1492 'rules' => [
1157 1493 [
1158 1494 'item' => 'general.shipping_form.shipping_address_1',
@@ -1171,9 +1507,8 @@
1171 1507 'id' => 'shipping_address_2_placeholder',
1172 1508 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1173 1509 'type' => 'text',
1174 1510 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1175 - // 'tab' => 'country',
1176 1511 'dependency' => [
1177 1512 'rules' => [
1178 1513 [
1179 1514 'item' => 'general.shipping_form.shipping_address_1',
@@ -1187,13 +1522,12 @@
1187 1522 ],
1188 1523 ],
1189 1524 ],
1190 1525 ],
1191 - 'shipping_city_heading' => [
1526 + 'shipping_city_heading' => [
1192 1527 'id' => 'shipping_city_heading',
1193 1528 'type' => 'title',
1194 1529 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1195 - // 'tab' => 'name',
1196 1530 ],
1197 1531 'shipping_city' => [
1198 1532 'id' => 'shipping_city',
1199 1533 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1209,9 +1543,8 @@
1209 1543 'value' => 'required',
1210 1544 'label' => 'Required Field',
1211 1545 ],
1212 1546 ],
1213 - // 'tab' => 'country',
1214 1547 ],
1215 1548 'shipping_city_label' => [
1216 1549 'id' => 'shipping_city_label',
1217 1550 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1216,9 +1549,8 @@
1216 1549 'id' => 'shipping_city_label',
1217 1550 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1218 1551 'type' => 'text',
1219 1552 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1220 - // 'tab' => 'country',
1221 1553 'dependency' => [
1222 1554 'rules' => [
1223 1555 [
1224 1556 'item' => 'general.shipping_form.shipping_city',
@@ -1232,9 +1564,8 @@
1232 1564 'id' => 'shipping_city_placeholder',
1233 1565 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1234 1566 'type' => 'text',
1235 1567 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1236 - // 'tab' => 'country',
1237 1568 'dependency' => [
1238 1569 'rules' => [
1239 1570 [
1240 1571 'item' => 'general.shipping_form.shipping_city',
@@ -1243,13 +1574,12 @@
1243 1574 ],
1244 1575 ],
1245 1576 ],
1246 1577 ],
1247 - 'shipping_state_heading' => [
1578 + 'shipping_state_heading' => [
1248 1579 'id' => 'shipping_state_heading',
1249 1580 'type' => 'title',
1250 1581 'label' => esc_html__( 'Others', 'shopbuilder' ),
1251 - // 'tab' => 'name',
1252 1582 ],
1253 1583 'shipping_state' => [
1254 1584 'id' => 'shipping_state',
1255 1585 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1265,33 +1595,9 @@
1265 1595 'value' => 'required',
1266 1596 'label' => 'Required Field',
1267 1597 ],
1268 1598 ],
1269 - // 'tab' => 'country',
1270 1599 ],
1271 - //
1272 - // 'shipping_state_label' => [
1273 - // 'id' => 'shipping_state_label',
1274 - // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1275 - // 'type' => 'text',
1276 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1277 - // // 'tab' => 'country',
1278 - // 'dependency' => [
1279 - // 'rules' => [
1280 - // [
1281 - // 'item' => 'general.shipping_form.shipping_state',
1282 - // 'value' => 'show',
1283 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1284 - // ],
1285 - // ],
1286 - // ],
1287 - // ],
1288 - //'shipping_postcode_heading' => [
1289 - // 'id' => 'shipping_postcode_heading',
1290 - // 'type' => 'title',
1291 - // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1292 - // // 'tab' => 'name',
1293 - //],
1294 1600 'shipping_postcode' => [
1295 1601 'id' => 'shipping_postcode',
1296 1602 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1297 1603 'type' => 'checkbox',
@@ -1300,49 +1606,135 @@
1300 1606 'options' => [
1301 1607 [
1302 1608 'value' => 'show',
1303 1609 'label' => 'Show Postcode / ZIP?',
1304 - ]
1610 + ],
1305 1611 ],
1306 - // 'tab' => 'country',
1307 1612 ],
1308 - // 'shipping_postcode_label' => [
1309 - // 'id' => 'shipping_postcode_label',
1310 - // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1311 - // 'type' => 'text',
1312 - // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1313 - // // 'tab' => 'country',
1314 - // 'dependency' => [
1315 - // 'rules' => [
1316 - // [
1317 - // 'item' => 'general.shipping_form.shipping_postcode',
1318 - // 'value' => 'show',
1319 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1320 - // ],
1321 - // ],
1322 - // ],
1323 - // ],
1324 - // 'shipping_postcode_placeholder' => [
1325 - // 'id' => 'shipping_postcode_placeholder',
1326 - // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1327 - // 'type' => 'text',
1328 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1329 - // // 'tab' => 'country',
1330 - // 'dependency' => [
1331 - // 'rules' => [
1332 - // [
1333 - // 'item' => 'general.shipping_form.shipping_postcode',
1334 - // 'value' => 'show',
1335 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1336 - // ],
1337 - // ],
1338 - // ],
1339 - // ],
1340 1613
1341 1614 ],
1342 1615 ]
1343 1616 ),
1617 +
1344 1618 ];
1345 1619
1620 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1621 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1622 + }
1346 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 ] ?? [];
1347 1739 }
1348 1740 }