PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.2
ShopBuilder – WooCommerce Builder For Elementor v2.0.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 +202 -638 3.4.22.0.2 View file →
@@ -1,11 +1,11 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Models;
4 4
5 -use RadiusTheme\SB\AI\AIFns;
5 +// use RadiusTheme\SB\Helpers\Fns;
6 +use RadiusTheme\SB\Elementor\Helper\ControlHelper;
6 7 use RadiusTheme\SB\Helpers\Fns;
7 -use RadiusTheme\SB\Helpers\SvgIcons;
8 8 use RadiusTheme\SB\Models\Base\ListModel;
9 9 use RadiusTheme\SB\Traits\SingletonTrait;
10 10
11 11 defined( 'ABSPATH' ) || exit;
@@ -51,412 +51,19 @@
51 51 * @return array
52 52 */
53 53 protected function raw_list() {
54 54 $list = [
55 - 'optimization' => apply_filters(
56 - 'rtsb/settings/optimization/options',
57 - [
58 - 'id' => 'optimization',
59 - 'icon' => SvgIcons::get( 'optimization' ),
60 - 'category' => 'general',
61 - 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ),
62 - 'package' => $this->pro_version_checker(),
63 - 'badge' => 'new',
64 - 'links' => [
65 - 'doc' => '',
66 - 'video' => '',
67 - ],
68 - 'active_field' => [
69 - 'disable' => true,
70 - ],
71 - 'fields' => [
72 - 'optimization_intro' => [
73 - 'id' => 'optimization_intro',
74 - 'type' => 'description',
75 - '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> <span style="color: #16a34a; display: block; margin-top: 10px;">✅ Recommended: Keep Asset Optimization enabled on live/production sites for faster loading. Turn it off only while troubleshooting or verifying a recent change.</span>', 'shopbuilder' ),
76 - ],
77 - 'enable_optimization' => [
78 - 'id' => 'enable',
79 - 'type' => 'switch',
80 - 'value' => 'on',
81 - 'label' => esc_html__( 'Enable Asset Optimization?', 'shopbuilder' ),
82 - 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website\'s performance', 'shopbuilder' ),
83 - ],
84 - 'load_elementor_scripts' => [
85 - 'id' => 'enable',
86 - 'type' => 'switch',
87 - 'label' => esc_html__( 'Load Elementor Assets?', 'shopbuilder' ),
88 - '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' ),
89 - 'value' => 'on',
90 - 'dependency' => [
91 - 'rules' => [
92 - [
93 - 'item' => 'general.optimization.enable_optimization',
94 - 'value' => 'on',
95 - 'operator' => '==',
96 - ],
97 - ],
98 - ],
99 - ],
100 - 'context_asset_loading' => [
101 - 'id' => 'enable',
102 - 'type' => 'switch',
103 - 'label' => esc_html__( 'Context-Aware Asset Loading?', 'shopbuilder' ),
104 - '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' ),
105 - 'dependency' => [
106 - 'rules' => [
107 - [
108 - 'item' => 'general.optimization.enable_optimization',
109 - 'value' => 'on',
110 - 'operator' => '==',
111 - ],
112 - ],
113 - ],
114 - ],
115 - 'wp_rocket_compatibility' => [
116 - 'id' => 'wp_rocket_compatibility',
117 - 'type' => 'switch',
118 - 'label' => esc_html__( 'WP Rocket Compatibility', 'shopbuilder' ),
119 - 'help' => esc_html__( 'Enable this option to ensure compatibility with the WP Rocket plugin for optimized asset loading.', 'shopbuilder' ),
120 - ],
121 -
122 - 'remove_pre_loader' => [
123 - 'id' => 'remove_pre_loader',
124 - 'type' => 'switch',
125 - 'label' => esc_html__( 'Disable Element Preloader', 'shopbuilder' ),
126 - 'help' => esc_html__( 'Enable this option to remove the element preloader.', 'shopbuilder' ),
127 - ],
128 - /**
129 - 'load_gutenberg_scripts' => [
130 - 'id' => 'enable',
131 - 'type' => 'switch',
132 - 'label' => esc_html__( 'Load Gutenberg Scripts?', 'shopbuilder' ),
133 - 'help' => esc_html__( 'Switch on to load elementor scripts by dynamically loading scripts', 'shopbuilder' ),
134 - ],
135 - */
136 - ],
137 - ],
138 - ),
139 - 'ai_implementation' => apply_filters(
140 - 'rtsb/settings/ai_implementation/options',
141 - [
142 - 'id' => 'ai_implementation',
143 - 'icon' => SvgIcons::get( 'ai_implementation' ),
144 - 'category' => 'general',
145 - 'title' => esc_html__( 'AI-implementation', 'shopbuilder' ),
146 - 'package' => 'free',
147 - 'badge' => 'beta',
148 - 'links' => [
149 - 'doc' => '',
150 - 'video' => '',
151 - ],
152 - 'active_field' => [
153 - 'disable' => true,
154 - ],
155 - 'fields' => [
156 - 'data_ai_feature_beta_message' => [
157 - 'id' => 'data_ai_feature_beta_message',
158 - 'type' => 'description',
159 - 'text' => esc_html__( '🧠 AI feature is in beta — stable and fully functional, with more enhancements coming soon.', 'shopbuilder' ),
160 - ],
161 - 'ai_tools' => [
162 - 'id' => 'ai_tools',
163 - 'label' => esc_html__( 'AI Tools', 'shopbuilder' ),
164 - 'type' => 'select',
165 - 'value' => '',
166 - 'options' => [
167 - '' => esc_html__( '----', 'shopbuilder' ),
168 - 'OpenAI' => esc_html__( 'ChatGPT', 'shopbuilder' ),
169 - 'Gemini' => esc_html__( 'Google Gemini', 'shopbuilder' ),
170 - // phpcs:ignore Generic.Commenting
171 - // DeepSeek' => esc_html__( 'DeepSeek', 'shopbuilder' ), .
172 - ],
173 - ],
174 - // GPT.
175 - 'gpt_models' => [
176 - 'id' => 'gpt_models',
177 - 'label' => esc_html__( 'GPT Model', 'shopbuilder' ),
178 - 'type' => 'select',
179 - 'value' => 'gpt-4o',
180 - 'options' => [
181 - 'gpt-4o' => esc_html__( 'GPT-4o (Full Version)', 'shopbuilder' ),
182 - 'gpt-4o-mini' => esc_html__( 'GPT-4o Mini (Light Version)', 'shopbuilder' ),
183 - ],
184 - 'dependency' => [
185 - 'rules' => [
186 - [
187 - 'item' => 'general.ai_implementation.ai_tools',
188 - 'value' => 'OpenAI',
189 - 'operator' => '==',
190 - ],
191 - ],
192 - ],
193 - ],
194 - 'gpt_api_key' => [
195 - 'id' => 'gpt_api_key',
196 - 'label' => esc_html__( 'ChatGPT API Key', 'shopbuilder' ),
197 - 'type' => 'password',
198 - 'placeholder' => esc_html__( 'sk-p********', 'shopbuilder' ),
199 - 'help' => wp_kses(
200 - __(
201 - '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.',
202 - 'shopbuilder'
203 - ),
204 - [
205 - 'a' => [
206 - 'href' => [],
207 - 'target' => [],
208 - ],
209 - ]
210 - ),
211 - 'dependency' => [
212 - 'rules' => [
213 - [
214 - 'item' => 'general.ai_implementation.ai_tools',
215 - 'value' => 'OpenAI',
216 - 'operator' => '==',
217 - ],
218 - ],
219 - ],
220 - ],
221 - 'gpt_max_token' => [
222 - 'id' => 'gpt_max_token',
223 - 'label' => esc_html__( 'ChatGPT Maximum Characters in Prompt Input', 'shopbuilder' ),
224 - 'type' => 'number',
225 - 'help' => esc_html__(
226 - '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.',
227 - 'shopbuilder'
228 - ),
229 - 'value' => 200,
230 - 'placeholder' => esc_html__( '200', 'shopbuilder' ),
231 - 'dependency' => [
232 - 'rules' => [
233 - [
234 - 'item' => 'general.ai_implementation.ai_tools',
235 - 'value' => 'OpenAI',
236 - 'operator' => '==',
237 - ],
238 - ],
239 - ],
240 - ],
241 - // Gemini.
242 - 'gemini_api_key' => [
243 - 'id' => 'gemini_api_key',
244 - 'label' => esc_html__( 'Gemini API Key', 'shopbuilder' ),
245 - 'type' => 'password',
246 - 'placeholder' => esc_html__( 'AIzaSy***********************', 'shopbuilder' ),
247 - 'help' => wp_kses(
248 - __(
249 - '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.',
250 - 'shopbuilder'
251 - ),
252 - [
253 - 'a' => [
254 - 'href' => [],
255 - 'target' => [],
256 - ],
257 - ]
258 - ),
259 - 'dependency' => [
260 - 'rules' => [
261 - [
262 - 'item' => 'general.ai_implementation.ai_tools',
263 - 'value' => 'Gemini',
264 - 'operator' => '==',
265 - ],
266 - ],
267 - ],
268 - ],
269 - /**
270 - * User Will Not Understand how Its Works.
271 - 'gemini_models' => [
272 - 'id' => 'gemini_models',
273 - 'label' => esc_html__( 'Gemini Model', 'shopbuilder' ),
274 - 'type' => 'select',
275 - 'value' => 'gemini-2.5-flash',
276 - 'options' => [
277 - 'gemini-2.5-flash' => esc_html__( 'Gemini 2.5 Flash', 'shopbuilder' ),
278 - 'gemini-2.5-pro' => esc_html__( 'Gemini 2.5 Pro', 'shopbuilder' ),
279 - ],
280 - 'dependency' => [
281 - 'rules' => [
282 - [
283 - 'item' => 'general.ai_implementation.ai_tools',
284 - 'value' => 'Gemini',
285 - 'operator' => '==',
286 - ],
287 - ],
288 - ],
289 - ],
290 - */
291 - 'gemini_max_token' => [
292 - 'id' => 'gemini_max_token',
293 - 'label' => esc_html__( 'Gemini Maximum Characters', 'shopbuilder' ),
294 - 'type' => 'number',
295 - 'help' => esc_html__(
296 - 'Set the maximum character limit for Gemini model prompts. Adjust according to model capabilities and performance.',
297 - 'shopbuilder'
298 - ),
299 - 'value' => 200,
300 - 'placeholder' => esc_html__( '200', 'shopbuilder' ),
301 - 'dependency' => [
302 - 'rules' => [
303 - [
304 - 'item' => 'general.ai_implementation.ai_tools',
305 - 'value' => 'Gemini',
306 - 'operator' => '==',
307 - ],
308 - ],
309 - ],
310 - ],
311 - // DeepSeek.
312 - 'deepseek_api_key' => [
313 - 'id' => 'deepseek_api_key',
314 - 'label' => esc_html__( 'DeepSeek API Key', 'shopbuilder' ),
315 - 'type' => 'password',
316 - 'placeholder' => esc_html__( 'ds-***********************', 'shopbuilder' ),
317 - 'help' => wp_kses(
318 - __(
319 - '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.',
320 - 'shopbuilder'
321 - ),
322 - [
323 - 'a' => [
324 - 'href' => [],
325 - 'target' => [],
326 - ],
327 - ]
328 - ),
329 - 'dependency' => [
330 - 'rules' => [
331 - [
332 - 'item' => 'general.ai_implementation.ai_tools',
333 - 'value' => 'DeepSeek',
334 - 'operator' => '==',
335 - ],
336 - ],
337 - ],
338 - ],
339 - 'deepseek_models' => [
340 - 'id' => 'deepseek_models',
341 - 'label' => esc_html__( 'DeepSeek Model', 'shopbuilder' ),
342 - 'type' => 'select',
343 - 'value' => 'gpt-4o',
344 - 'options' => [
345 - 'deepseek-chat' => __( 'DeepSeek Chat (Full Version)', 'shopbuilder' ),
346 - 'deepseek-reasoner' => __( 'DeepSeek Reasoner Mini (Light Version)', 'shopbuilder' ),
347 - ],
348 - 'dependency' => [
349 - 'rules' => [
350 - [
351 - 'item' => 'general.ai_implementation.ai_tools',
352 - 'value' => 'DeepSeek',
353 - 'operator' => '==',
354 - ],
355 - ],
356 - ],
357 - ],
358 - 'deepseek_max_token' => [
359 - 'id' => 'deepseek_max_token',
360 - 'label' => esc_html__( 'Deepshek Maximum Characters', 'shopbuilder' ),
361 - 'type' => 'number',
362 - 'help' => esc_html__(
363 - 'Set the maximum character limit for Deepshek model prompts. Adjust according to model configuration and speed requirements.',
364 - 'shopbuilder'
365 - ),
366 - 'value' => 200,
367 - 'placeholder' => esc_html__( '200', 'shopbuilder' ),
368 - 'dependency' => [
369 - 'rules' => [
370 - [
371 - 'item' => 'general.ai_implementation.ai_tools',
372 - 'value' => 'DeepSeek',
373 - 'operator' => '==',
374 - ],
375 - ],
376 - ],
377 - ],
378 - 'enable_semantic_search' => [
379 - 'id' => 'enable_semantic_search',
380 - 'type' => 'switch',
381 - 'label' => esc_html__( 'Enable Semantic Search?', 'shopbuilder' ),
382 - 'help' => esc_html__( 'Enable AI product search instead of keyword matching to get product', 'shopbuilder' ),
383 - 'dependency' => [
384 - 'rules' => [
385 - [
386 - 'item' => 'general.ai_implementation.ai_tools',
387 - 'value' => [ 'OpenAI', 'Gemini' ],
388 - 'operator' => 'in',
389 - ],
390 - ],
391 - ],
392 - ],
393 - 'minimum_matching_percentage' => [
394 - 'id' => 'minimum_matching_percentage',
395 - 'label' => esc_html__( 'Minimum Accuracy (in percentage)', 'shopbuilder' ),
396 - 'help' => esc_html__( 'Set the minimum Accuracy. It is good between 40 and 60', 'shopbuilder' ),
397 - 'type' => 'number',
398 - 'min' => 1,
399 - 'max' => 99,
400 - 'value' => 40,
401 - 'placeholder' => esc_html__( '40', 'shopbuilder' ),
402 - 'dependency' => [
403 - 'rules' => [
404 - [
405 - 'item' => 'general.ai_implementation.ai_tools',
406 - 'value' => [ 'OpenAI', 'Gemini' ],
407 - 'operator' => 'in',
408 - ],
409 - [
410 - 'item' => 'general.ai_implementation.enable_semantic_search',
411 - 'value' => 'on',
412 - 'operator' => '==',
413 - ],
414 - ],
415 - ],
416 - ],
417 - 'data_training' => [
418 - 'id' => 'data_training',
419 - 'type' => 'title',
420 - 'label' => esc_html__( 'Data Training', 'shopbuilder' ),
421 - 'dependency' => [
422 - 'rules' => [
423 - [
424 - 'item' => 'general.ai_implementation.ai_tools',
425 - 'value' => [ 'OpenAI', 'Gemini' ],
426 - 'operator' => 'in',
427 - ],
428 - ],
429 - ],
430 - ],
431 - 'data_training_note_gemini' => $this->get_data_training_note_field( 'Gemini' ),
432 - 'data_training_note_openai' => $this->get_data_training_note_field( 'OpenAI' ),
433 - 'data_training_note_missing_openai_key' => $this->get_data_training_note_field( 'missingOpenAIKey' ),
434 - 'data_training_note_missing_gemneni_key' => $this->get_data_training_note_field( 'missingGeminiKey' ),
435 - ],
436 - ],
437 - ),
438 - 'notification' => apply_filters(
55 + 'notification' => apply_filters(
439 56 'rtsb/settings/notification/options',
440 57 [
441 58 'id' => 'notification',
442 - 'icon' => SvgIcons::get( 'notification' ),
443 59 'category' => 'general',
444 60 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ),
445 61 'package' => 'free',
446 - 'links' => [
447 - 'doc' => '',
448 - 'video' => '',
449 - ],
450 62 'active_field' => [
451 63 'disable' => true,
452 64 ],
453 65 'fields' => [
454 - 'notification_intro' => [
455 - 'id' => 'notification_intro',
456 - 'type' => 'description',
457 - 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ),
458 - ],
459 66 'notification_position' => [
460 67 'id' => 'notification_position',
461 68 'value' => 'center-center',
462 69 'type' => 'select',
@@ -461,30 +68,19 @@
461 68 'value' => 'center-center',
462 69 'type' => 'select',
463 70 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
464 71 'options' => [
465 - 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ),
466 - 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ),
467 - 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ),
468 - 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ),
469 - 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ),
470 - 'top-center' => esc_html__( 'Top center', 'shopbuilder' ),
471 - 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ),
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' ),
472 81 ],
473 82 ],
474 - 'notification_timeOut' => [
475 - 'id' => 'notification_timeOut',
476 - 'label' => esc_html__( 'Notification Time-Out (in seconds)', 'shopbuilder' ),
477 - 'type' => 'number',
478 - 'help' => esc_html__(
479 - 'Duration (in seconds) before the notification hides automatically.',
480 - 'shopbuilder'
481 - ),
482 - 'min' => 1,
483 - 'max' => 20,
484 - 'value' => 5,
485 - 'placeholder' => esc_html__( '3', 'shopbuilder' ),
486 - ],
487 83 'notification_color' => [
488 84 'id' => 'notification_color',
489 85 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
490 86 'type' => 'color',
@@ -501,38 +97,23 @@
501 97 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
502 98 'type' => 'color',
503 99 'tab' => 'floating_button',
504 100 ],
505 - 'hide_notification' => [
506 - 'id' => 'hide_notification',
507 - 'type' => 'switch',
508 - 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ),
509 - 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ),
510 - ],
101 +
511 102 ],
512 103 ],
513 104 ),
514 - 'social_share' => apply_filters(
105 + 'social_share' => apply_filters(
515 106 'rtsb/settings/social_share/options',
516 107 [
517 108 'id' => 'social_share',
518 - 'icon' => SvgIcons::get( 'social_share' ),
519 109 'category' => 'general',
520 110 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
521 111 'package' => 'free',
522 - 'links' => [
523 - 'doc' => '',
524 - 'video' => '',
525 - ],
526 112 'active_field' => [
527 113 'disable' => true,
528 114 ],
529 115 'fields' => [
530 - 'social_share_intro' => [
531 - 'id' => 'social_share_intro',
532 - 'type' => 'description',
533 - 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ),
534 - ],
535 116 'share_platforms' => [
536 117 'id' => 'share_platforms',
537 118 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
538 119 'type' => 'checkbox',
@@ -545,8 +126,25 @@
545 126 'type' => 'switch',
546 127 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
547 128 'help' => esc_html__( 'Enable this option to allow share a product from product page. Woocommerce Supported Sharing plugins added to Hook: woocommerce_share', 'shopbuilder' ),
548 129 ],
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 + */
549 147 'share_icon_layout' => [
550 148 'type' => 'select',
551 149 'value' => 'share-layout1',
552 150 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -566,70 +164,37 @@
566 164 ],
567 165 ],
568 166 ],
569 167 ),
570 - 'guest_user' => apply_filters(
571 - 'rtsb/settings/guest_user/options',
572 - [
573 - 'id' => 'guest_user',
574 - 'icon' => SvgIcons::get( 'guest_user' ),
575 - 'category' => 'general',
576 - 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ),
577 - 'package' => $this->pro_package(),
578 - 'links' => [
579 - 'doc' => '',
580 - 'video' => '',
581 - ],
582 - 'active_field' => [
583 - 'disable' => true,
584 - ],
585 - ],
586 - ),
587 - 'tooltip' => apply_filters(
168 + 'tooltip' => apply_filters(
588 169 'rtsb/settings/tooltip/options',
589 170 [
590 171 'id' => 'tooltip',
591 - 'icon' => SvgIcons::get( 'tooltip' ),
592 172 'category' => 'general',
593 173 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
594 174 'package' => $this->pro_package(),
595 - 'links' => [
596 - 'doc' => '',
597 - 'video' => '',
598 - ],
599 175 'active_field' => [
600 176 'disable' => true,
601 177 ],
602 178 ],
603 179 ),
604 - 'billing_form' => apply_filters(
180 + 'billing_form' => apply_filters(
605 181 'rtsb/settings/billing_form/options',
606 182 [
607 183 'id' => 'billing_form',
608 - 'icon' => SvgIcons::get( 'billing_form' ),
609 184 'category' => 'checkout',
610 185 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
611 186 'package' => 'free',
612 - 'links' => [
613 - 'doc' => '',
614 - 'video' => '',
615 - ],
616 187 'active_field' => [
617 - 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
618 - 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
188 + 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
189 + 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
619 190 ],
620 191 'fields' => [
621 - 'checkout_billing_info' => [
622 - 'id' => 'checkout_billing_info',
623 - 'type' => 'deprecated',
624 - 'label' => __( '<strong>Deprecated:</strong> Billing Form Settings is deprecated. Please use the <strong><u>Checkout Fields Editor</u></strong> module to customize checkout fields. These settings will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is active.', 'shopbuilder' ),
625 - 'customClass' => 'checkout-notice',
626 - 'before_active' => true,
627 - ],
628 - 'billing_first_name_heading' => [
192 + 'billing_first_name_heading' => [
629 193 'id' => 'billing_first_name_heading',
630 194 'type' => 'title',
631 195 'label' => esc_html__( 'First Name', 'shopbuilder' ),
196 + // 'tab' => 'name',
632 197 ],
633 198 'billing_first_name' => [
634 199 'id' => 'billing_first_name',
635 200 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -645,8 +210,9 @@
645 210 'value' => 'required',
646 211 'label' => 'Required Field',
647 212 ],
648 213 ],
214 + // 'tab' => 'name',
649 215 ],
650 216 'billing_first_name_label' => [
651 217 'id' => 'billing_first_name_label',
652 218 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -651,14 +217,15 @@
651 217 'id' => 'billing_first_name_label',
652 218 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
653 219 'type' => 'text',
654 220 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
221 + // 'tab' => 'name',
655 222 'dependency' => [
656 223 'rules' => [
657 224 [
658 225 'item' => 'general.billing_form.billing_first_name',
659 226 'value' => 'show',
660 - 'operator' => '==',
227 + 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
661 228 ],
662 229 ],
663 230 ],
664 231 ],
@@ -666,23 +233,25 @@
666 233 'id' => 'billing_first_name_placeholder',
667 234 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
668 235 'type' => 'text',
669 236 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
237 + // 'tab' => 'name',
670 238 'dependency' => [
671 239 'rules' => [
672 240 [
673 241 'item' => 'general.billing_form.billing_first_name',
674 242 'value' => 'show',
675 - 'operator' => '==',
243 + 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
676 244 ],
677 245 ],
678 246 ],
679 247 ],
680 248
681 - 'billing_last_name_heading' => [
249 + 'billing_last_name_heading' => [
682 250 'id' => 'billing_last_name_heading',
683 251 'type' => 'title',
684 252 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
253 + //'tab' => 'name',
685 254 ],
686 255 'billing_last_name' => [
687 256 'id' => 'billing_last_name',
688 257 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -698,8 +267,9 @@
698 267 'value' => 'required',
699 268 'label' => 'Required Field',
700 269 ],
701 270 ],
271 + // 'tab' => 'name',
702 272 ],
703 273
704 274 'billing_last_name_label' => [
705 275 'id' => 'billing_last_name_label',
@@ -705,8 +275,9 @@
705 275 'id' => 'billing_last_name_label',
706 276 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
707 277 'type' => 'text',
708 278 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
279 + // 'tab' => 'name',
709 280 'dependency' => [
710 281 'rules' => [
711 282 [
712 283 'item' => 'general.billing_form.billing_last_name',
@@ -720,8 +291,9 @@
720 291 'id' => 'billing_last_name_placeholder',
721 292 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
722 293 'type' => 'text',
723 294 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
295 + // 'tab' => 'name',
724 296 'dependency' => [
725 297 'rules' => [
726 298 [
727 299 'item' => 'general.billing_form.billing_last_name',
@@ -731,12 +303,13 @@
731 303 ],
732 304 ],
733 305 ],
734 306
735 - 'billing_company_heading' => [
307 + 'billing_company_heading' => [
736 308 'id' => 'billing_company_heading',
737 309 'type' => 'title',
738 310 'label' => esc_html__( 'Company', 'shopbuilder' ),
311 + //'tab' => 'company',
739 312 ],
740 313 'billing_company' => [
741 314 'id' => 'billing_company',
742 315 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -755,8 +328,9 @@
755 328 'value' => 'required',
756 329 'label' => 'Required Field',
757 330 ],
758 331 ],
332 + // 'tab' => 'company',
759 333 ],
760 334
761 335 'billing_company_label' => [
762 336 'id' => 'billing_company_label',
@@ -762,8 +336,9 @@
762 336 'id' => 'billing_company_label',
763 337 'label' => esc_html__( 'Company label', 'shopbuilder' ),
764 338 'type' => 'text',
765 339 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
340 + // 'tab' => 'company',
766 341 'dependency' => [
767 342 'rules' => [
768 343 [
769 344 'item' => 'general.billing_form.billing_company',
@@ -777,8 +352,9 @@
777 352 'id' => 'billing_company_placeholder',
778 353 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
779 354 'type' => 'text',
780 355 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
356 + // 'tab' => 'company',
781 357 'dependency' => [
782 358 'rules' => [
783 359 [
784 360 'item' => 'general.billing_form.billing_company',
@@ -788,12 +364,13 @@
788 364 ],
789 365 ],
790 366 ],
791 367
792 - 'billing_country_heading' => [
368 + 'billing_country_heading' => [
793 369 'id' => 'billing_country_heading',
794 370 'type' => 'title',
795 371 'label' => esc_html__( 'Country', 'shopbuilder' ),
372 + //'tab' => 'country',
796 373 ],
797 374 'billing_country' => [
798 375 'id' => 'billing_country',
799 376 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -799,18 +376,22 @@
799 376 'label' => esc_html__( 'Country', 'shopbuilder' ),
800 377 'type' => 'checkbox',
801 378 'orientation' => 'vertical',
802 379 'value' => [ 'show', 'required' ],
380 + // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
803 381 'options' => [
804 382 [
805 383 'value' => 'show',
806 384 'label' => 'Show Country?',
385 + // 'disabled' => true,
807 386 ],
808 387 [
809 388 'value' => 'required',
810 389 'label' => 'Required Field',
390 + // 'disabled' => true,
811 391 ],
812 392 ],
393 + // 'tab' => 'country',
813 394 ],
814 395
815 396 'billing_country_label' => [
816 397 'id' => 'billing_country_label',
@@ -816,8 +397,9 @@
816 397 'id' => 'billing_country_label',
817 398 'label' => esc_html__( 'Country label', 'shopbuilder' ),
818 399 'type' => 'text',
819 400 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
401 + // 'tab' => 'country',
820 402 'dependency' => [
821 403 'rules' => [
822 404 [
823 405 'item' => 'general.billing_form.billing_country',
@@ -826,12 +408,13 @@
826 408 ],
827 409 ],
828 410 ],
829 411 ],
830 - 'billing_address_1_heading' => [
412 + 'billing_address_1_heading' => [
831 413 'id' => 'billing_address_1_heading',
832 414 'type' => 'title',
833 415 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
416 + //'tab' => 'address',
834 417 ],
835 418 'billing_address_1' => [
836 419 'id' => 'billing_address_1',
837 420 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -847,8 +430,9 @@
847 430 'value' => 'required',
848 431 'label' => 'Required Field',
849 432 ],
850 433 ],
434 + // 'tab' => 'address',
851 435 ],
852 436
853 437 'billing_address_1_label' => [
854 438 'id' => 'billing_address_1_label',
@@ -854,8 +438,9 @@
854 438 'id' => 'billing_address_1_label',
855 439 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
856 440 'type' => 'text',
857 441 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
442 + // 'tab' => 'address',
858 443 'dependency' => [
859 444 'rules' => [
860 445 [
861 446 'item' => 'general.billing_form.billing_address_1',
@@ -869,8 +454,9 @@
869 454 'id' => 'billing_address_1_placeholder',
870 455 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
871 456 'type' => 'text',
872 457 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
458 + // 'tab' => 'address',
873 459 'dependency' => [
874 460 'rules' => [
875 461 [
876 462 'item' => 'general.billing_form.billing_address_1',
@@ -879,13 +465,14 @@
879 465 ],
880 466 ],
881 467 ],
882 468 ],
883 - 'billing_address_2_heading' => [
884 - 'id' => 'billing_address_2_heading',
885 - 'type' => 'title',
886 - 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
887 - 'dependency' => [
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' => [
888 475 'rules' => [
889 476 [
890 477 'item' => 'general.billing_form.billing_address_1',
891 478 'value' => 'show',
@@ -898,11 +485,11 @@
898 485 'id' => 'billing_address_2',
899 486 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
900 487 'type' => 'checkbox',
901 488 'orientation' => 'vertical',
902 - 'value' => [
903 - 'show',
904 - 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
489 + // 'tab' => 'address',
490 + 'value' => [ 'show',
491 + 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
905 492 ],
906 493 'options' => [
907 494 [
908 495 'value' => 'show',
@@ -925,8 +512,9 @@
925 512 'id' => 'billing_address_2_label',
926 513 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
927 514 'type' => 'text',
928 515 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
516 + // 'tab' => 'address',
929 517 'dependency' => [
930 518 'rules' => [
931 519 [
932 520 'item' => 'general.billing_form.billing_address_1',
@@ -945,8 +533,9 @@
945 533 'id' => 'billing_address_2_placeholder',
946 534 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
947 535 'type' => 'text',
948 536 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
537 + // 'tab' => 'address',
949 538 'dependency' => [
950 539 'rules' => [
951 540 [
952 541 'item' => 'general.billing_form.billing_address_1',
@@ -960,12 +549,13 @@
960 549 ],
961 550 ],
962 551 ],
963 552 ],
964 - 'billing_city_heading' => [
553 + 'billing_city_heading' => [
965 554 'id' => 'billing_city_heading',
966 555 'type' => 'title',
967 556 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
557 + // 'tab' => 'city',
968 558 ],
969 559 'billing_city' => [
970 560 'id' => 'billing_city',
971 561 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -971,8 +561,9 @@
971 561 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
972 562 'type' => 'checkbox',
973 563 'orientation' => 'vertical',
974 564 'value' => [ 'show', 'required' ],
565 + // 'tab' => 'city',
975 566 'options' => [
976 567 [
977 568 'value' => 'show',
978 569 'label' => 'Show Town / City?',
@@ -988,8 +579,9 @@
988 579 'id' => 'billing_city_label',
989 580 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
990 581 'type' => 'text',
991 582 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
583 + // 'tab' => 'city',
992 584 'dependency' => [
993 585 'rules' => [
994 586 [
995 587 'item' => 'general.billing_form.billing_city',
@@ -1003,8 +595,9 @@
1003 595 'id' => 'billing_city_placeholder',
1004 596 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
1005 597 'type' => 'text',
1006 598 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
599 + // 'tab' => 'city',
1007 600 'dependency' => [
1008 601 'rules' => [
1009 602 [
1010 603 'item' => 'general.billing_form.billing_city',
@@ -1013,12 +606,13 @@
1013 606 ],
1014 607 ],
1015 608 ],
1016 609 ],
1017 - 'billing_state_heading' => [
610 + 'billing_state_heading' => [
1018 611 'id' => 'billing_city_heading',
1019 612 'type' => 'title',
1020 613 'label' => esc_html__( 'State', 'shopbuilder' ),
614 + // 'tab' => 'state',
1021 615 ],
1022 616 'billing_state' => [
1023 617 'id' => 'billing_state',
1024 618 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1034,8 +628,9 @@
1034 628 'value' => 'required',
1035 629 'label' => 'Required Field',
1036 630 ],
1037 631 ],
632 + // 'tab' => 'state',
1038 633 ],
1039 634
1040 635 'billing_state_label' => [
1041 636 'id' => 'billing_state_label',
@@ -1041,8 +636,10 @@
1041 636 'id' => 'billing_state_label',
1042 637 'label' => esc_html__( 'State label', 'shopbuilder' ),
1043 638 'type' => 'text',
1044 639 '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',
1045 642 'dependency' => [
1046 643 'rules' => [
1047 644 [
1048 645 'item' => 'general.billing_form.billing_state',
@@ -1051,12 +648,13 @@
1051 648 ],
1052 649 ],
1053 650 ],
1054 651 ],
1055 - 'billing_postcode_heading' => [
652 + 'billing_postcode_heading' => [
1056 653 'id' => 'billing_postcode_heading',
1057 654 'type' => 'title',
1058 655 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
656 + // 'tab' => 'postcode',
1059 657 ],
1060 658 'billing_postcode' => [
1061 659 'id' => 'billing_postcode',
1062 660 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -1072,8 +670,9 @@
1072 670 'value' => 'required',
1073 671 'label' => 'Required Field',
1074 672 ],
1075 673 ],
674 + // 'tab' => 'postcode',
1076 675 ],
1077 676 'billing_postcode_label' => [
1078 677 'id' => 'billing_postcode_label',
1079 678 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -1078,8 +677,9 @@
1078 677 'id' => 'billing_postcode_label',
1079 678 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1080 679 'type' => 'text',
1081 680 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
681 + // 'tab' => 'postcode',
1082 682 'dependency' => [
1083 683 'rules' => [
1084 684 [
1085 685 'item' => 'general.billing_form.billing_postcode',
@@ -1093,8 +693,9 @@
1093 693 'id' => 'billing_postcode_placeholder',
1094 694 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1095 695 'type' => 'text',
1096 696 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
697 + // 'tab' => 'postcode',
1097 698 'dependency' => [
1098 699 'rules' => [
1099 700 [
1100 701 'item' => 'general.billing_form.billing_postcode',
@@ -1103,12 +704,13 @@
1103 704 ],
1104 705 ],
1105 706 ],
1106 707 ],
1107 - 'billing_phone_heading' => [
708 + 'billing_phone_heading' => [
1108 709 'id' => 'billing_phone_heading',
1109 710 'type' => 'title',
1110 711 'label' => esc_html__( 'Phone', 'shopbuilder' ),
712 + // 'tab' => 'phone',
1111 713 ],
1112 714 'billing_phone' => [
1113 715 'id' => 'billing_phone',
1114 716 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -1113,8 +715,9 @@
1113 715 'id' => 'billing_phone',
1114 716 'label' => esc_html__( 'Phone', 'shopbuilder' ),
1115 717 'type' => 'checkbox',
1116 718 'orientation' => 'vertical',
719 + // 'tab' => 'phone',
1117 720 'value' => [
1118 721 'show',
1119 722 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
1120 723 ],
@@ -1134,8 +737,9 @@
1134 737 'id' => 'billing_phone_label',
1135 738 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
1136 739 'type' => 'text',
1137 740 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
741 + // 'tab' => 'phone',
1138 742 'dependency' => [
1139 743 'rules' => [
1140 744 [
1141 745 'item' => 'general.billing_form.billing_phone',
@@ -1149,8 +753,9 @@
1149 753 'id' => 'billing_phone_placeholder',
1150 754 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
1151 755 'type' => 'text',
1152 756 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
757 + // 'tab' => 'phone',
1153 758 'dependency' => [
1154 759 'rules' => [
1155 760 [
1156 761 'item' => 'general.billing_form.billing_phone',
@@ -1159,12 +764,13 @@
1159 764 ],
1160 765 ],
1161 766 ],
1162 767 ],
1163 - 'billing_email_heading' => [
768 + 'billing_email_heading' => [
1164 769 'id' => 'billing_email_heading',
1165 770 'type' => 'title',
1166 771 'label' => esc_html__( 'Email', 'shopbuilder' ),
772 + // 'tab' => 'email',
1167 773 ],
1168 774 'billing_email' => [
1169 775 'id' => 'billing_email',
1170 776 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -1169,8 +775,9 @@
1169 775 'id' => 'billing_email',
1170 776 'label' => esc_html__( 'Email address', 'shopbuilder' ),
1171 777 'type' => 'checkbox',
1172 778 'orientation' => 'vertical',
779 + // 'tab' => 'email',
1173 780 'value' => [ 'show', 'required' ],
1174 781 'options' => [
1175 782 [
1176 783 'value' => 'show',
@@ -1186,8 +793,9 @@
1186 793 'id' => 'billing_email_label',
1187 794 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
1188 795 'type' => 'text',
1189 796 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
797 + // 'tab' => 'email',
1190 798 'dependency' => [
1191 799 'rules' => [
1192 800 [
1193 801 'item' => 'general.billing_form.billing_email',
@@ -1201,8 +809,9 @@
1201 809 'id' => 'billing_email_placeholder',
1202 810 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
1203 811 'type' => 'text',
1204 812 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
813 + // 'tab' => 'email',
1205 814 'dependency' => [
1206 815 'rules' => [
1207 816 [
1208 817 'item' => 'general.billing_form.billing_email',
@@ -1215,36 +824,25 @@
1215 824 ],
1216 825
1217 826 ]
1218 827 ),
1219 - 'shipping_form' => apply_filters(
828 + 'shipping_form' => apply_filters(
1220 829 'rtsb/module/shipping_form/options',
1221 830 [
1222 831 'id' => 'shipping_form',
1223 - 'icon' => SvgIcons::get( 'shipping_form' ),
1224 832 'category' => 'checkout',
1225 833 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
1226 834 'package' => 'free',
1227 - 'links' => [
1228 - 'doc' => '',
1229 - 'video' => '',
1230 - ],
1231 835 'active_field' => [
1232 - 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1233 - 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
836 + 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
837 + 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
1234 838 ],
1235 839 'fields' => [
1236 - 'checkout_shipping_info' => [
1237 - 'id' => 'checkout_shipping_info',
1238 - 'type' => 'deprecated',
1239 - 'label' => __( '<strong>Deprecated:</strong> Shipping Form Settings is deprecated. Please use the <strong><u>Checkout Fields Editor</u></strong> module to customize checkout fields. These settings will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is active.', 'shopbuilder' ),
1240 - 'customClass' => 'checkout-notice',
1241 - 'before_active' => true,
1242 - ],
1243 - 'shipping_first_name_heading' => [
840 + 'shipping_first_name_heading' => [
1244 841 'id' => 'shipping_first_name_heading',
1245 842 'type' => 'title',
1246 843 'label' => esc_html__( 'First Name', 'shopbuilder' ),
844 + // 'tab' => 'name',
1247 845 ],
1248 846 'shipping_first_name' => [
1249 847 'id' => 'shipping_first_name',
1250 848 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -1260,8 +858,9 @@
1260 858 'value' => 'required',
1261 859 'label' => 'Required Field',
1262 860 ],
1263 861 ],
862 + // 'tab' => 'name',
1264 863 ],
1265 864 'shipping_first_name_label' => [
1266 865 'id' => 'shipping_first_name_label',
1267 866 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -1266,8 +865,9 @@
1266 865 'id' => 'shipping_first_name_label',
1267 866 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
1268 867 'type' => 'text',
1269 868 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
869 + // 'tab' => 'name',
1270 870 'dependency' => [
1271 871 'rules' => [
1272 872 [
1273 873 'item' => 'general.shipping_form.shipping_first_name',
@@ -1281,8 +881,9 @@
1281 881 'id' => 'shipping_first_name_placeholder',
1282 882 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
1283 883 'type' => 'text',
1284 884 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
885 + // 'tab' => 'country',
1285 886 'dependency' => [
1286 887 'rules' => [
1287 888 [
1288 889 'item' => 'general.shipping_form.shipping_first_name',
@@ -1291,12 +892,13 @@
1291 892 ],
1292 893 ],
1293 894 ],
1294 895 ],
1295 - 'shipping_first_last_heading' => [
896 + 'shipping_first_last_heading' => [
1296 897 'id' => 'shipping_first_last_heading',
1297 898 'type' => 'title',
1298 899 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
900 + // 'tab' => 'name',
1299 901 ],
1300 902 'shipping_last_name' => [
1301 903 'id' => 'shipping_last_name',
1302 904 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -1312,8 +914,9 @@
1312 914 'value' => 'required',
1313 915 'label' => 'Required Field',
1314 916 ],
1315 917 ],
918 + // 'tab' => 'name',
1316 919 ],
1317 920
1318 921 'shipping_last_name_label' => [
1319 922 'id' => 'shipping_last_name_label',
@@ -1319,8 +922,9 @@
1319 922 'id' => 'shipping_last_name_label',
1320 923 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
1321 924 'type' => 'text',
1322 925 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
926 + // 'tab' => 'name',
1323 927 'dependency' => [
1324 928 'rules' => [
1325 929 [
1326 930 'item' => 'general.shipping_form.shipping_last_name',
@@ -1334,8 +938,9 @@
1334 938 'id' => 'shipping_last_name_placeholder',
1335 939 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
1336 940 'type' => 'text',
1337 941 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
942 + // 'tab' => 'country',
1338 943 'dependency' => [
1339 944 'rules' => [
1340 945 [
1341 946 'item' => 'general.shipping_form.shipping_last_name',
@@ -1344,12 +949,13 @@
1344 949 ],
1345 950 ],
1346 951 ],
1347 952 ],
1348 - 'shipping_company_heading' => [
953 + 'shipping_company_heading' => [
1349 954 'id' => 'shipping_company_heading',
1350 955 'type' => 'title',
1351 956 'label' => esc_html__( 'Company', 'shopbuilder' ),
957 + // 'tab' => 'name',
1352 958 ],
1353 959 'shipping_company' => [
1354 960 'id' => 'shipping_company',
1355 961 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -1365,8 +971,9 @@
1365 971 'value' => 'required',
1366 972 'label' => 'Required Field',
1367 973 ],
1368 974 ],
975 + // 'tab' => 'company',
1369 976 ],
1370 977
1371 978 'shipping_company_label' => [
1372 979 'id' => 'shipping_company_label',
@@ -1372,8 +979,9 @@
1372 979 'id' => 'shipping_company_label',
1373 980 'label' => esc_html__( 'Company label', 'shopbuilder' ),
1374 981 'type' => 'text',
1375 982 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
983 + // 'tab' => 'company',
1376 984 'dependency' => [
1377 985 'rules' => [
1378 986 [
1379 987 'item' => 'general.shipping_form.shipping_company',
@@ -1387,8 +995,9 @@
1387 995 'id' => 'shipping_company_placeholder',
1388 996 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1389 997 'type' => 'text',
1390 998 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
999 + // 'tab' => 'country',
1391 1000 'dependency' => [
1392 1001 'rules' => [
1393 1002 [
1394 1003 'item' => 'general.shipping_form.shipping_company',
@@ -1397,12 +1006,13 @@
1397 1006 ],
1398 1007 ],
1399 1008 ],
1400 1009 ],
1401 - 'shipping_country_heading' => [
1010 + 'shipping_country_heading' => [
1402 1011 'id' => 'shipping_country_heading',
1403 1012 'type' => 'title',
1404 1013 'label' => esc_html__( 'Country', 'shopbuilder' ),
1014 + // 'tab' => 'name',
1405 1015 ],
1406 1016 'shipping_country' => [
1407 1017 'id' => 'shipping_country',
1408 1018 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1412,14 +1022,17 @@
1412 1022 'options' => [
1413 1023 [
1414 1024 'value' => 'show',
1415 1025 'label' => 'Show Country?',
1026 + // 'disabled' => true,
1416 1027 ],
1417 1028 [
1418 1029 'value' => 'required',
1419 1030 'label' => 'Required Field',
1031 + // 'disabled' => true,
1420 1032 ],
1421 1033 ],
1034 + // 'tab' => 'country',
1422 1035 ],
1423 1036
1424 1037 'shipping_country_label' => [
1425 1038 'id' => 'shipping_country_label',
@@ -1435,12 +1048,13 @@
1435 1048 ],
1436 1049 ],
1437 1050 ],
1438 1051 ],
1439 - 'shipping_address_1_heading' => [
1052 + 'shipping_address_1_heading' => [
1440 1053 'id' => 'shipping_address_1_heading',
1441 1054 'type' => 'title',
1442 1055 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1056 + // 'tab' => 'name',
1443 1057 ],
1444 1058 'shipping_address_1' => [
1445 1059 'id' => 'shipping_address_1',
1446 1060 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1456,8 +1070,9 @@
1456 1070 'value' => 'required',
1457 1071 'label' => 'Required Field',
1458 1072 ],
1459 1073 ],
1074 + // 'tab' => 'country',
1460 1075 ],
1461 1076
1462 1077 'shipping_address_1_label' => [
1463 1078 'id' => 'shipping_address_1_label',
@@ -1463,8 +1078,9 @@
1463 1078 'id' => 'shipping_address_1_label',
1464 1079 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1465 1080 'type' => 'text',
1466 1081 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1082 + // 'tab' => 'country',
1467 1083 'dependency' => [
1468 1084 'rules' => [
1469 1085 [
1470 1086 'item' => 'general.shipping_form.shipping_address_1',
@@ -1478,8 +1094,9 @@
1478 1094 'id' => 'shipping_address_1_placeholder',
1479 1095 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1480 1096 'type' => 'text',
1481 1097 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1098 + // 'tab' => 'country',
1482 1099 'dependency' => [
1483 1100 'rules' => [
1484 1101 [
1485 1102 'item' => 'general.shipping_form.shipping_address_1',
@@ -1488,13 +1105,14 @@
1488 1105 ],
1489 1106 ],
1490 1107 ],
1491 1108 ],
1492 - 'shipping_address_2_heading' => [
1493 - 'id' => 'shipping_address_2_heading',
1494 - 'type' => 'title',
1495 - 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1496 - 'dependency' => [
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' => [
1497 1115 'rules' => [
1498 1116 [
1499 1117 'item' => 'general.shipping_form.shipping_address_1',
1500 1118 'value' => 'show',
@@ -1515,8 +1133,9 @@
1515 1133 'label' => 'Show Address field?',
1516 1134 ],
1517 1135 ],
1518 1136 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1137 + // 'tab' => 'country',
1519 1138 'dependency' => [
1520 1139 'rules' => [
1521 1140 [
1522 1141 'item' => 'general.shipping_form.shipping_address_1',
@@ -1531,8 +1150,9 @@
1531 1150 'id' => 'shipping_address_2_label',
1532 1151 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1533 1152 'type' => 'text',
1534 1153 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1154 + // 'tab' => 'country',
1535 1155 'dependency' => [
1536 1156 'rules' => [
1537 1157 [
1538 1158 'item' => 'general.shipping_form.shipping_address_1',
@@ -1551,8 +1171,9 @@
1551 1171 'id' => 'shipping_address_2_placeholder',
1552 1172 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1553 1173 'type' => 'text',
1554 1174 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1175 + // 'tab' => 'country',
1555 1176 'dependency' => [
1556 1177 'rules' => [
1557 1178 [
1558 1179 'item' => 'general.shipping_form.shipping_address_1',
@@ -1566,12 +1187,13 @@
1566 1187 ],
1567 1188 ],
1568 1189 ],
1569 1190 ],
1570 - 'shipping_city_heading' => [
1191 + 'shipping_city_heading' => [
1571 1192 'id' => 'shipping_city_heading',
1572 1193 'type' => 'title',
1573 1194 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1195 + // 'tab' => 'name',
1574 1196 ],
1575 1197 'shipping_city' => [
1576 1198 'id' => 'shipping_city',
1577 1199 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1587,8 +1209,9 @@
1587 1209 'value' => 'required',
1588 1210 'label' => 'Required Field',
1589 1211 ],
1590 1212 ],
1213 + // 'tab' => 'country',
1591 1214 ],
1592 1215 'shipping_city_label' => [
1593 1216 'id' => 'shipping_city_label',
1594 1217 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1593,8 +1216,9 @@
1593 1216 'id' => 'shipping_city_label',
1594 1217 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1595 1218 'type' => 'text',
1596 1219 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1220 + // 'tab' => 'country',
1597 1221 'dependency' => [
1598 1222 'rules' => [
1599 1223 [
1600 1224 'item' => 'general.shipping_form.shipping_city',
@@ -1608,8 +1232,9 @@
1608 1232 'id' => 'shipping_city_placeholder',
1609 1233 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1610 1234 'type' => 'text',
1611 1235 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1236 + // 'tab' => 'country',
1612 1237 'dependency' => [
1613 1238 'rules' => [
1614 1239 [
1615 1240 'item' => 'general.shipping_form.shipping_city',
@@ -1618,12 +1243,13 @@
1618 1243 ],
1619 1244 ],
1620 1245 ],
1621 1246 ],
1622 - 'shipping_state_heading' => [
1247 + 'shipping_state_heading' => [
1623 1248 'id' => 'shipping_state_heading',
1624 1249 'type' => 'title',
1625 1250 'label' => esc_html__( 'Others', 'shopbuilder' ),
1251 + // 'tab' => 'name',
1626 1252 ],
1627 1253 'shipping_state' => [
1628 1254 'id' => 'shipping_state',
1629 1255 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1639,9 +1265,33 @@
1639 1265 'value' => 'required',
1640 1266 'label' => 'Required Field',
1641 1267 ],
1642 1268 ],
1269 + // 'tab' => 'country',
1643 1270 ],
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 + //],
1644 1294 'shipping_postcode' => [
1645 1295 'id' => 'shipping_postcode',
1646 1296 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1647 1297 'type' => 'checkbox',
@@ -1650,135 +1300,49 @@
1650 1300 'options' => [
1651 1301 [
1652 1302 'value' => 'show',
1653 1303 'label' => 'Show Postcode / ZIP?',
1654 - ],
1304 + ]
1655 1305 ],
1306 + // 'tab' => 'country',
1656 1307 ],
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 + // ],
1657 1340
1658 1341 ],
1659 1342 ]
1660 1343 ),
1661 -
1662 1344 ];
1663 1345
1664 - if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1665 - unset( $list['optimization']['fields']['load_elementor_scripts'] );
1666 - }
1667 1346 return apply_filters( 'rtsb/core/general_settings/raw_list', $list );
1668 - }
1669 -
1670 - /**
1671 - * Get the Data Training Note field.
1672 - *
1673 - * @param string $tool Meta values.
1674 - * @return array
1675 - */
1676 - public function get_data_training_note_field( $tool ): array {
1677 - $progress = get_option( 'rtsb_embedding_progress', [ 'processed' => 0 ] );
1678 - $total = AIFns::need_product_embedding();
1679 - $processed = (int) $progress['processed'];
1680 - $remaining = max( $total - $processed, 0 );
1681 - $generate_url = add_query_arg(
1682 - [
1683 - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
1684 - 'action' => 'rtsb_start_embedding_process',
1685 - ],
1686 - admin_url( 'admin.php?page=rtsb-settings' )
1687 - );
1688 -
1689 - if ( wp_next_scheduled( 'rtsb_embedding_cron_run' ) ) {
1690 - $text = esc_html__( 'Processing embeddings in the background. You can continue using the site.', 'shopbuilder' );
1691 - } else {
1692 - if ( $remaining > 0 ) {
1693 - // Build the correct text based on embedding progress.
1694 - $text = sprintf(
1695 - '%1$s <a class="rtsb-generate-embedding" href="%2$s">%3$s</a>',
1696 - esc_html__( 'Make Compatible your existing products with semantic search process.', 'shopbuilder' ),
1697 - esc_url( $generate_url ),
1698 - esc_html__( 'Generate Embeddings', 'shopbuilder' )
1699 - );
1700 - } else {
1701 - $text = esc_html__( '🎉 Congratulations! All your products are successfully embedded and up to date.', 'shopbuilder' );
1702 - }
1703 - }
1704 - $note = [
1705 - 'OpenAI' => [
1706 - 'id' => 'data_training_note_openai',
1707 - 'type' => 'description',
1708 - 'text' => $text,
1709 - 'dependency' => [
1710 - 'rules' => [
1711 - [
1712 - 'item' => 'general.ai_implementation.ai_tools',
1713 - 'value' => 'OpenAI',
1714 - 'operator' => '==',
1715 - ],
1716 - [
1717 - 'item' => 'general.ai_implementation.gpt_api_key',
1718 - 'value' => '',
1719 - 'operator' => '!=',
1720 - ],
1721 - ],
1722 - ],
1723 - ],
1724 - 'Gemini' => [
1725 - 'id' => 'data_training_note_gemini',
1726 - 'type' => 'description',
1727 - 'text' => $text,
1728 - 'dependency' => [
1729 - 'rules' => [
1730 - [
1731 - 'item' => 'general.ai_implementation.ai_tools',
1732 - 'value' => 'Gemini',
1733 - 'operator' => '==',
1734 - ],
1735 - [
1736 - 'item' => 'general.ai_implementation.gemini_api_key',
1737 - 'value' => '',
1738 - 'operator' => '!=',
1739 - ],
1740 - ],
1741 - ],
1742 - ],
1743 - 'missingGeminiKey' => [
1744 - 'id' => 'data_training_note_missing_gemneni_key',
1745 - 'type' => 'description',
1746 - 'text' => esc_html__( 'Missing Gemini API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1747 - 'dependency' => [
1748 - 'rules' => [
1749 - [
1750 - 'item' => 'general.ai_implementation.ai_tools',
1751 - 'value' => 'Gemini',
1752 - 'operator' => '==',
1753 - ],
1754 - [
1755 - 'item' => 'general.ai_implementation.gemini_api_key',
1756 - 'value' => '',
1757 - 'operator' => '==',
1758 - ],
1759 - ],
1760 - ],
1761 - ],
1762 - 'missingOpenAIKey' => [
1763 - 'id' => 'data_training_note_missing_openai_key',
1764 - 'type' => 'description',
1765 - 'text' => esc_html__( 'Missing OpenAI API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ),
1766 - 'dependency' => [
1767 - 'rules' => [
1768 - [
1769 - 'item' => 'general.ai_implementation.ai_tools',
1770 - 'value' => 'OpenAI',
1771 - 'operator' => '==',
1772 - ],
1773 - [
1774 - 'item' => 'general.ai_implementation.gpt_api_key',
1775 - 'value' => '',
1776 - 'operator' => '==',
1777 - ],
1778 - ],
1779 - ],
1780 - ],
1781 - ];
1782 - return $note[ $tool ] ?? [];
1783 1347 }
1784 1348 }