PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.0
ShopBuilder – WooCommerce Builder For Elementor v3.4.0
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 +638 -202 2.1.13.4.0 View file →
@@ -1,11 +1,11 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Models;
4 4
5 -// use RadiusTheme\SB\Helpers\Fns;
6 -use RadiusTheme\SB\Elementor\Helper\ControlHelper;
5 +use RadiusTheme\SB\AI\AIFns;
7 6 use RadiusTheme\SB\Helpers\Fns;
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,19 +51,412 @@
51 51 * @return array
52 52 */
53 53 protected function raw_list() {
54 54 $list = [
55 - 'notification' => apply_filters(
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(
56 439 'rtsb/settings/notification/options',
57 440 [
58 441 'id' => 'notification',
442 + 'icon' => SvgIcons::get( 'notification' ),
59 443 'category' => 'general',
60 444 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ),
61 445 'package' => 'free',
446 + 'links' => [
447 + 'doc' => '',
448 + 'video' => '',
449 + ],
62 450 'active_field' => [
63 451 'disable' => true,
64 452 ],
65 453 '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 + ],
66 459 'notification_position' => [
67 460 'id' => 'notification_position',
68 461 'value' => 'center-center',
69 462 'type' => 'select',
@@ -68,19 +461,30 @@
68 461 'value' => 'center-center',
69 462 'type' => 'select',
70 463 'label' => esc_html__( 'Notification Position', 'shopbuilder' ),
71 464 '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' ),
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' ),
81 472 ],
82 473 ],
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 + ],
83 487 'notification_color' => [
84 488 'id' => 'notification_color',
85 489 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
86 490 'type' => 'color',
@@ -97,23 +501,38 @@
97 501 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
98 502 'type' => 'color',
99 503 'tab' => 'floating_button',
100 504 ],
101 -
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 + ],
102 511 ],
103 512 ],
104 513 ),
105 - 'social_share' => apply_filters(
514 + 'social_share' => apply_filters(
106 515 'rtsb/settings/social_share/options',
107 516 [
108 517 'id' => 'social_share',
518 + 'icon' => SvgIcons::get( 'social_share' ),
109 519 'category' => 'general',
110 520 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ),
111 521 'package' => 'free',
522 + 'links' => [
523 + 'doc' => '',
524 + 'video' => '',
525 + ],
112 526 'active_field' => [
113 527 'disable' => true,
114 528 ],
115 529 '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 + ],
116 535 'share_platforms' => [
117 536 'id' => 'share_platforms',
118 537 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ),
119 538 'type' => 'checkbox',
@@ -126,25 +545,8 @@
126 545 'type' => 'switch',
127 546 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
128 547 '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 548 ],
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 549 'share_icon_layout' => [
148 550 'type' => 'select',
149 551 'value' => 'share-layout1',
150 552 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -164,37 +566,70 @@
164 566 ],
165 567 ],
166 568 ],
167 569 ),
168 - 'tooltip' => apply_filters(
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(
169 588 'rtsb/settings/tooltip/options',
170 589 [
171 590 'id' => 'tooltip',
591 + 'icon' => SvgIcons::get( 'tooltip' ),
172 592 'category' => 'general',
173 593 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ),
174 594 'package' => $this->pro_package(),
595 + 'links' => [
596 + 'doc' => '',
597 + 'video' => '',
598 + ],
175 599 'active_field' => [
176 600 'disable' => true,
177 601 ],
178 602 ],
179 603 ),
180 - 'billing_form' => apply_filters(
604 + 'billing_form' => apply_filters(
181 605 'rtsb/settings/billing_form/options',
182 606 [
183 607 'id' => 'billing_form',
608 + 'icon' => SvgIcons::get( 'billing_form' ),
184 609 'category' => 'checkout',
185 610 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
186 611 'package' => 'free',
612 + 'links' => [
613 + 'doc' => '',
614 + 'video' => '',
615 + ],
187 616 'active_field' => [
188 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
189 - 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
617 + 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
618 + 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
190 619 ],
191 620 'fields' => [
192 - 'billing_first_name_heading' => [
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' => [
193 629 'id' => 'billing_first_name_heading',
194 630 'type' => 'title',
195 631 'label' => esc_html__( 'First Name', 'shopbuilder' ),
196 - // 'tab' => 'name',
197 632 ],
198 633 'billing_first_name' => [
199 634 'id' => 'billing_first_name',
200 635 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -210,9 +645,8 @@
210 645 'value' => 'required',
211 646 'label' => 'Required Field',
212 647 ],
213 648 ],
214 - // 'tab' => 'name',
215 649 ],
216 650 'billing_first_name_label' => [
217 651 'id' => 'billing_first_name_label',
218 652 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -217,15 +651,14 @@
217 651 'id' => 'billing_first_name_label',
218 652 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
219 653 'type' => 'text',
220 654 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
221 - // 'tab' => 'name',
222 655 'dependency' => [
223 656 'rules' => [
224 657 [
225 658 'item' => 'general.billing_form.billing_first_name',
226 659 'value' => 'show',
227 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
660 + 'operator' => '==',
228 661 ],
229 662 ],
230 663 ],
231 664 ],
@@ -233,25 +666,23 @@
233 666 'id' => 'billing_first_name_placeholder',
234 667 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
235 668 'type' => 'text',
236 669 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
237 - // 'tab' => 'name',
238 670 'dependency' => [
239 671 'rules' => [
240 672 [
241 673 'item' => 'general.billing_form.billing_first_name',
242 674 'value' => 'show',
243 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
675 + 'operator' => '==',
244 676 ],
245 677 ],
246 678 ],
247 679 ],
248 680
249 - 'billing_last_name_heading' => [
681 + 'billing_last_name_heading' => [
250 682 'id' => 'billing_last_name_heading',
251 683 'type' => 'title',
252 684 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
253 - //'tab' => 'name',
254 685 ],
255 686 'billing_last_name' => [
256 687 'id' => 'billing_last_name',
257 688 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -267,9 +698,8 @@
267 698 'value' => 'required',
268 699 'label' => 'Required Field',
269 700 ],
270 701 ],
271 - // 'tab' => 'name',
272 702 ],
273 703
274 704 'billing_last_name_label' => [
275 705 'id' => 'billing_last_name_label',
@@ -275,9 +705,8 @@
275 705 'id' => 'billing_last_name_label',
276 706 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
277 707 'type' => 'text',
278 708 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
279 - // 'tab' => 'name',
280 709 'dependency' => [
281 710 'rules' => [
282 711 [
283 712 'item' => 'general.billing_form.billing_last_name',
@@ -291,9 +720,8 @@
291 720 'id' => 'billing_last_name_placeholder',
292 721 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
293 722 'type' => 'text',
294 723 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
295 - // 'tab' => 'name',
296 724 'dependency' => [
297 725 'rules' => [
298 726 [
299 727 'item' => 'general.billing_form.billing_last_name',
@@ -303,13 +731,12 @@
303 731 ],
304 732 ],
305 733 ],
306 734
307 - 'billing_company_heading' => [
735 + 'billing_company_heading' => [
308 736 'id' => 'billing_company_heading',
309 737 'type' => 'title',
310 738 'label' => esc_html__( 'Company', 'shopbuilder' ),
311 - //'tab' => 'company',
312 739 ],
313 740 'billing_company' => [
314 741 'id' => 'billing_company',
315 742 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -328,9 +755,8 @@
328 755 'value' => 'required',
329 756 'label' => 'Required Field',
330 757 ],
331 758 ],
332 - // 'tab' => 'company',
333 759 ],
334 760
335 761 'billing_company_label' => [
336 762 'id' => 'billing_company_label',
@@ -336,9 +762,8 @@
336 762 'id' => 'billing_company_label',
337 763 'label' => esc_html__( 'Company label', 'shopbuilder' ),
338 764 'type' => 'text',
339 765 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
340 - // 'tab' => 'company',
341 766 'dependency' => [
342 767 'rules' => [
343 768 [
344 769 'item' => 'general.billing_form.billing_company',
@@ -352,9 +777,8 @@
352 777 'id' => 'billing_company_placeholder',
353 778 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
354 779 'type' => 'text',
355 780 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
356 - // 'tab' => 'company',
357 781 'dependency' => [
358 782 'rules' => [
359 783 [
360 784 'item' => 'general.billing_form.billing_company',
@@ -364,13 +788,12 @@
364 788 ],
365 789 ],
366 790 ],
367 791
368 - 'billing_country_heading' => [
792 + 'billing_country_heading' => [
369 793 'id' => 'billing_country_heading',
370 794 'type' => 'title',
371 795 'label' => esc_html__( 'Country', 'shopbuilder' ),
372 - //'tab' => 'country',
373 796 ],
374 797 'billing_country' => [
375 798 'id' => 'billing_country',
376 799 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -376,22 +799,18 @@
376 799 'label' => esc_html__( 'Country', 'shopbuilder' ),
377 800 'type' => 'checkbox',
378 801 'orientation' => 'vertical',
379 802 'value' => [ 'show', 'required' ],
380 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
381 803 'options' => [
382 804 [
383 805 'value' => 'show',
384 806 'label' => 'Show Country?',
385 - // 'disabled' => true,
386 807 ],
387 808 [
388 809 'value' => 'required',
389 810 'label' => 'Required Field',
390 - // 'disabled' => true,
391 811 ],
392 812 ],
393 - // 'tab' => 'country',
394 813 ],
395 814
396 815 'billing_country_label' => [
397 816 'id' => 'billing_country_label',
@@ -397,9 +816,8 @@
397 816 'id' => 'billing_country_label',
398 817 'label' => esc_html__( 'Country label', 'shopbuilder' ),
399 818 'type' => 'text',
400 819 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
401 - // 'tab' => 'country',
402 820 'dependency' => [
403 821 'rules' => [
404 822 [
405 823 'item' => 'general.billing_form.billing_country',
@@ -408,13 +826,12 @@
408 826 ],
409 827 ],
410 828 ],
411 829 ],
412 - 'billing_address_1_heading' => [
830 + 'billing_address_1_heading' => [
413 831 'id' => 'billing_address_1_heading',
414 832 'type' => 'title',
415 833 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
416 - //'tab' => 'address',
417 834 ],
418 835 'billing_address_1' => [
419 836 'id' => 'billing_address_1',
420 837 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -430,9 +847,8 @@
430 847 'value' => 'required',
431 848 'label' => 'Required Field',
432 849 ],
433 850 ],
434 - // 'tab' => 'address',
435 851 ],
436 852
437 853 'billing_address_1_label' => [
438 854 'id' => 'billing_address_1_label',
@@ -438,9 +854,8 @@
438 854 'id' => 'billing_address_1_label',
439 855 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
440 856 'type' => 'text',
441 857 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
442 - // 'tab' => 'address',
443 858 'dependency' => [
444 859 'rules' => [
445 860 [
446 861 'item' => 'general.billing_form.billing_address_1',
@@ -454,9 +869,8 @@
454 869 'id' => 'billing_address_1_placeholder',
455 870 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
456 871 'type' => 'text',
457 872 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
458 - // 'tab' => 'address',
459 873 'dependency' => [
460 874 'rules' => [
461 875 [
462 876 'item' => 'general.billing_form.billing_address_1',
@@ -465,14 +879,13 @@
465 879 ],
466 880 ],
467 881 ],
468 882 ],
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' => [
883 + 'billing_address_2_heading' => [
884 + 'id' => 'billing_address_2_heading',
885 + 'type' => 'title',
886 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
887 + 'dependency' => [
475 888 'rules' => [
476 889 [
477 890 'item' => 'general.billing_form.billing_address_1',
478 891 'value' => 'show',
@@ -485,11 +898,11 @@
485 898 'id' => 'billing_address_2',
486 899 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
487 900 'type' => 'checkbox',
488 901 'orientation' => 'vertical',
489 - // 'tab' => 'address',
490 - 'value' => [ 'show',
491 - 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
902 + 'value' => [
903 + 'show',
904 + 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
492 905 ],
493 906 'options' => [
494 907 [
495 908 'value' => 'show',
@@ -512,9 +925,8 @@
512 925 'id' => 'billing_address_2_label',
513 926 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
514 927 'type' => 'text',
515 928 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
516 - // 'tab' => 'address',
517 929 'dependency' => [
518 930 'rules' => [
519 931 [
520 932 'item' => 'general.billing_form.billing_address_1',
@@ -533,9 +945,8 @@
533 945 'id' => 'billing_address_2_placeholder',
534 946 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
535 947 'type' => 'text',
536 948 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
537 - // 'tab' => 'address',
538 949 'dependency' => [
539 950 'rules' => [
540 951 [
541 952 'item' => 'general.billing_form.billing_address_1',
@@ -549,13 +960,12 @@
549 960 ],
550 961 ],
551 962 ],
552 963 ],
553 - 'billing_city_heading' => [
964 + 'billing_city_heading' => [
554 965 'id' => 'billing_city_heading',
555 966 'type' => 'title',
556 967 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
557 - // 'tab' => 'city',
558 968 ],
559 969 'billing_city' => [
560 970 'id' => 'billing_city',
561 971 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -561,9 +971,8 @@
561 971 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
562 972 'type' => 'checkbox',
563 973 'orientation' => 'vertical',
564 974 'value' => [ 'show', 'required' ],
565 - // 'tab' => 'city',
566 975 'options' => [
567 976 [
568 977 'value' => 'show',
569 978 'label' => 'Show Town / City?',
@@ -579,9 +988,8 @@
579 988 'id' => 'billing_city_label',
580 989 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
581 990 'type' => 'text',
582 991 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
583 - // 'tab' => 'city',
584 992 'dependency' => [
585 993 'rules' => [
586 994 [
587 995 'item' => 'general.billing_form.billing_city',
@@ -595,9 +1003,8 @@
595 1003 'id' => 'billing_city_placeholder',
596 1004 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
597 1005 'type' => 'text',
598 1006 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
599 - // 'tab' => 'city',
600 1007 'dependency' => [
601 1008 'rules' => [
602 1009 [
603 1010 'item' => 'general.billing_form.billing_city',
@@ -606,13 +1013,12 @@
606 1013 ],
607 1014 ],
608 1015 ],
609 1016 ],
610 - 'billing_state_heading' => [
1017 + 'billing_state_heading' => [
611 1018 'id' => 'billing_city_heading',
612 1019 'type' => 'title',
613 1020 'label' => esc_html__( 'State', 'shopbuilder' ),
614 - // 'tab' => 'state',
615 1021 ],
616 1022 'billing_state' => [
617 1023 'id' => 'billing_state',
618 1024 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -628,9 +1034,8 @@
628 1034 'value' => 'required',
629 1035 'label' => 'Required Field',
630 1036 ],
631 1037 ],
632 - // 'tab' => 'state',
633 1038 ],
634 1039
635 1040 'billing_state_label' => [
636 1041 'id' => 'billing_state_label',
@@ -636,10 +1041,8 @@
636 1041 'id' => 'billing_state_label',
637 1042 'label' => esc_html__( 'State label', 'shopbuilder' ),
638 1043 'type' => 'text',
639 1044 '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 1045 'dependency' => [
643 1046 'rules' => [
644 1047 [
645 1048 'item' => 'general.billing_form.billing_state',
@@ -648,13 +1051,12 @@
648 1051 ],
649 1052 ],
650 1053 ],
651 1054 ],
652 - 'billing_postcode_heading' => [
1055 + 'billing_postcode_heading' => [
653 1056 'id' => 'billing_postcode_heading',
654 1057 'type' => 'title',
655 1058 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
656 - // 'tab' => 'postcode',
657 1059 ],
658 1060 'billing_postcode' => [
659 1061 'id' => 'billing_postcode',
660 1062 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -670,9 +1072,8 @@
670 1072 'value' => 'required',
671 1073 'label' => 'Required Field',
672 1074 ],
673 1075 ],
674 - // 'tab' => 'postcode',
675 1076 ],
676 1077 'billing_postcode_label' => [
677 1078 'id' => 'billing_postcode_label',
678 1079 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -677,9 +1078,8 @@
677 1078 'id' => 'billing_postcode_label',
678 1079 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
679 1080 'type' => 'text',
680 1081 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
681 - // 'tab' => 'postcode',
682 1082 'dependency' => [
683 1083 'rules' => [
684 1084 [
685 1085 'item' => 'general.billing_form.billing_postcode',
@@ -693,9 +1093,8 @@
693 1093 'id' => 'billing_postcode_placeholder',
694 1094 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
695 1095 'type' => 'text',
696 1096 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
697 - // 'tab' => 'postcode',
698 1097 'dependency' => [
699 1098 'rules' => [
700 1099 [
701 1100 'item' => 'general.billing_form.billing_postcode',
@@ -704,13 +1103,12 @@
704 1103 ],
705 1104 ],
706 1105 ],
707 1106 ],
708 - 'billing_phone_heading' => [
1107 + 'billing_phone_heading' => [
709 1108 'id' => 'billing_phone_heading',
710 1109 'type' => 'title',
711 1110 'label' => esc_html__( 'Phone', 'shopbuilder' ),
712 - // 'tab' => 'phone',
713 1111 ],
714 1112 'billing_phone' => [
715 1113 'id' => 'billing_phone',
716 1114 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -715,9 +1113,8 @@
715 1113 'id' => 'billing_phone',
716 1114 'label' => esc_html__( 'Phone', 'shopbuilder' ),
717 1115 'type' => 'checkbox',
718 1116 'orientation' => 'vertical',
719 - // 'tab' => 'phone',
720 1117 'value' => [
721 1118 'show',
722 1119 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
723 1120 ],
@@ -737,9 +1134,8 @@
737 1134 'id' => 'billing_phone_label',
738 1135 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
739 1136 'type' => 'text',
740 1137 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
741 - // 'tab' => 'phone',
742 1138 'dependency' => [
743 1139 'rules' => [
744 1140 [
745 1141 'item' => 'general.billing_form.billing_phone',
@@ -753,9 +1149,8 @@
753 1149 'id' => 'billing_phone_placeholder',
754 1150 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
755 1151 'type' => 'text',
756 1152 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
757 - // 'tab' => 'phone',
758 1153 'dependency' => [
759 1154 'rules' => [
760 1155 [
761 1156 'item' => 'general.billing_form.billing_phone',
@@ -764,13 +1159,12 @@
764 1159 ],
765 1160 ],
766 1161 ],
767 1162 ],
768 - 'billing_email_heading' => [
1163 + 'billing_email_heading' => [
769 1164 'id' => 'billing_email_heading',
770 1165 'type' => 'title',
771 1166 'label' => esc_html__( 'Email', 'shopbuilder' ),
772 - // 'tab' => 'email',
773 1167 ],
774 1168 'billing_email' => [
775 1169 'id' => 'billing_email',
776 1170 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -775,9 +1169,8 @@
775 1169 'id' => 'billing_email',
776 1170 'label' => esc_html__( 'Email address', 'shopbuilder' ),
777 1171 'type' => 'checkbox',
778 1172 'orientation' => 'vertical',
779 - // 'tab' => 'email',
780 1173 'value' => [ 'show', 'required' ],
781 1174 'options' => [
782 1175 [
783 1176 'value' => 'show',
@@ -793,9 +1186,8 @@
793 1186 'id' => 'billing_email_label',
794 1187 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
795 1188 'type' => 'text',
796 1189 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
797 - // 'tab' => 'email',
798 1190 'dependency' => [
799 1191 'rules' => [
800 1192 [
801 1193 'item' => 'general.billing_form.billing_email',
@@ -809,9 +1201,8 @@
809 1201 'id' => 'billing_email_placeholder',
810 1202 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
811 1203 'type' => 'text',
812 1204 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
813 - // 'tab' => 'email',
814 1205 'dependency' => [
815 1206 'rules' => [
816 1207 [
817 1208 'item' => 'general.billing_form.billing_email',
@@ -824,25 +1215,36 @@
824 1215 ],
825 1216
826 1217 ]
827 1218 ),
828 - 'shipping_form' => apply_filters(
1219 + 'shipping_form' => apply_filters(
829 1220 'rtsb/module/shipping_form/options',
830 1221 [
831 1222 'id' => 'shipping_form',
1223 + 'icon' => SvgIcons::get( 'shipping_form' ),
832 1224 'category' => 'checkout',
833 1225 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
834 1226 'package' => 'free',
1227 + 'links' => [
1228 + 'doc' => '',
1229 + 'video' => '',
1230 + ],
835 1231 'active_field' => [
836 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
837 - 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
1232 + 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1233 + 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
838 1234 ],
839 1235 'fields' => [
840 - 'shipping_first_name_heading' => [
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' => [
841 1244 'id' => 'shipping_first_name_heading',
842 1245 'type' => 'title',
843 1246 'label' => esc_html__( 'First Name', 'shopbuilder' ),
844 - // 'tab' => 'name',
845 1247 ],
846 1248 'shipping_first_name' => [
847 1249 'id' => 'shipping_first_name',
848 1250 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -858,9 +1260,8 @@
858 1260 'value' => 'required',
859 1261 'label' => 'Required Field',
860 1262 ],
861 1263 ],
862 - // 'tab' => 'name',
863 1264 ],
864 1265 'shipping_first_name_label' => [
865 1266 'id' => 'shipping_first_name_label',
866 1267 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -865,9 +1266,8 @@
865 1266 'id' => 'shipping_first_name_label',
866 1267 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
867 1268 'type' => 'text',
868 1269 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
869 - // 'tab' => 'name',
870 1270 'dependency' => [
871 1271 'rules' => [
872 1272 [
873 1273 'item' => 'general.shipping_form.shipping_first_name',
@@ -881,9 +1281,8 @@
881 1281 'id' => 'shipping_first_name_placeholder',
882 1282 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
883 1283 'type' => 'text',
884 1284 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
885 - // 'tab' => 'country',
886 1285 'dependency' => [
887 1286 'rules' => [
888 1287 [
889 1288 'item' => 'general.shipping_form.shipping_first_name',
@@ -892,13 +1291,12 @@
892 1291 ],
893 1292 ],
894 1293 ],
895 1294 ],
896 - 'shipping_first_last_heading' => [
1295 + 'shipping_first_last_heading' => [
897 1296 'id' => 'shipping_first_last_heading',
898 1297 'type' => 'title',
899 1298 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
900 - // 'tab' => 'name',
901 1299 ],
902 1300 'shipping_last_name' => [
903 1301 'id' => 'shipping_last_name',
904 1302 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -914,9 +1312,8 @@
914 1312 'value' => 'required',
915 1313 'label' => 'Required Field',
916 1314 ],
917 1315 ],
918 - // 'tab' => 'name',
919 1316 ],
920 1317
921 1318 'shipping_last_name_label' => [
922 1319 'id' => 'shipping_last_name_label',
@@ -922,9 +1319,8 @@
922 1319 'id' => 'shipping_last_name_label',
923 1320 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
924 1321 'type' => 'text',
925 1322 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
926 - // 'tab' => 'name',
927 1323 'dependency' => [
928 1324 'rules' => [
929 1325 [
930 1326 'item' => 'general.shipping_form.shipping_last_name',
@@ -938,9 +1334,8 @@
938 1334 'id' => 'shipping_last_name_placeholder',
939 1335 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
940 1336 'type' => 'text',
941 1337 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
942 - // 'tab' => 'country',
943 1338 'dependency' => [
944 1339 'rules' => [
945 1340 [
946 1341 'item' => 'general.shipping_form.shipping_last_name',
@@ -949,13 +1344,12 @@
949 1344 ],
950 1345 ],
951 1346 ],
952 1347 ],
953 - 'shipping_company_heading' => [
1348 + 'shipping_company_heading' => [
954 1349 'id' => 'shipping_company_heading',
955 1350 'type' => 'title',
956 1351 'label' => esc_html__( 'Company', 'shopbuilder' ),
957 - // 'tab' => 'name',
958 1352 ],
959 1353 'shipping_company' => [
960 1354 'id' => 'shipping_company',
961 1355 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -971,9 +1365,8 @@
971 1365 'value' => 'required',
972 1366 'label' => 'Required Field',
973 1367 ],
974 1368 ],
975 - // 'tab' => 'company',
976 1369 ],
977 1370
978 1371 'shipping_company_label' => [
979 1372 'id' => 'shipping_company_label',
@@ -979,9 +1372,8 @@
979 1372 'id' => 'shipping_company_label',
980 1373 'label' => esc_html__( 'Company label', 'shopbuilder' ),
981 1374 'type' => 'text',
982 1375 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
983 - // 'tab' => 'company',
984 1376 'dependency' => [
985 1377 'rules' => [
986 1378 [
987 1379 'item' => 'general.shipping_form.shipping_company',
@@ -995,9 +1387,8 @@
995 1387 'id' => 'shipping_company_placeholder',
996 1388 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
997 1389 'type' => 'text',
998 1390 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
999 - // 'tab' => 'country',
1000 1391 'dependency' => [
1001 1392 'rules' => [
1002 1393 [
1003 1394 'item' => 'general.shipping_form.shipping_company',
@@ -1006,13 +1397,12 @@
1006 1397 ],
1007 1398 ],
1008 1399 ],
1009 1400 ],
1010 - 'shipping_country_heading' => [
1401 + 'shipping_country_heading' => [
1011 1402 'id' => 'shipping_country_heading',
1012 1403 'type' => 'title',
1013 1404 'label' => esc_html__( 'Country', 'shopbuilder' ),
1014 - // 'tab' => 'name',
1015 1405 ],
1016 1406 'shipping_country' => [
1017 1407 'id' => 'shipping_country',
1018 1408 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1022,17 +1412,14 @@
1022 1412 'options' => [
1023 1413 [
1024 1414 'value' => 'show',
1025 1415 'label' => 'Show Country?',
1026 - // 'disabled' => true,
1027 1416 ],
1028 1417 [
1029 1418 'value' => 'required',
1030 1419 'label' => 'Required Field',
1031 - // 'disabled' => true,
1032 1420 ],
1033 1421 ],
1034 - // 'tab' => 'country',
1035 1422 ],
1036 1423
1037 1424 'shipping_country_label' => [
1038 1425 'id' => 'shipping_country_label',
@@ -1048,13 +1435,12 @@
1048 1435 ],
1049 1436 ],
1050 1437 ],
1051 1438 ],
1052 - 'shipping_address_1_heading' => [
1439 + 'shipping_address_1_heading' => [
1053 1440 'id' => 'shipping_address_1_heading',
1054 1441 'type' => 'title',
1055 1442 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1056 - // 'tab' => 'name',
1057 1443 ],
1058 1444 'shipping_address_1' => [
1059 1445 'id' => 'shipping_address_1',
1060 1446 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1070,9 +1456,8 @@
1070 1456 'value' => 'required',
1071 1457 'label' => 'Required Field',
1072 1458 ],
1073 1459 ],
1074 - // 'tab' => 'country',
1075 1460 ],
1076 1461
1077 1462 'shipping_address_1_label' => [
1078 1463 'id' => 'shipping_address_1_label',
@@ -1078,9 +1463,8 @@
1078 1463 'id' => 'shipping_address_1_label',
1079 1464 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1080 1465 'type' => 'text',
1081 1466 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1082 - // 'tab' => 'country',
1083 1467 'dependency' => [
1084 1468 'rules' => [
1085 1469 [
1086 1470 'item' => 'general.shipping_form.shipping_address_1',
@@ -1094,9 +1478,8 @@
1094 1478 'id' => 'shipping_address_1_placeholder',
1095 1479 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1096 1480 'type' => 'text',
1097 1481 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1098 - // 'tab' => 'country',
1099 1482 'dependency' => [
1100 1483 'rules' => [
1101 1484 [
1102 1485 'item' => 'general.shipping_form.shipping_address_1',
@@ -1105,14 +1488,13 @@
1105 1488 ],
1106 1489 ],
1107 1490 ],
1108 1491 ],
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' => [
1492 + 'shipping_address_2_heading' => [
1493 + 'id' => 'shipping_address_2_heading',
1494 + 'type' => 'title',
1495 + 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1496 + 'dependency' => [
1115 1497 'rules' => [
1116 1498 [
1117 1499 'item' => 'general.shipping_form.shipping_address_1',
1118 1500 'value' => 'show',
@@ -1133,9 +1515,8 @@
1133 1515 'label' => 'Show Address field?',
1134 1516 ],
1135 1517 ],
1136 1518 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1137 - // 'tab' => 'country',
1138 1519 'dependency' => [
1139 1520 'rules' => [
1140 1521 [
1141 1522 'item' => 'general.shipping_form.shipping_address_1',
@@ -1150,9 +1531,8 @@
1150 1531 'id' => 'shipping_address_2_label',
1151 1532 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1152 1533 'type' => 'text',
1153 1534 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1154 - // 'tab' => 'country',
1155 1535 'dependency' => [
1156 1536 'rules' => [
1157 1537 [
1158 1538 'item' => 'general.shipping_form.shipping_address_1',
@@ -1171,9 +1551,8 @@
1171 1551 'id' => 'shipping_address_2_placeholder',
1172 1552 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1173 1553 'type' => 'text',
1174 1554 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1175 - // 'tab' => 'country',
1176 1555 'dependency' => [
1177 1556 'rules' => [
1178 1557 [
1179 1558 'item' => 'general.shipping_form.shipping_address_1',
@@ -1187,13 +1566,12 @@
1187 1566 ],
1188 1567 ],
1189 1568 ],
1190 1569 ],
1191 - 'shipping_city_heading' => [
1570 + 'shipping_city_heading' => [
1192 1571 'id' => 'shipping_city_heading',
1193 1572 'type' => 'title',
1194 1573 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1195 - // 'tab' => 'name',
1196 1574 ],
1197 1575 'shipping_city' => [
1198 1576 'id' => 'shipping_city',
1199 1577 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1209,9 +1587,8 @@
1209 1587 'value' => 'required',
1210 1588 'label' => 'Required Field',
1211 1589 ],
1212 1590 ],
1213 - // 'tab' => 'country',
1214 1591 ],
1215 1592 'shipping_city_label' => [
1216 1593 'id' => 'shipping_city_label',
1217 1594 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1216,9 +1593,8 @@
1216 1593 'id' => 'shipping_city_label',
1217 1594 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1218 1595 'type' => 'text',
1219 1596 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1220 - // 'tab' => 'country',
1221 1597 'dependency' => [
1222 1598 'rules' => [
1223 1599 [
1224 1600 'item' => 'general.shipping_form.shipping_city',
@@ -1232,9 +1608,8 @@
1232 1608 'id' => 'shipping_city_placeholder',
1233 1609 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1234 1610 'type' => 'text',
1235 1611 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1236 - // 'tab' => 'country',
1237 1612 'dependency' => [
1238 1613 'rules' => [
1239 1614 [
1240 1615 'item' => 'general.shipping_form.shipping_city',
@@ -1243,13 +1618,12 @@
1243 1618 ],
1244 1619 ],
1245 1620 ],
1246 1621 ],
1247 - 'shipping_state_heading' => [
1622 + 'shipping_state_heading' => [
1248 1623 'id' => 'shipping_state_heading',
1249 1624 'type' => 'title',
1250 1625 'label' => esc_html__( 'Others', 'shopbuilder' ),
1251 - // 'tab' => 'name',
1252 1626 ],
1253 1627 'shipping_state' => [
1254 1628 'id' => 'shipping_state',
1255 1629 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1265,33 +1639,9 @@
1265 1639 'value' => 'required',
1266 1640 'label' => 'Required Field',
1267 1641 ],
1268 1642 ],
1269 - // 'tab' => 'country',
1270 1643 ],
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 1644 'shipping_postcode' => [
1295 1645 'id' => 'shipping_postcode',
1296 1646 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1297 1647 'type' => 'checkbox',
@@ -1300,49 +1650,135 @@
1300 1650 'options' => [
1301 1651 [
1302 1652 'value' => 'show',
1303 1653 'label' => 'Show Postcode / ZIP?',
1304 - ]
1654 + ],
1305 1655 ],
1306 - // 'tab' => 'country',
1307 1656 ],
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 1657
1341 1658 ],
1342 1659 ]
1343 1660 ),
1661 +
1344 1662 ];
1345 1663
1664 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1665 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1666 + }
1346 1667 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 ] ?? [];
1347 1783 }
1348 1784 }