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 +602 -202 2.0.2 → 3.2.2 View file →
@@ -1,10 +1,8 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Models;
4 4
5 -// use RadiusTheme\SB\Helpers\Fns;
6 -use RadiusTheme\SB\Elementor\Helper\ControlHelper;
7 5 use RadiusTheme\SB\Helpers\Fns;
8 6 use RadiusTheme\SB\Models\Base\ListModel;
9 7 use RadiusTheme\SB\Traits\SingletonTrait;
10 8
@@ -51,9 +49,384 @@
51 49 * @return array
52 50 */
53 51 protected function raw_list() {
54 52 $list = [
55 - 'notification' => apply_filters(
53 + 'optimization' => apply_filters(
54 + 'rtsb/settings/optimization/options',
55 + [
56 + 'id' => 'optimization',
57 + 'category' => 'general',
58 + 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ),
59 + 'package' => $this->pro_version_checker(),
60 + 'badge' => 'new',
61 + 'active_field' => [
62 + 'disable' => true,
63 + ],
64 + 'fields' => [
65 + 'optimization_intro' => [
66 + 'id' => 'optimization_intro',
67 + 'type' => 'description',
68 + 'text' => __( 'Optimize your website for maximum performance from these advanced options. <br /> <span style="color: #dc3545; display: block; margin-top: 10px;">⚠️ Note: After enabling or disabling any of these settings, clear the ShopBuilder cache to ensure changes are applied correctly.</span>', 'shopbuilder' ),
69 + ],
70 + 'enable_optimization' => [
71 + 'id' => 'enable',
72 + 'type' => 'switch',
73 + 'label' => esc_html__( 'Enable Asset Optimization?', 'shopbuilder' ),
74 + 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website’s performance', 'shopbuilder' ),
75 + ],
76 + 'load_elementor_scripts' => [
77 + 'id' => 'enable',
78 + 'type' => 'switch',
79 + 'label' => esc_html__( 'Load Elementor Assets?', 'shopbuilder' ),
80 + 'help' => __( 'Enable this option to load necessary Elementor assets on your website. <br /> <span style="color: #dc3545;">Turn this off if you are not using Elementor widgets to optimize site performance.</span>', 'shopbuilder' ),
81 + 'value' => 'on',
82 + 'dependency' => [
83 + 'rules' => [
84 + [
85 + 'item' => 'general.optimization.enable_optimization',
86 + 'value' => 'on',
87 + 'operator' => '==',
88 + ],
89 + ],
90 + ],
91 + ],
92 + 'context_asset_loading' => [
93 + 'id' => 'enable',
94 + 'type' => 'switch',
95 + 'label' => esc_html__( 'Context-Aware Asset Loading?', 'shopbuilder' ),
96 + 'help' => esc_html__( 'Enable this option to dynamically Load only the necessary CSS and JS for each page type (e.g., product, cart, checkout). Disabling this option will include all assets globally on every page.', 'shopbuilder' ),
97 + 'dependency' => [
98 + 'rules' => [
99 + [
100 + 'item' => 'general.optimization.enable_optimization',
101 + 'value' => 'on',
102 + 'operator' => '==',
103 + ],
104 + ],
105 + ],
106 + ],
107 + 'wp_rocket_compatibility' => [
108 + 'id' => 'wp_rocket_compatibility',
109 + 'type' => 'switch',
110 + 'label' => esc_html__( 'WP Rocket Compatibility', 'shopbuilder' ),
111 + 'help' => esc_html__( 'Enable this option to ensure compatibility with the WP Rocket plugin for optimized asset loading.', 'shopbuilder' ),
112 + ],
113 +
114 + 'remove_pre_loader' => [
115 + 'id' => 'remove_pre_loader',
116 + 'type' => 'switch',
117 + 'label' => esc_html__( 'Disable Element Preloader', 'shopbuilder' ),
118 + 'help' => esc_html__( 'Enable this option to remove the element preloader.', 'shopbuilder' ),
119 + ],
120 + /**
121 + 'load_gutenberg_scripts' => [
122 + 'id' => 'enable',
123 + 'type' => 'switch',
124 + 'label' => esc_html__( 'Load Gutenberg Scripts?', 'shopbuilder' ),
125 + 'help' => esc_html__( 'Switch on to load elementor scripts by dynamically loading scripts', 'shopbuilder' ),
126 + ],
127 + */
128 + ],
129 + ],
130 + ),
131 + 'ai_implementation' => apply_filters(
132 + 'rtsb/settings/ai_implementation/options',
133 + [
134 + 'id' => 'ai_implementation',
135 + 'category' => 'general',
136 + 'title' => esc_html__( 'AI-implementation', 'shopbuilder' ),
137 + 'package' => 'free',
138 + 'badge' => 'new',
139 + 'active_field' => [
140 + 'disable' => true,
141 + ],
142 + 'fields' => [
143 + 'data_ai_feature_beta_message' => [
144 + 'id' => 'data_ai_feature_beta_message',
145 + 'type' => 'description',
146 + 'text' => esc_html__( '🧠 AI feature is in beta — stable and fully functional, with more enhancements coming soon.', 'shopbuilder' ),
147 + ],
148 + 'ai_tools' => [
149 + 'id' => 'ai_tools',
150 + 'label' => esc_html__( 'AI Tools', 'shopbuilder' ),
151 + 'type' => 'select',
152 + 'value' => '',
153 + 'options' => [
154 + '' => esc_html__( '----', 'shopbuilder' ),
155 + 'OpenAI' => esc_html__( 'ChatGPT', 'shopbuilder' ),
156 + 'Gemini' => esc_html__( 'Google Gemini', 'shopbuilder' ),
157 + // phpcs:ignore Generic.Commenting
158 + // DeepSeek' => esc_html__( 'DeepSeek', 'shopbuilder' ), .
159 + ],
160 + ],
161 + // GPT.
162 + 'gpt_models' => [
163 + 'id' => 'gpt_models',
164 + 'label' => esc_html__( 'GPT Model', 'shopbuilder' ),
165 + 'type' => 'select',
166 + 'value' => 'gpt-4o',
167 + 'options' => [
168 + 'gpt-4o' => esc_html__( 'GPT-4o (Full Version)', 'shopbuilder' ),
169 + 'gpt-4o-mini' => esc_html__( 'GPT-4o Mini (Light Version)', 'shopbuilder' ),
170 + ],
171 + 'dependency' => [
172 + 'rules' => [
173 + [
174 + 'item' => 'general.ai_implementation.ai_tools',
175 + 'value' => 'OpenAI',
176 + 'operator' => '==',
177 + ],
178 + ],
179 + ],
180 + ],
181 + 'gpt_api_key' => [
182 + 'id' => 'gpt_api_key',
183 + 'label' => esc_html__( 'ChatGPT API Key', 'shopbuilder' ),
184 + 'type' => 'password',
185 + 'placeholder' => esc_html__( 'sk-p********', 'shopbuilder' ),
186 + 'help' => wp_kses(
187 + __(
188 + 'To integrate with ChatGPT, you need to obtain an API key from OpenAI. Visit <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API Keys</a> to generate one.',
189 + 'shopbuilder'
190 + ),
191 + [
192 + 'a' => [
193 + 'href' => [],
194 + 'target' => [],
195 + ],
196 + ]
197 + ),
198 + 'dependency' => [
199 + 'rules' => [
200 + [
201 + 'item' => 'general.ai_implementation.ai_tools',
202 + 'value' => 'OpenAI',
203 + 'operator' => '==',
204 + ],
205 + ],
206 + ],
207 + ],
208 + 'gpt_max_token' => [
209 + 'id' => 'gpt_max_token',
210 + 'label' => esc_html__( 'ChatGPT Maximum Characters in Prompt Input', 'shopbuilder' ),
211 + 'type' => 'number',
212 + 'help' => esc_html__(
213 + 'Set the maximum character limit for the prompt input. This controls how many characters users can enter, ensuring input stays concise and manageable. Higher limits may affect performance and response quality.',
214 + 'shopbuilder'
215 + ),
216 + 'value' => 200,
217 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
218 + 'dependency' => [
219 + 'rules' => [
220 + [
221 + 'item' => 'general.ai_implementation.ai_tools',
222 + 'value' => 'OpenAI',
223 + 'operator' => '==',
224 + ],
225 + ],
226 + ],
227 + ],
228 + // Gemini.
229 + 'gemini_api_key' => [
230 + 'id' => 'gemini_api_key',
231 + 'label' => esc_html__( 'Gemini API Key', 'shopbuilder' ),
232 + 'type' => 'password',
233 + 'placeholder' => esc_html__( 'AIzaSy***********************', 'shopbuilder' ),
234 + 'help' => wp_kses(
235 + __(
236 + 'To integrate with Google Gemini, you need to obtain an API key from Google Cloud. Visit <a href="https://makersuite.google.com/app/apikey" target="_blank">Google AI Studio API Keys</a> to generate one.',
237 + 'shopbuilder'
238 + ),
239 + [
240 + 'a' => [
241 + 'href' => [],
242 + 'target' => [],
243 + ],
244 + ]
245 + ),
246 + 'dependency' => [
247 + 'rules' => [
248 + [
249 + 'item' => 'general.ai_implementation.ai_tools',
250 + 'value' => 'Gemini',
251 + 'operator' => '==',
252 + ],
253 + ],
254 + ],
255 + ],
256 + /**
257 + * User Will Not Understand how Its Works.
258 + 'gemini_models' => [
259 + 'id' => 'gemini_models',
260 + 'label' => esc_html__( 'Gemini Model', 'shopbuilder' ),
261 + 'type' => 'select',
262 + 'value' => 'gemini-2.5-flash',
263 + 'options' => [
264 + 'gemini-2.5-flash' => esc_html__( 'Gemini 2.5 Flash', 'shopbuilder' ),
265 + 'gemini-2.5-pro' => esc_html__( 'Gemini 2.5 Pro', 'shopbuilder' ),
266 + ],
267 + 'dependency' => [
268 + 'rules' => [
269 + [
270 + 'item' => 'general.ai_implementation.ai_tools',
271 + 'value' => 'Gemini',
272 + 'operator' => '==',
273 + ],
274 + ],
275 + ],
276 + ],
277 + */
278 + 'gemini_max_token' => [
279 + 'id' => 'gemini_max_token',
280 + 'label' => esc_html__( 'Gemini Maximum Characters', 'shopbuilder' ),
281 + 'type' => 'number',
282 + 'help' => esc_html__(
283 + 'Set the maximum character limit for Gemini model prompts. Adjust according to model capabilities and performance.',
284 + 'shopbuilder'
285 + ),
286 + 'value' => 200,
287 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
288 + 'dependency' => [
289 + 'rules' => [
290 + [
291 + 'item' => 'general.ai_implementation.ai_tools',
292 + 'value' => 'Gemini',
293 + 'operator' => '==',
294 + ],
295 + ],
296 + ],
297 + ],
298 + // DeepSeek.
299 + 'deepseek_api_key' => [
300 + 'id' => 'deepseek_api_key',
301 + 'label' => esc_html__( 'DeepSeek API Key', 'shopbuilder' ),
302 + 'type' => 'password',
303 + 'placeholder' => esc_html__( 'ds-***********************', 'shopbuilder' ),
304 + 'help' => wp_kses(
305 + __(
306 + 'To integrate with DeepSeek, you need to obtain an API key from DeepSeek. Visit <a href="https://www.deepseek.com/api-keys" target="_blank">DeepSeek API Keys</a> to generate one.',
307 + 'shopbuilder'
308 + ),
309 + [
310 + 'a' => [
311 + 'href' => [],
312 + 'target' => [],
313 + ],
314 + ]
315 + ),
316 + 'dependency' => [
317 + 'rules' => [
318 + [
319 + 'item' => 'general.ai_implementation.ai_tools',
320 + 'value' => 'DeepSeek',
321 + 'operator' => '==',
322 + ],
323 + ],
324 + ],
325 + ],
326 + 'deepseek_models' => [
327 + 'id' => 'deepseek_models',
328 + 'label' => esc_html__( 'DeepSeek Model', 'shopbuilder' ),
329 + 'type' => 'select',
330 + 'value' => 'gpt-4o',
331 + 'options' => [
332 + 'deepseek-chat' => __( 'DeepSeek Chat (Full Version)', 'shopbuilder' ),
333 + 'deepseek-reasoner' => __( 'DeepSeek Reasoner Mini (Light Version)', 'shopbuilder' ),
334 + ],
335 + 'dependency' => [
336 + 'rules' => [
337 + [
338 + 'item' => 'general.ai_implementation.ai_tools',
339 + 'value' => 'DeepSeek',
340 + 'operator' => '==',
341 + ],
342 + ],
343 + ],
344 + ],
345 + 'deepseek_max_token' => [
346 + 'id' => 'deepseek_max_token',
347 + 'label' => esc_html__( 'Deepshek Maximum Characters', 'shopbuilder' ),
348 + 'type' => 'number',
349 + 'help' => esc_html__(
350 + 'Set the maximum character limit for Deepshek model prompts. Adjust according to model configuration and speed requirements.',
351 + 'shopbuilder'
352 + ),
353 + 'value' => 200,
354 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
355 + 'dependency' => [
356 + 'rules' => [
357 + [
358 + 'item' => 'general.ai_implementation.ai_tools',
359 + 'value' => 'DeepSeek',
360 + 'operator' => '==',
361 + ],
362 + ],
363 + ],
364 + ],
365 + 'enable_semantic_search' => [
366 + 'id' => 'enable_semantic_search',
367 + 'type' => 'switch',
368 + 'label' => esc_html__( 'Enable Semantic Search?', 'shopbuilder' ),
369 + 'help' => esc_html__( 'Enable AI product search instead of keyword matching to get product', 'shopbuilder' ),
370 + 'dependency' => [
371 + 'rules' => [
372 + [
373 + 'item' => 'general.ai_implementation.ai_tools',
374 + 'value' => [ 'OpenAI', 'Gemini' ],
375 + 'operator' => 'in',
376 + ],
377 + ],
378 + ],
379 + ],
380 + 'minimum_matching_percentage' => [
381 + 'id' => 'minimum_matching_percentage',
382 + 'label' => esc_html__( 'Minimum Accuracy (in percentage)', 'shopbuilder' ),
383 + 'type' => 'number',
384 + 'min' => 1,
385 + 'max' => 99,
386 + 'help' => esc_html__(
387 + 'Set the minimum Accuracy.',
388 + 'shopbuilder'
389 + ),
390 + 'value' => 99,
391 + 'placeholder' => esc_html__( '99', 'shopbuilder' ),
392 + 'dependency' => [
393 + 'rules' => [
394 + [
395 + 'item' => 'general.ai_implementation.ai_tools',
396 + 'value' => [ 'OpenAI', 'Gemini' ],
397 + 'operator' => 'in',
398 + ],
399 + [
400 + 'item' => 'general.ai_implementation.enable_semantic_search',
401 + 'value' => 'on',
402 + 'operator' => '==',
403 + ],
404 + ],
405 + ],
406 + ],
407 + 'data_training' => [
408 + 'id' => 'data_training',
409 + 'type' => 'title',
410 + 'label' => esc_html__( 'Data Training', 'shopbuilder' ),
411 + 'dependency' => [
412 + 'rules' => [
413 + [
414 + 'item' => 'general.ai_implementation.ai_tools',
415 + 'value' => [ 'OpenAI', 'Gemini' ],
416 + 'operator' => 'in',
417 + ],
418 + ],
419 + ],
420 + ],
421 + 'data_training_note_gemini' => $this->get_data_training_note_field( 'Gemini' ),
422 + 'data_training_note_openai' => $this->get_data_training_note_field( 'OpenAI' ),
423 + 'data_training_note_missing_openai_key' => $this->get_data_training_note_field( 'missingOpenAIKey' ),
424 + 'data_training_note_missing_gemneni_key' => $this->get_data_training_note_field( 'missingGeminiKey' ),
425 + ],
426 + ],
427 + ),
428 + 'notification' => apply_filters(
56 429 'rtsb/settings/notification/options',
57 430 [
58 431 'id' => 'notification',
59 432 'category' => 'general',
@@ -62,8 +435,13 @@
62 435 'active_field' => [
63 436 'disable' => true,
64 437 ],
65 438 'fields' => [
439 + 'notification_intro' => [
440 + 'id' => 'notification_intro',
441 + 'type' => 'description',
442 + 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
443 + ],
66 444 'notification_position' => [
67 445 'id' => 'notification_position',
68 446 'value' => 'center-center',
69 447 'type' => 'select',
@@ -68,19 +446,30 @@
68 446 'value' => 'center-center',
69 447 'type' => 'select',
70 448 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
71 449 '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' ),
450 + 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
451 + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
452 + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
453 + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
454 + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
455 + 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
456 + 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
81 457 ],
82 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 + ],
83 472 'notification_color' => [
84 473 'id' => 'notification_color',
85 474 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
86 475 'type' => 'color',
@@ -97,13 +486,18 @@
97 486 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
98 487 'type' => 'color',
99 488 'tab' => 'floating_button',
100 489 ],
101 -
490 + 'hide_notification' => [
491 + 'id' => 'hide_notification',
492 + 'type' => 'switch',
493 + 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ),
494 + 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ),
495 + ],
102 496 ],
103 497 ],
104 498 ),
105 - 'social_share' => apply_filters(
499 + 'social_share' => apply_filters(
106 500 'rtsb/settings/social_share/options',
107 501 [
108 502 'id' => 'social_share',
109 503 'category' => 'general',
@@ -112,8 +506,13 @@
112 506 'active_field' => [
113 507 'disable' => true,
114 508 ],
115 509 'fields' => [
510 + 'social_share_intro' => [
511 + 'id' => 'social_share_intro',
512 + 'type' => 'description',
513 + 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
514 + ],
116 515 'share_platforms' => [
117 516 'id' => 'share_platforms',
118 517 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
119 518 'type' => 'checkbox',
@@ -126,25 +525,8 @@
126 525 'type' => 'switch',
127 526 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
128 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' ),
129 528 ],
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 529 'share_icon_layout' => [
148 530 'type' => 'select',
149 531 'value' => 'share-layout1',
150 532 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -164,9 +546,21 @@
164 546 ],
165 547 ],
166 548 ],
167 549 ),
168 - 'tooltip' => apply_filters(
550 + 'guest_user' => apply_filters(
551 + 'rtsb/settings/guest_user/options',
552 + [
553 + 'id' => 'guest_user',
554 + 'category' => 'general',
555 + 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
556 + 'package' => $this->pro_package(),
557 + 'active_field' => [
558 + 'disable' => true,
559 + ],
560 + ],
561 + ),
562 + 'tooltip' => apply_filters(
169 563 'rtsb/settings/tooltip/options',
170 564 [
171 565 'id' => 'tooltip',
172 566 'category' => 'general',
@@ -176,9 +570,9 @@
176 570 'disable' => true,
177 571 ],
178 572 ],
179 573 ),
180 - 'billing_form' => apply_filters(
574 + 'billing_form' => apply_filters(
181 575 'rtsb/settings/billing_form/options',
182 576 [
183 577 'id' => 'billing_form',
184 578 'category' => 'checkout',
@@ -184,17 +578,22 @@
184 578 'category' => 'checkout',
185 579 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
186 580 'package' => 'free',
187 581 'active_field' => [
188 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
189 - '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' ),
190 584 ],
191 585 'fields' => [
192 - 'billing_first_name_heading' => [
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 + ],
592 + 'billing_first_name_heading' => [
193 593 'id' => 'billing_first_name_heading',
194 594 'type' => 'title',
195 595 'label' => esc_html__( 'First Name', 'shopbuilder' ),
196 - // 'tab' => 'name',
197 596 ],
198 597 'billing_first_name' => [
199 598 'id' => 'billing_first_name',
200 599 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -210,9 +609,8 @@
210 609 'value' => 'required',
211 610 'label' => 'Required Field',
212 611 ],
213 612 ],
214 - // 'tab' => 'name',
215 613 ],
216 614 'billing_first_name_label' => [
217 615 'id' => 'billing_first_name_label',
218 616 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -217,15 +615,14 @@
217 615 'id' => 'billing_first_name_label',
218 616 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
219 617 'type' => 'text',
220 618 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
221 - // 'tab' => 'name',
222 619 'dependency' => [
223 620 'rules' => [
224 621 [
225 622 'item' => 'general.billing_form.billing_first_name',
226 623 'value' => 'show',
227 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
624 + 'operator' => '==',
228 625 ],
229 626 ],
230 627 ],
231 628 ],
@@ -233,25 +630,23 @@
233 630 'id' => 'billing_first_name_placeholder',
234 631 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
235 632 'type' => 'text',
236 633 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
237 - // 'tab' => 'name',
238 634 'dependency' => [
239 635 'rules' => [
240 636 [
241 637 'item' => 'general.billing_form.billing_first_name',
242 638 'value' => 'show',
243 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
639 + 'operator' => '==',
244 640 ],
245 641 ],
246 642 ],
247 643 ],
248 644
249 - 'billing_last_name_heading' => [
645 + 'billing_last_name_heading' => [
250 646 'id' => 'billing_last_name_heading',
251 647 'type' => 'title',
252 648 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
253 - //'tab' => 'name',
254 649 ],
255 650 'billing_last_name' => [
256 651 'id' => 'billing_last_name',
257 652 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -267,9 +662,8 @@
267 662 'value' => 'required',
268 663 'label' => 'Required Field',
269 664 ],
270 665 ],
271 - // 'tab' => 'name',
272 666 ],
273 667
274 668 'billing_last_name_label' => [
275 669 'id' => 'billing_last_name_label',
@@ -275,9 +669,8 @@
275 669 'id' => 'billing_last_name_label',
276 670 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
277 671 'type' => 'text',
278 672 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
279 - // 'tab' => 'name',
280 673 'dependency' => [
281 674 'rules' => [
282 675 [
283 676 'item' => 'general.billing_form.billing_last_name',
@@ -291,9 +684,8 @@
291 684 'id' => 'billing_last_name_placeholder',
292 685 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
293 686 'type' => 'text',
294 687 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
295 - // 'tab' => 'name',
296 688 'dependency' => [
297 689 'rules' => [
298 690 [
299 691 'item' => 'general.billing_form.billing_last_name',
@@ -303,13 +695,12 @@
303 695 ],
304 696 ],
305 697 ],
306 698
307 - 'billing_company_heading' => [
699 + 'billing_company_heading' => [
308 700 'id' => 'billing_company_heading',
309 701 'type' => 'title',
310 702 'label' => esc_html__( 'Company', 'shopbuilder' ),
311 - //'tab' => 'company',
312 703 ],
313 704 'billing_company' => [
314 705 'id' => 'billing_company',
315 706 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -328,9 +719,8 @@
328 719 'value' => 'required',
329 720 'label' => 'Required Field',
330 721 ],
331 722 ],
332 - // 'tab' => 'company',
333 723 ],
334 724
335 725 'billing_company_label' => [
336 726 'id' => 'billing_company_label',
@@ -336,9 +726,8 @@
336 726 'id' => 'billing_company_label',
337 727 'label' => esc_html__( 'Company label', 'shopbuilder' ),
338 728 'type' => 'text',
339 729 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
340 - // 'tab' => 'company',
341 730 'dependency' => [
342 731 'rules' => [
343 732 [
344 733 'item' => 'general.billing_form.billing_company',
@@ -352,9 +741,8 @@
352 741 'id' => 'billing_company_placeholder',
353 742 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
354 743 'type' => 'text',
355 744 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
356 - // 'tab' => 'company',
357 745 'dependency' => [
358 746 'rules' => [
359 747 [
360 748 'item' => 'general.billing_form.billing_company',
@@ -364,13 +752,12 @@
364 752 ],
365 753 ],
366 754 ],
367 755
368 - 'billing_country_heading' => [
756 + 'billing_country_heading' => [
369 757 'id' => 'billing_country_heading',
370 758 'type' => 'title',
371 759 'label' => esc_html__( 'Country', 'shopbuilder' ),
372 - //'tab' => 'country',
373 760 ],
374 761 'billing_country' => [
375 762 'id' => 'billing_country',
376 763 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -376,22 +763,18 @@
376 763 'label' => esc_html__( 'Country', 'shopbuilder' ),
377 764 'type' => 'checkbox',
378 765 'orientation' => 'vertical',
379 766 'value' => [ 'show', 'required' ],
380 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
381 767 'options' => [
382 768 [
383 769 'value' => 'show',
384 770 'label' => 'Show Country?',
385 - // 'disabled' => true,
386 771 ],
387 772 [
388 773 'value' => 'required',
389 774 'label' => 'Required Field',
390 - // 'disabled' => true,
391 775 ],
392 776 ],
393 - // 'tab' => 'country',
394 777 ],
395 778
396 779 'billing_country_label' => [
397 780 'id' => 'billing_country_label',
@@ -397,9 +780,8 @@
397 780 'id' => 'billing_country_label',
398 781 'label' => esc_html__( 'Country label', 'shopbuilder' ),
399 782 'type' => 'text',
400 783 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
401 - // 'tab' => 'country',
402 784 'dependency' => [
403 785 'rules' => [
404 786 [
405 787 'item' => 'general.billing_form.billing_country',
@@ -408,13 +790,12 @@
408 790 ],
409 791 ],
410 792 ],
411 793 ],
412 - 'billing_address_1_heading' => [
794 + 'billing_address_1_heading' => [
413 795 'id' => 'billing_address_1_heading',
414 796 'type' => 'title',
415 797 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
416 - //'tab' => 'address',
417 798 ],
418 799 'billing_address_1' => [
419 800 'id' => 'billing_address_1',
420 801 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -430,9 +811,8 @@
430 811 'value' => 'required',
431 812 'label' => 'Required Field',
432 813 ],
433 814 ],
434 - // 'tab' => 'address',
435 815 ],
436 816
437 817 'billing_address_1_label' => [
438 818 'id' => 'billing_address_1_label',
@@ -438,9 +818,8 @@
438 818 'id' => 'billing_address_1_label',
439 819 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
440 820 'type' => 'text',
441 821 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
442 - // 'tab' => 'address',
443 822 'dependency' => [
444 823 'rules' => [
445 824 [
446 825 'item' => 'general.billing_form.billing_address_1',
@@ -454,9 +833,8 @@
454 833 'id' => 'billing_address_1_placeholder',
455 834 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
456 835 'type' => 'text',
457 836 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
458 - // 'tab' => 'address',
459 837 'dependency' => [
460 838 'rules' => [
461 839 [
462 840 'item' => 'general.billing_form.billing_address_1',
@@ -465,14 +843,13 @@
465 843 ],
466 844 ],
467 845 ],
468 846 ],
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' => [
847 + 'billing_address_2_heading' => [
848 + 'id' => 'billing_address_2_heading',
849 + 'type' => 'title',
850 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
851 + 'dependency' => [
475 852 'rules' => [
476 853 [
477 854 'item' => 'general.billing_form.billing_address_1',
478 855 'value' => 'show',
@@ -485,11 +862,11 @@
485 862 'id' => 'billing_address_2',
486 863 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
487 864 'type' => 'checkbox',
488 865 'orientation' => 'vertical',
489 - // 'tab' => 'address',
490 - 'value' => [ 'show',
491 - 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
866 + 'value' => [
867 + 'show',
868 + 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
492 869 ],
493 870 'options' => [
494 871 [
495 872 'value' => 'show',
@@ -512,9 +889,8 @@
512 889 'id' => 'billing_address_2_label',
513 890 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
514 891 'type' => 'text',
515 892 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
516 - // 'tab' => 'address',
517 893 'dependency' => [
518 894 'rules' => [
519 895 [
520 896 'item' => 'general.billing_form.billing_address_1',
@@ -533,9 +909,8 @@
533 909 'id' => 'billing_address_2_placeholder',
534 910 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
535 911 'type' => 'text',
536 912 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
537 - // 'tab' => 'address',
538 913 'dependency' => [
539 914 'rules' => [
540 915 [
541 916 'item' => 'general.billing_form.billing_address_1',
@@ -549,13 +924,12 @@
549 924 ],
550 925 ],
551 926 ],
552 927 ],
553 - 'billing_city_heading' => [
928 + 'billing_city_heading' => [
554 929 'id' => 'billing_city_heading',
555 930 'type' => 'title',
556 931 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
557 - // 'tab' => 'city',
558 932 ],
559 933 'billing_city' => [
560 934 'id' => 'billing_city',
561 935 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -561,9 +935,8 @@
561 935 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
562 936 'type' => 'checkbox',
563 937 'orientation' => 'vertical',
564 938 'value' => [ 'show', 'required' ],
565 - // 'tab' => 'city',
566 939 'options' => [
567 940 [
568 941 'value' => 'show',
569 942 'label' => 'Show Town / City?',
@@ -579,9 +952,8 @@
579 952 'id' => 'billing_city_label',
580 953 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
581 954 'type' => 'text',
582 955 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
583 - // 'tab' => 'city',
584 956 'dependency' => [
585 957 'rules' => [
586 958 [
587 959 'item' => 'general.billing_form.billing_city',
@@ -595,9 +967,8 @@
595 967 'id' => 'billing_city_placeholder',
596 968 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
597 969 'type' => 'text',
598 970 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
599 - // 'tab' => 'city',
600 971 'dependency' => [
601 972 'rules' => [
602 973 [
603 974 'item' => 'general.billing_form.billing_city',
@@ -606,13 +977,12 @@
606 977 ],
607 978 ],
608 979 ],
609 980 ],
610 - 'billing_state_heading' => [
981 + 'billing_state_heading' => [
611 982 'id' => 'billing_city_heading',
612 983 'type' => 'title',
613 984 'label' => esc_html__( 'State', 'shopbuilder' ),
614 - // 'tab' => 'state',
615 985 ],
616 986 'billing_state' => [
617 987 'id' => 'billing_state',
618 988 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -628,9 +998,8 @@
628 998 'value' => 'required',
629 999 'label' => 'Required Field',
630 1000 ],
631 1001 ],
632 - // 'tab' => 'state',
633 1002 ],
634 1003
635 1004 'billing_state_label' => [
636 1005 'id' => 'billing_state_label',
@@ -636,10 +1005,8 @@
636 1005 'id' => 'billing_state_label',
637 1006 'label' => esc_html__( 'State label', 'shopbuilder' ),
638 1007 'type' => 'text',
639 1008 '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 1009 'dependency' => [
643 1010 'rules' => [
644 1011 [
645 1012 'item' => 'general.billing_form.billing_state',
@@ -648,13 +1015,12 @@
648 1015 ],
649 1016 ],
650 1017 ],
651 1018 ],
652 - 'billing_postcode_heading' => [
1019 + 'billing_postcode_heading' => [
653 1020 'id' => 'billing_postcode_heading',
654 1021 'type' => 'title',
655 1022 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
656 - // 'tab' => 'postcode',
657 1023 ],
658 1024 'billing_postcode' => [
659 1025 'id' => 'billing_postcode',
660 1026 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -670,9 +1036,8 @@
670 1036 'value' => 'required',
671 1037 'label' => 'Required Field',
672 1038 ],
673 1039 ],
674 - // 'tab' => 'postcode',
675 1040 ],
676 1041 'billing_postcode_label' => [
677 1042 'id' => 'billing_postcode_label',
678 1043 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -677,9 +1042,8 @@
677 1042 'id' => 'billing_postcode_label',
678 1043 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
679 1044 'type' => 'text',
680 1045 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
681 - // 'tab' => 'postcode',
682 1046 'dependency' => [
683 1047 'rules' => [
684 1048 [
685 1049 'item' => 'general.billing_form.billing_postcode',
@@ -693,9 +1057,8 @@
693 1057 'id' => 'billing_postcode_placeholder',
694 1058 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
695 1059 'type' => 'text',
696 1060 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
697 - // 'tab' => 'postcode',
698 1061 'dependency' => [
699 1062 'rules' => [
700 1063 [
701 1064 'item' => 'general.billing_form.billing_postcode',
@@ -704,13 +1067,12 @@
704 1067 ],
705 1068 ],
706 1069 ],
707 1070 ],
708 - 'billing_phone_heading' => [
1071 + 'billing_phone_heading' => [
709 1072 'id' => 'billing_phone_heading',
710 1073 'type' => 'title',
711 1074 'label' => esc_html__( 'Phone', 'shopbuilder' ),
712 - // 'tab' => 'phone',
713 1075 ],
714 1076 'billing_phone' => [
715 1077 'id' => 'billing_phone',
716 1078 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -715,9 +1077,8 @@
715 1077 'id' => 'billing_phone',
716 1078 'label' => esc_html__( 'Phone', 'shopbuilder' ),
717 1079 'type' => 'checkbox',
718 1080 'orientation' => 'vertical',
719 - // 'tab' => 'phone',
720 1081 'value' => [
721 1082 'show',
722 1083 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
723 1084 ],
@@ -737,9 +1098,8 @@
737 1098 'id' => 'billing_phone_label',
738 1099 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
739 1100 'type' => 'text',
740 1101 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
741 - // 'tab' => 'phone',
742 1102 'dependency' => [
743 1103 'rules' => [
744 1104 [
745 1105 'item' => 'general.billing_form.billing_phone',
@@ -753,9 +1113,8 @@
753 1113 'id' => 'billing_phone_placeholder',
754 1114 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
755 1115 'type' => 'text',
756 1116 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
757 - // 'tab' => 'phone',
758 1117 'dependency' => [
759 1118 'rules' => [
760 1119 [
761 1120 'item' => 'general.billing_form.billing_phone',
@@ -764,13 +1123,12 @@
764 1123 ],
765 1124 ],
766 1125 ],
767 1126 ],
768 - 'billing_email_heading' => [
1127 + 'billing_email_heading' => [
769 1128 'id' => 'billing_email_heading',
770 1129 'type' => 'title',
771 1130 'label' => esc_html__( 'Email', 'shopbuilder' ),
772 - // 'tab' => 'email',
773 1131 ],
774 1132 'billing_email' => [
775 1133 'id' => 'billing_email',
776 1134 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -775,9 +1133,8 @@
775 1133 'id' => 'billing_email',
776 1134 'label' => esc_html__( 'Email address', 'shopbuilder' ),
777 1135 'type' => 'checkbox',
778 1136 'orientation' => 'vertical',
779 - // 'tab' => 'email',
780 1137 'value' => [ 'show', 'required' ],
781 1138 'options' => [
782 1139 [
783 1140 'value' => 'show',
@@ -793,9 +1150,8 @@
793 1150 'id' => 'billing_email_label',
794 1151 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
795 1152 'type' => 'text',
796 1153 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
797 - // 'tab' => 'email',
798 1154 'dependency' => [
799 1155 'rules' => [
800 1156 [
801 1157 'item' => 'general.billing_form.billing_email',
@@ -809,9 +1165,8 @@
809 1165 'id' => 'billing_email_placeholder',
810 1166 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
811 1167 'type' => 'text',
812 1168 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
813 - // 'tab' => 'email',
814 1169 'dependency' => [
815 1170 'rules' => [
816 1171 [
817 1172 'item' => 'general.billing_form.billing_email',
@@ -824,9 +1179,9 @@
824 1179 ],
825 1180
826 1181 ]
827 1182 ),
828 - 'shipping_form' => apply_filters(
1183 + 'shipping_form' => apply_filters(
829 1184 'rtsb/module/shipping_form/options',
830 1185 [
831 1186 'id' => 'shipping_form',
832 1187 'category' => 'checkout',
@@ -832,17 +1187,22 @@
832 1187 'category' => 'checkout',
833 1188 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
834 1189 'package' => 'free',
835 1190 'active_field' => [
836 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
837 - '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' ),
838 1193 ],
839 1194 'fields' => [
840 - 'shipping_first_name_heading' => [
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 + ],
1201 + 'shipping_first_name_heading' => [
841 1202 'id' => 'shipping_first_name_heading',
842 1203 'type' => 'title',
843 1204 'label' => esc_html__( 'First Name', 'shopbuilder' ),
844 - // 'tab' => 'name',
845 1205 ],
846 1206 'shipping_first_name' => [
847 1207 'id' => 'shipping_first_name',
848 1208 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -858,9 +1218,8 @@
858 1218 'value' => 'required',
859 1219 'label' => 'Required Field',
860 1220 ],
861 1221 ],
862 - // 'tab' => 'name',
863 1222 ],
864 1223 'shipping_first_name_label' => [
865 1224 'id' => 'shipping_first_name_label',
866 1225 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -865,9 +1224,8 @@
865 1224 'id' => 'shipping_first_name_label',
866 1225 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
867 1226 'type' => 'text',
868 1227 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
869 - // 'tab' => 'name',
870 1228 'dependency' => [
871 1229 'rules' => [
872 1230 [
873 1231 'item' => 'general.shipping_form.shipping_first_name',
@@ -881,9 +1239,8 @@
881 1239 'id' => 'shipping_first_name_placeholder',
882 1240 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
883 1241 'type' => 'text',
884 1242 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
885 - // 'tab' => 'country',
886 1243 'dependency' => [
887 1244 'rules' => [
888 1245 [
889 1246 'item' => 'general.shipping_form.shipping_first_name',
@@ -892,13 +1249,12 @@
892 1249 ],
893 1250 ],
894 1251 ],
895 1252 ],
896 - 'shipping_first_last_heading' => [
1253 + 'shipping_first_last_heading' => [
897 1254 'id' => 'shipping_first_last_heading',
898 1255 'type' => 'title',
899 1256 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
900 - // 'tab' => 'name',
901 1257 ],
902 1258 'shipping_last_name' => [
903 1259 'id' => 'shipping_last_name',
904 1260 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -914,9 +1270,8 @@
914 1270 'value' => 'required',
915 1271 'label' => 'Required Field',
916 1272 ],
917 1273 ],
918 - // 'tab' => 'name',
919 1274 ],
920 1275
921 1276 'shipping_last_name_label' => [
922 1277 'id' => 'shipping_last_name_label',
@@ -922,9 +1277,8 @@
922 1277 'id' => 'shipping_last_name_label',
923 1278 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
924 1279 'type' => 'text',
925 1280 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
926 - // 'tab' => 'name',
927 1281 'dependency' => [
928 1282 'rules' => [
929 1283 [
930 1284 'item' => 'general.shipping_form.shipping_last_name',
@@ -938,9 +1292,8 @@
938 1292 'id' => 'shipping_last_name_placeholder',
939 1293 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
940 1294 'type' => 'text',
941 1295 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
942 - // 'tab' => 'country',
943 1296 'dependency' => [
944 1297 'rules' => [
945 1298 [
946 1299 'item' => 'general.shipping_form.shipping_last_name',
@@ -949,13 +1302,12 @@
949 1302 ],
950 1303 ],
951 1304 ],
952 1305 ],
953 - 'shipping_company_heading' => [
1306 + 'shipping_company_heading' => [
954 1307 'id' => 'shipping_company_heading',
955 1308 'type' => 'title',
956 1309 'label' => esc_html__( 'Company', 'shopbuilder' ),
957 - // 'tab' => 'name',
958 1310 ],
959 1311 'shipping_company' => [
960 1312 'id' => 'shipping_company',
961 1313 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -971,9 +1323,8 @@
971 1323 'value' => 'required',
972 1324 'label' => 'Required Field',
973 1325 ],
974 1326 ],
975 - // 'tab' => 'company',
976 1327 ],
977 1328
978 1329 'shipping_company_label' => [
979 1330 'id' => 'shipping_company_label',
@@ -979,9 +1330,8 @@
979 1330 'id' => 'shipping_company_label',
980 1331 'label' => esc_html__( 'Company label', 'shopbuilder' ),
981 1332 'type' => 'text',
982 1333 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
983 - // 'tab' => 'company',
984 1334 'dependency' => [
985 1335 'rules' => [
986 1336 [
987 1337 'item' => 'general.shipping_form.shipping_company',
@@ -995,9 +1345,8 @@
995 1345 'id' => 'shipping_company_placeholder',
996 1346 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
997 1347 'type' => 'text',
998 1348 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
999 - // 'tab' => 'country',
1000 1349 'dependency' => [
1001 1350 'rules' => [
1002 1351 [
1003 1352 'item' => 'general.shipping_form.shipping_company',
@@ -1006,13 +1355,12 @@
1006 1355 ],
1007 1356 ],
1008 1357 ],
1009 1358 ],
1010 - 'shipping_country_heading' => [
1359 + 'shipping_country_heading' => [
1011 1360 'id' => 'shipping_country_heading',
1012 1361 'type' => 'title',
1013 1362 'label' => esc_html__( 'Country', 'shopbuilder' ),
1014 - // 'tab' => 'name',
1015 1363 ],
1016 1364 'shipping_country' => [
1017 1365 'id' => 'shipping_country',
1018 1366 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1022,17 +1370,14 @@
1022 1370 'options' => [
1023 1371 [
1024 1372 'value' => 'show',
1025 1373 'label' => 'Show Country?',
1026 - // 'disabled' => true,
1027 1374 ],
1028 1375 [
1029 1376 'value' => 'required',
1030 1377 'label' => 'Required Field',
1031 - // 'disabled' => true,
1032 1378 ],
1033 1379 ],
1034 - // 'tab' => 'country',
1035 1380 ],
1036 1381
1037 1382 'shipping_country_label' => [
1038 1383 'id' => 'shipping_country_label',
@@ -1048,13 +1393,12 @@
1048 1393 ],
1049 1394 ],
1050 1395 ],
1051 1396 ],
1052 - 'shipping_address_1_heading' => [
1397 + 'shipping_address_1_heading' => [
1053 1398 'id' => 'shipping_address_1_heading',
1054 1399 'type' => 'title',
1055 1400 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1056 - // 'tab' => 'name',
1057 1401 ],
1058 1402 'shipping_address_1' => [
1059 1403 'id' => 'shipping_address_1',
1060 1404 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1070,9 +1414,8 @@
1070 1414 'value' => 'required',
1071 1415 'label' => 'Required Field',
1072 1416 ],
1073 1417 ],
1074 - // 'tab' => 'country',
1075 1418 ],
1076 1419
1077 1420 'shipping_address_1_label' => [
1078 1421 'id' => 'shipping_address_1_label',
@@ -1078,9 +1421,8 @@
1078 1421 'id' => 'shipping_address_1_label',
1079 1422 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1080 1423 'type' => 'text',
1081 1424 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1082 - // 'tab' => 'country',
1083 1425 'dependency' => [
1084 1426 'rules' => [
1085 1427 [
1086 1428 'item' => 'general.shipping_form.shipping_address_1',
@@ -1094,9 +1436,8 @@
1094 1436 'id' => 'shipping_address_1_placeholder',
1095 1437 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1096 1438 'type' => 'text',
1097 1439 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1098 - // 'tab' => 'country',
1099 1440 'dependency' => [
1100 1441 'rules' => [
1101 1442 [
1102 1443 'item' => 'general.shipping_form.shipping_address_1',
@@ -1105,14 +1446,13 @@
1105 1446 ],
1106 1447 ],
1107 1448 ],
1108 1449 ],
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' => [
1450 + 'shipping_address_2_heading' => [
1451 + 'id' => 'shipping_address_2_heading',
1452 + 'type' => 'title',
1453 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1454 + 'dependency' => [
1115 1455 'rules' => [
1116 1456 [
1117 1457 'item' => 'general.shipping_form.shipping_address_1',
1118 1458 'value' => 'show',
@@ -1133,9 +1473,8 @@
1133 1473 'label' => 'Show Address field?',
1134 1474 ],
1135 1475 ],
1136 1476 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1137 - // 'tab' => 'country',
1138 1477 'dependency' => [
1139 1478 'rules' => [
1140 1479 [
1141 1480 'item' => 'general.shipping_form.shipping_address_1',
@@ -1150,9 +1489,8 @@
1150 1489 'id' => 'shipping_address_2_label',
1151 1490 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1152 1491 'type' => 'text',
1153 1492 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1154 - // 'tab' => 'country',
1155 1493 'dependency' => [
1156 1494 'rules' => [
1157 1495 [
1158 1496 'item' => 'general.shipping_form.shipping_address_1',
@@ -1171,9 +1509,8 @@
1171 1509 'id' => 'shipping_address_2_placeholder',
1172 1510 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1173 1511 'type' => 'text',
1174 1512 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1175 - // 'tab' => 'country',
1176 1513 'dependency' => [
1177 1514 'rules' => [
1178 1515 [
1179 1516 'item' => 'general.shipping_form.shipping_address_1',
@@ -1187,13 +1524,12 @@
1187 1524 ],
1188 1525 ],
1189 1526 ],
1190 1527 ],
1191 - 'shipping_city_heading' => [
1528 + 'shipping_city_heading' => [
1192 1529 'id' => 'shipping_city_heading',
1193 1530 'type' => 'title',
1194 1531 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1195 - // 'tab' => 'name',
1196 1532 ],
1197 1533 'shipping_city' => [
1198 1534 'id' => 'shipping_city',
1199 1535 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1209,9 +1545,8 @@
1209 1545 'value' => 'required',
1210 1546 'label' => 'Required Field',
1211 1547 ],
1212 1548 ],
1213 - // 'tab' => 'country',
1214 1549 ],
1215 1550 'shipping_city_label' => [
1216 1551 'id' => 'shipping_city_label',
1217 1552 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1216,9 +1551,8 @@
1216 1551 'id' => 'shipping_city_label',
1217 1552 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1218 1553 'type' => 'text',
1219 1554 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1220 - // 'tab' => 'country',
1221 1555 'dependency' => [
1222 1556 'rules' => [
1223 1557 [
1224 1558 'item' => 'general.shipping_form.shipping_city',
@@ -1232,9 +1566,8 @@
1232 1566 'id' => 'shipping_city_placeholder',
1233 1567 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1234 1568 'type' => 'text',
1235 1569 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1236 - // 'tab' => 'country',
1237 1570 'dependency' => [
1238 1571 'rules' => [
1239 1572 [
1240 1573 'item' => 'general.shipping_form.shipping_city',
@@ -1243,13 +1576,12 @@
1243 1576 ],
1244 1577 ],
1245 1578 ],
1246 1579 ],
1247 - 'shipping_state_heading' => [
1580 + 'shipping_state_heading' => [
1248 1581 'id' => 'shipping_state_heading',
1249 1582 'type' => 'title',
1250 1583 'label' => esc_html__( 'Others', 'shopbuilder' ),
1251 - // 'tab' => 'name',
1252 1584 ],
1253 1585 'shipping_state' => [
1254 1586 'id' => 'shipping_state',
1255 1587 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1265,33 +1597,9 @@
1265 1597 'value' => 'required',
1266 1598 'label' => 'Required Field',
1267 1599 ],
1268 1600 ],
1269 - // 'tab' => 'country',
1270 1601 ],
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 1602 'shipping_postcode' => [
1295 1603 'id' => 'shipping_postcode',
1296 1604 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1297 1605 'type' => 'checkbox',
@@ -1300,49 +1608,141 @@
1300 1608 'options' => [
1301 1609 [
1302 1610 'value' => 'show',
1303 1611 'label' => 'Show Postcode / ZIP?',
1304 - ]
1612 + ],
1305 1613 ],
1306 - // 'tab' => 'country',
1307 1614 ],
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 1615
1341 1616 ],
1342 1617 ]
1343 1618 ),
1619 +
1344 1620 ];
1345 1621
1622 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1623 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1624 + }
1346 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 ] ?? [];
1347 1747 }
1348 1748 }