PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.0
ShopBuilder – WooCommerce Builder For Elementor v3.2.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 +430 -163 2.1.43.2.0 View file →
@@ -1,10 +1,8 @@
1 1 <?php
2 2
3 3 namespace RadiusTheme\SB\Models;
4 4
5 -// use RadiusTheme\SB\Helpers\Fns;
6 -use RadiusTheme\SB\Elementor\Helper\ControlHelper;
7 5 use RadiusTheme\SB\Helpers\Fns;
8 6 use RadiusTheme\SB\Models\Base\ListModel;
9 7 use RadiusTheme\SB\Traits\SingletonTrait;
10 8
@@ -51,9 +49,360 @@
51 49 * @return array
52 50 */
53 51 protected function raw_list() {
54 52 $list = [
55 - 'notification' => apply_filters(
53 + 'optimization' => apply_filters(
54 + 'rtsb/settings/optimization/options',
55 + [
56 + 'id' => 'optimization',
57 + 'category' => 'general',
58 + 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ),
59 + 'package' => $this->pro_version_checker(),
60 + 'badge' => 'new',
61 + 'active_field' => [
62 + 'disable' => true,
63 + ],
64 + 'fields' => [
65 + 'optimization_intro' => [
66 + 'id' => 'optimization_intro',
67 + 'type' => 'description',
68 + 'text' => __( 'Optimize your website for maximum performance from these advanced options. <br /> <span style="color: #dc3545; display: block; margin-top: 10px;">⚠️ Note: After enabling or disabling any of these settings, clear the ShopBuilder cache to ensure changes are applied correctly.</span>', 'shopbuilder' ),
69 + ],
70 + 'enable_optimization' => [
71 + 'id' => 'enable',
72 + 'type' => 'switch',
73 + 'label' => esc_html__( 'Enable Asset Optimization?', 'shopbuilder' ),
74 + 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website’s performance', 'shopbuilder' ),
75 + ],
76 + 'load_elementor_scripts' => [
77 + 'id' => 'enable',
78 + 'type' => 'switch',
79 + 'label' => esc_html__( 'Load Elementor Assets?', 'shopbuilder' ),
80 + 'help' => __( 'Enable this option to load necessary Elementor assets on your website. <br /> <span style="color: #dc3545;">Turn this off if you are not using Elementor widgets to optimize site performance.</span>', 'shopbuilder' ),
81 + 'value' => 'on',
82 + 'dependency' => [
83 + 'rules' => [
84 + [
85 + 'item' => 'general.optimization.enable_optimization',
86 + 'value' => 'on',
87 + 'operator' => '==',
88 + ],
89 + ],
90 + ],
91 + ],
92 + 'context_asset_loading' => [
93 + 'id' => 'enable',
94 + 'type' => 'switch',
95 + 'label' => esc_html__( 'Context-Aware Asset Loading?', 'shopbuilder' ),
96 + 'help' => esc_html__( 'Enable this option to dynamically Load only the necessary CSS and JS for each page type (e.g., product, cart, checkout). Disabling this option will include all assets globally on every page.', 'shopbuilder' ),
97 + 'dependency' => [
98 + 'rules' => [
99 + [
100 + 'item' => 'general.optimization.enable_optimization',
101 + 'value' => 'on',
102 + 'operator' => '==',
103 + ],
104 + ],
105 + ],
106 + ],
107 + 'wp_rocket_compatibility' => [
108 + 'id' => 'wp_rocket_compatibility',
109 + 'type' => 'switch',
110 + 'label' => esc_html__( 'WP Rocket Compatibility', 'shopbuilder' ),
111 + 'help' => esc_html__( 'Enable this option to ensure compatibility with the WP Rocket plugin for optimized asset loading.', 'shopbuilder' ),
112 + ],
113 +
114 + 'remove_pre_loader' => [
115 + 'id' => 'remove_pre_loader',
116 + 'type' => 'switch',
117 + 'label' => esc_html__( 'Disable Element Preloader', 'shopbuilder' ),
118 + 'help' => esc_html__( 'Enable this option to remove the element preloader.', 'shopbuilder' ),
119 + ],
120 + /**
121 + 'load_gutenberg_scripts' => [
122 + 'id' => 'enable',
123 + 'type' => 'switch',
124 + 'label' => esc_html__( 'Load Gutenberg Scripts?', 'shopbuilder' ),
125 + 'help' => esc_html__( 'Switch on to load elementor scripts by dynamically loading scripts', 'shopbuilder' ),
126 + ],
127 + */
128 + ],
129 + ],
130 + ),
131 + 'ai_implementation' => apply_filters(
132 + 'rtsb/settings/ai_implementation/options',
133 + [
134 + 'id' => 'ai_implementation',
135 + 'category' => 'general',
136 + 'title' => esc_html__( 'AI-implementation', 'shopbuilder' ),
137 + 'package' => 'free',
138 + 'badge' => 'new',
139 + 'active_field' => [
140 + 'disable' => true,
141 + ],
142 + 'fields' => [
143 + 'data_ai_feature_beta_message' => [
144 + 'id' => 'data_ai_feature_beta_message',
145 + 'type' => 'description',
146 + 'text' => esc_html__( '🧠 AI feature is in beta — stable and fully functional, with more enhancements coming soon.', 'shopbuilder' ),
147 + ],
148 + 'ai_tools' => [
149 + 'id' => 'ai_tools',
150 + 'label' => esc_html__( 'AI Tools', 'shopbuilder' ),
151 + 'type' => 'select',
152 + 'value' => '',
153 + 'options' => [
154 + '' => esc_html__( '----', 'shopbuilder' ),
155 + 'OpenAI' => esc_html__( 'ChatGPT', 'shopbuilder' ),
156 + 'Gemini' => esc_html__( 'Google Gemini', 'shopbuilder' ),
157 + // phpcs:ignore Generic.Commenting
158 + // DeepSeek' => esc_html__( 'DeepSeek', 'shopbuilder' ), .
159 + ],
160 + ],
161 + // GPT.
162 + 'gpt_models' => [
163 + 'id' => 'gpt_models',
164 + 'label' => esc_html__( 'GPT Model', 'shopbuilder' ),
165 + 'type' => 'select',
166 + 'value' => 'gpt-4o',
167 + 'options' => [
168 + 'gpt-4o' => esc_html__( 'GPT-4o (Full Version)', 'shopbuilder' ),
169 + 'gpt-4o-mini' => esc_html__( 'GPT-4o Mini (Light Version)', 'shopbuilder' ),
170 + ],
171 + 'dependency' => [
172 + 'rules' => [
173 + [
174 + 'item' => 'general.ai_implementation.ai_tools',
175 + 'value' => 'OpenAI',
176 + 'operator' => '==',
177 + ],
178 + ],
179 + ],
180 + ],
181 + 'gpt_api_key' => [
182 + 'id' => 'gpt_api_key',
183 + 'label' => esc_html__( 'ChatGPT API Key', 'shopbuilder' ),
184 + 'type' => 'password',
185 + 'placeholder' => esc_html__( 'sk-p********', 'shopbuilder' ),
186 + 'help' => wp_kses(
187 + __(
188 + 'To integrate with ChatGPT, you need to obtain an API key from OpenAI. Visit <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API Keys</a> to generate one.',
189 + 'shopbuilder'
190 + ),
191 + [
192 + 'a' => [
193 + 'href' => [],
194 + 'target' => [],
195 + ],
196 + ]
197 + ),
198 + 'dependency' => [
199 + 'rules' => [
200 + [
201 + 'item' => 'general.ai_implementation.ai_tools',
202 + 'value' => 'OpenAI',
203 + 'operator' => '==',
204 + ],
205 + ],
206 + ],
207 + ],
208 + 'gpt_max_token' => [
209 + 'id' => 'gpt_max_token',
210 + 'label' => esc_html__( 'ChatGPT Maximum Characters in Prompt Input', 'shopbuilder' ),
211 + 'type' => 'number',
212 + 'help' => esc_html__(
213 + 'Set the maximum character limit for the prompt input. This controls how many characters users can enter, ensuring input stays concise and manageable. Higher limits may affect performance and response quality.',
214 + 'shopbuilder'
215 + ),
216 + 'value' => 200,
217 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
218 + 'dependency' => [
219 + 'rules' => [
220 + [
221 + 'item' => 'general.ai_implementation.ai_tools',
222 + 'value' => 'OpenAI',
223 + 'operator' => '==',
224 + ],
225 + ],
226 + ],
227 + ],
228 + // Gemini.
229 + 'gemini_api_key' => [
230 + 'id' => 'gemini_api_key',
231 + 'label' => esc_html__( 'Gemini API Key', 'shopbuilder' ),
232 + 'type' => 'password',
233 + 'placeholder' => esc_html__( 'AIzaSy***********************', 'shopbuilder' ),
234 + 'help' => wp_kses(
235 + __(
236 + 'To integrate with Google Gemini, you need to obtain an API key from Google Cloud. Visit <a href="https://makersuite.google.com/app/apikey" target="_blank">Google AI Studio API Keys</a> to generate one.',
237 + 'shopbuilder'
238 + ),
239 + [
240 + 'a' => [
241 + 'href' => [],
242 + 'target' => [],
243 + ],
244 + ]
245 + ),
246 + 'dependency' => [
247 + 'rules' => [
248 + [
249 + 'item' => 'general.ai_implementation.ai_tools',
250 + 'value' => 'Gemini',
251 + 'operator' => '==',
252 + ],
253 + ],
254 + ],
255 + ],
256 +
257 + 'gemini_max_token' => [
258 + 'id' => 'gemini_max_token',
259 + 'label' => esc_html__( 'Gemini Maximum Characters', 'shopbuilder' ),
260 + 'type' => 'number',
261 + 'help' => esc_html__(
262 + 'Set the maximum character limit for Gemini model prompts. Adjust according to model capabilities and performance.',
263 + 'shopbuilder'
264 + ),
265 + 'value' => 200,
266 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
267 + 'dependency' => [
268 + 'rules' => [
269 + [
270 + 'item' => 'general.ai_implementation.ai_tools',
271 + 'value' => 'Gemini',
272 + 'operator' => '==',
273 + ],
274 + ],
275 + ],
276 + ],
277 + // DeepSeek.
278 + 'deepseek_api_key' => [
279 + 'id' => 'deepseek_api_key',
280 + 'label' => esc_html__( 'DeepSeek API Key', 'shopbuilder' ),
281 + 'type' => 'password',
282 + 'placeholder' => esc_html__( 'ds-***********************', 'shopbuilder' ),
283 + 'help' => wp_kses(
284 + __(
285 + '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.',
286 + 'shopbuilder'
287 + ),
288 + [
289 + 'a' => [
290 + 'href' => [],
291 + 'target' => [],
292 + ],
293 + ]
294 + ),
295 + 'dependency' => [
296 + 'rules' => [
297 + [
298 + 'item' => 'general.ai_implementation.ai_tools',
299 + 'value' => 'DeepSeek',
300 + 'operator' => '==',
301 + ],
302 + ],
303 + ],
304 + ],
305 + 'deepseek_models' => [
306 + 'id' => 'deepseek_models',
307 + 'label' => esc_html__( 'DeepSeek Model', 'shopbuilder' ),
308 + 'type' => 'select',
309 + 'value' => 'gpt-4o',
310 + 'options' => [
311 + 'deepseek-chat' => __( 'DeepSeek Chat (Full Version)', 'shopbuilder' ),
312 + 'deepseek-reasoner' => __( 'DeepSeek Reasoner Mini (Light Version)', 'shopbuilder' ),
313 + ],
314 + 'dependency' => [
315 + 'rules' => [
316 + [
317 + 'item' => 'general.ai_implementation.ai_tools',
318 + 'value' => 'DeepSeek',
319 + 'operator' => '==',
320 + ],
321 + ],
322 + ],
323 + ],
324 + 'deepseek_max_token' => [
325 + 'id' => 'deepseek_max_token',
326 + 'label' => esc_html__( 'Deepshek Maximum Characters', 'shopbuilder' ),
327 + 'type' => 'number',
328 + 'help' => esc_html__(
329 + 'Set the maximum character limit for Deepshek model prompts. Adjust according to model configuration and speed requirements.',
330 + 'shopbuilder'
331 + ),
332 + 'value' => 200,
333 + 'placeholder' => esc_html__( '200', 'shopbuilder' ),
334 + 'dependency' => [
335 + 'rules' => [
336 + [
337 + 'item' => 'general.ai_implementation.ai_tools',
338 + 'value' => 'DeepSeek',
339 + 'operator' => '==',
340 + ],
341 + ],
342 + ],
343 + ],
344 + 'enable_semantic_search' => [
345 + 'id' => 'enable_semantic_search',
346 + 'type' => 'switch',
347 + 'label' => esc_html__( 'Enable Semantic Search?', 'shopbuilder' ),
348 + 'help' => esc_html__( 'Enable AI product search instead of keyword matching to get product', 'shopbuilder' ),
349 + 'dependency' => [
350 + 'rules' => [
351 + [
352 + 'item' => 'general.ai_implementation.ai_tools',
353 + 'value' => [ 'OpenAI', 'Gemini' ],
354 + 'operator' => 'in',
355 + ],
356 + ],
357 + ],
358 + ],
359 + 'minimum_matching_percentage' => [
360 + 'id' => 'minimum_matching_percentage',
361 + 'label' => esc_html__( 'Minimum Accuracy (in percentage)', 'shopbuilder' ),
362 + 'type' => 'number',
363 + 'min' => 1,
364 + 'max' => 99,
365 + 'help' => esc_html__(
366 + 'Set the minimum Accuracy.',
367 + 'shopbuilder'
368 + ),
369 + 'value' => 99,
370 + 'placeholder' => esc_html__( '99', 'shopbuilder' ),
371 + 'dependency' => [
372 + 'rules' => [
373 + [
374 + 'item' => 'general.ai_implementation.ai_tools',
375 + 'value' => [ 'OpenAI', 'Gemini' ],
376 + 'operator' => 'in',
377 + ],
378 + [
379 + 'item' => 'general.ai_implementation.enable_semantic_search',
380 + 'value' => 'on',
381 + 'operator' => '==',
382 + ],
383 + ],
384 + ],
385 + ],
386 + 'data_training' => [
387 + 'id' => 'data_training',
388 + 'type' => 'title',
389 + 'label' => esc_html__( 'Data Training', 'shopbuilder' ),
390 + 'dependency' => [
391 + 'rules' => [
392 + [
393 + 'item' => 'general.ai_implementation.ai_tools',
394 + 'value' => [ 'OpenAI', 'Gemini' ],
395 + 'operator' => 'in',
396 + ],
397 + ],
398 + ],
399 + ],
400 + 'data_training_note' => $this->get_data_training_note_field(),
401 + ],
402 + ],
403 + ),
404 + 'notification' => apply_filters(
56 405 'rtsb/settings/notification/options',
57 406 [
58 407 'id' => 'notification',
59 408 'category' => 'general',
@@ -109,9 +458,9 @@
109 458 ],
110 459 ],
111 460 ],
112 461 ),
113 - 'social_share' => apply_filters(
462 + 'social_share' => apply_filters(
114 463 'rtsb/settings/social_share/options',
115 464 [
116 465 'id' => 'social_share',
117 466 'category' => 'general',
@@ -139,25 +488,8 @@
139 488 'type' => 'switch',
140 489 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ),
141 490 'help' => esc_html__( 'Enable this option to allow share a product from product page. Woocommerce Supported Sharing plugins added to Hook: woocommerce_share', 'shopbuilder' ),
142 491 ],
143 - /*
144 - * TODO : Implement later.
145 - 'share_icon_show_to_product_page' => array(
146 - 'id' => 'share_icon_show_to_product_page',
147 - 'type' => 'switch',
148 - 'label' => esc_html__( 'Sharing Icon in Single Product Page', 'shopbuilder' ),
149 - 'dependency' => [
150 - 'rules' => [
151 - [
152 - 'item' => 'general.social_share.share_platforms_to_product_page',
153 - 'value' => 'on',
154 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
155 - ],
156 - ],
157 - ],
158 - ),
159 - */
160 492 'share_icon_layout' => [
161 493 'type' => 'select',
162 494 'value' => 'share-layout1',
163 495 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ),
@@ -177,9 +509,9 @@
177 509 ],
178 510 ],
179 511 ],
180 512 ),
181 - 'guest_user' => apply_filters(
513 + 'guest_user' => apply_filters(
182 514 'rtsb/settings/guest_user/options',
183 515 [
184 516 'id' => 'guest_user',
185 517 'category' => 'general',
@@ -189,9 +521,9 @@
189 521 'disable' => true,
190 522 ],
191 523 ],
192 524 ),
193 - 'tooltip' => apply_filters(
525 + 'tooltip' => apply_filters(
194 526 'rtsb/settings/tooltip/options',
195 527 [
196 528 'id' => 'tooltip',
197 529 'category' => 'general',
@@ -201,9 +533,9 @@
201 533 'disable' => true,
202 534 ],
203 535 ],
204 536 ),
205 - 'billing_form' => apply_filters(
537 + 'billing_form' => apply_filters(
206 538 'rtsb/settings/billing_form/options',
207 539 [
208 540 'id' => 'billing_form',
209 541 'category' => 'checkout',
@@ -209,17 +541,22 @@
209 541 'category' => 'checkout',
210 542 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ),
211 543 'package' => 'free',
212 544 'active_field' => [
213 - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ),
214 - 'help' => esc_html__( 'Switch on to Billing form settings.', 'shopbuilder' ),
545 + 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ),
546 + 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ),
215 547 ],
216 548 'fields' => [
549 + 'checkout_billing_info' => [
550 + 'id' => 'checkout_billing_info',
551 + 'type' => 'title',
552 + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ),
553 + 'customClass' => 'checkout-notice',
554 + ],
217 555 'billing_first_name_heading' => [
218 556 'id' => 'billing_first_name_heading',
219 557 'type' => 'title',
220 558 'label' => esc_html__( 'First Name', 'shopbuilder' ),
221 - // 'tab' => 'name',
222 559 ],
223 560 'billing_first_name' => [
224 561 'id' => 'billing_first_name',
225 562 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -235,9 +572,8 @@
235 572 'value' => 'required',
236 573 'label' => 'Required Field',
237 574 ],
238 575 ],
239 - // 'tab' => 'name',
240 576 ],
241 577 'billing_first_name_label' => [
242 578 'id' => 'billing_first_name_label',
243 579 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -242,15 +578,14 @@
242 578 'id' => 'billing_first_name_label',
243 579 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
244 580 'type' => 'text',
245 581 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
246 - // 'tab' => 'name',
247 582 'dependency' => [
248 583 'rules' => [
249 584 [
250 585 'item' => 'general.billing_form.billing_first_name',
251 586 'value' => 'show',
252 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
587 + 'operator' => '==',
253 588 ],
254 589 ],
255 590 ],
256 591 ],
@@ -258,15 +593,14 @@
258 593 'id' => 'billing_first_name_placeholder',
259 594 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
260 595 'type' => 'text',
261 596 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
262 - // 'tab' => 'name',
263 597 'dependency' => [
264 598 'rules' => [
265 599 [
266 600 'item' => 'general.billing_form.billing_first_name',
267 601 'value' => 'show',
268 - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
602 + 'operator' => '==',
269 603 ],
270 604 ],
271 605 ],
272 606 ],
@@ -274,9 +608,8 @@
274 608 'billing_last_name_heading' => [
275 609 'id' => 'billing_last_name_heading',
276 610 'type' => 'title',
277 611 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
278 - // 'tab' => 'name',
279 612 ],
280 613 'billing_last_name' => [
281 614 'id' => 'billing_last_name',
282 615 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -292,9 +625,8 @@
292 625 'value' => 'required',
293 626 'label' => 'Required Field',
294 627 ],
295 628 ],
296 - // 'tab' => 'name',
297 629 ],
298 630
299 631 'billing_last_name_label' => [
300 632 'id' => 'billing_last_name_label',
@@ -300,9 +632,8 @@
300 632 'id' => 'billing_last_name_label',
301 633 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
302 634 'type' => 'text',
303 635 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
304 - // 'tab' => 'name',
305 636 'dependency' => [
306 637 'rules' => [
307 638 [
308 639 'item' => 'general.billing_form.billing_last_name',
@@ -316,9 +647,8 @@
316 647 'id' => 'billing_last_name_placeholder',
317 648 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
318 649 'type' => 'text',
319 650 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
320 - // 'tab' => 'name',
321 651 'dependency' => [
322 652 'rules' => [
323 653 [
324 654 'item' => 'general.billing_form.billing_last_name',
@@ -332,9 +662,8 @@
332 662 'billing_company_heading' => [
333 663 'id' => 'billing_company_heading',
334 664 'type' => 'title',
335 665 'label' => esc_html__( 'Company', 'shopbuilder' ),
336 - // 'tab' => 'company',
337 666 ],
338 667 'billing_company' => [
339 668 'id' => 'billing_company',
340 669 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -353,9 +682,8 @@
353 682 'value' => 'required',
354 683 'label' => 'Required Field',
355 684 ],
356 685 ],
357 - // 'tab' => 'company',
358 686 ],
359 687
360 688 'billing_company_label' => [
361 689 'id' => 'billing_company_label',
@@ -361,9 +689,8 @@
361 689 'id' => 'billing_company_label',
362 690 'label' => esc_html__( 'Company label', 'shopbuilder' ),
363 691 'type' => 'text',
364 692 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
365 - // 'tab' => 'company',
366 693 'dependency' => [
367 694 'rules' => [
368 695 [
369 696 'item' => 'general.billing_form.billing_company',
@@ -377,9 +704,8 @@
377 704 'id' => 'billing_company_placeholder',
378 705 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ),
379 706 'type' => 'text',
380 707 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
381 - // 'tab' => 'company',
382 708 'dependency' => [
383 709 'rules' => [
384 710 [
385 711 'item' => 'general.billing_form.billing_company',
@@ -393,9 +719,8 @@
393 719 'billing_country_heading' => [
394 720 'id' => 'billing_country_heading',
395 721 'type' => 'title',
396 722 'label' => esc_html__( 'Country', 'shopbuilder' ),
397 - // 'tab' => 'country',
398 723 ],
399 724 'billing_country' => [
400 725 'id' => 'billing_country',
401 726 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -401,22 +726,18 @@
401 726 'label' => esc_html__( 'Country', 'shopbuilder' ),
402 727 'type' => 'checkbox',
403 728 'orientation' => 'vertical',
404 729 'value' => [ 'show', 'required' ],
405 - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ),
406 730 'options' => [
407 731 [
408 732 'value' => 'show',
409 733 'label' => 'Show Country?',
410 - // 'disabled' => true,
411 734 ],
412 735 [
413 736 'value' => 'required',
414 737 'label' => 'Required Field',
415 - // 'disabled' => true,
416 738 ],
417 739 ],
418 - // 'tab' => 'country',
419 740 ],
420 741
421 742 'billing_country_label' => [
422 743 'id' => 'billing_country_label',
@@ -422,9 +743,8 @@
422 743 'id' => 'billing_country_label',
423 744 'label' => esc_html__( 'Country label', 'shopbuilder' ),
424 745 'type' => 'text',
425 746 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
426 - // 'tab' => 'country',
427 747 'dependency' => [
428 748 'rules' => [
429 749 [
430 750 'item' => 'general.billing_form.billing_country',
@@ -437,9 +757,8 @@
437 757 'billing_address_1_heading' => [
438 758 'id' => 'billing_address_1_heading',
439 759 'type' => 'title',
440 760 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
441 - // 'tab' => 'address',
442 761 ],
443 762 'billing_address_1' => [
444 763 'id' => 'billing_address_1',
445 764 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -455,9 +774,8 @@
455 774 'value' => 'required',
456 775 'label' => 'Required Field',
457 776 ],
458 777 ],
459 - // 'tab' => 'address',
460 778 ],
461 779
462 780 'billing_address_1_label' => [
463 781 'id' => 'billing_address_1_label',
@@ -463,9 +781,8 @@
463 781 'id' => 'billing_address_1_label',
464 782 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
465 783 'type' => 'text',
466 784 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
467 - // 'tab' => 'address',
468 785 'dependency' => [
469 786 'rules' => [
470 787 [
471 788 'item' => 'general.billing_form.billing_address_1',
@@ -479,9 +796,8 @@
479 796 'id' => 'billing_address_1_placeholder',
480 797 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
481 798 'type' => 'text',
482 799 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
483 - // 'tab' => 'address',
484 800 'dependency' => [
485 801 'rules' => [
486 802 [
487 803 'item' => 'general.billing_form.billing_address_1',
@@ -494,9 +810,8 @@
494 810 'billing_address_2_heading' => [
495 811 'id' => 'billing_address_2_heading',
496 812 'type' => 'title',
497 813 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
498 - // 'tab' => 'address',
499 814 'dependency' => [
500 815 'rules' => [
501 816 [
502 817 'item' => 'general.billing_form.billing_address_1',
@@ -510,9 +825,8 @@
510 825 'id' => 'billing_address_2',
511 826 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
512 827 'type' => 'checkbox',
513 828 'orientation' => 'vertical',
514 - // 'tab' => 'address',
515 829 'value' => [
516 830 'show',
517 831 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional',
518 832 ],
@@ -538,9 +852,8 @@
538 852 'id' => 'billing_address_2_label',
539 853 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
540 854 'type' => 'text',
541 855 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
542 - // 'tab' => 'address',
543 856 'dependency' => [
544 857 'rules' => [
545 858 [
546 859 'item' => 'general.billing_form.billing_address_1',
@@ -559,9 +872,8 @@
559 872 'id' => 'billing_address_2_placeholder',
560 873 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
561 874 'type' => 'text',
562 875 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
563 - // 'tab' => 'address',
564 876 'dependency' => [
565 877 'rules' => [
566 878 [
567 879 'item' => 'general.billing_form.billing_address_1',
@@ -579,9 +891,8 @@
579 891 'billing_city_heading' => [
580 892 'id' => 'billing_city_heading',
581 893 'type' => 'title',
582 894 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
583 - // 'tab' => 'city',
584 895 ],
585 896 'billing_city' => [
586 897 'id' => 'billing_city',
587 898 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -587,9 +898,8 @@
587 898 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
588 899 'type' => 'checkbox',
589 900 'orientation' => 'vertical',
590 901 'value' => [ 'show', 'required' ],
591 - // 'tab' => 'city',
592 902 'options' => [
593 903 [
594 904 'value' => 'show',
595 905 'label' => 'Show Town / City?',
@@ -605,9 +915,8 @@
605 915 'id' => 'billing_city_label',
606 916 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
607 917 'type' => 'text',
608 918 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
609 - // 'tab' => 'city',
610 919 'dependency' => [
611 920 'rules' => [
612 921 [
613 922 'item' => 'general.billing_form.billing_city',
@@ -621,9 +930,8 @@
621 930 'id' => 'billing_city_placeholder',
622 931 'label' => esc_html__( 'City placeholder', 'shopbuilder' ),
623 932 'type' => 'text',
624 933 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
625 - // 'tab' => 'city',
626 934 'dependency' => [
627 935 'rules' => [
628 936 [
629 937 'item' => 'general.billing_form.billing_city',
@@ -636,9 +944,8 @@
636 944 'billing_state_heading' => [
637 945 'id' => 'billing_city_heading',
638 946 'type' => 'title',
639 947 'label' => esc_html__( 'State', 'shopbuilder' ),
640 - // 'tab' => 'state',
641 948 ],
642 949 'billing_state' => [
643 950 'id' => 'billing_state',
644 951 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -654,9 +961,8 @@
654 961 'value' => 'required',
655 962 'label' => 'Required Field',
656 963 ],
657 964 ],
658 - // 'tab' => 'state',
659 965 ],
660 966
661 967 'billing_state_label' => [
662 968 'id' => 'billing_state_label',
@@ -662,10 +968,8 @@
662 968 'id' => 'billing_state_label',
663 969 'label' => esc_html__( 'State label', 'shopbuilder' ),
664 970 'type' => 'text',
665 971 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
666 - // 'help' => esc_html__( 'Leave empty to set default. If the Shipping Form is enabled, the State field is mandatory.', 'shopbuilder' ),
667 - // 'tab' => 'state',
668 972 'dependency' => [
669 973 'rules' => [
670 974 [
671 975 'item' => 'general.billing_form.billing_state',
@@ -678,9 +982,8 @@
678 982 'billing_postcode_heading' => [
679 983 'id' => 'billing_postcode_heading',
680 984 'type' => 'title',
681 985 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
682 - // 'tab' => 'postcode',
683 986 ],
684 987 'billing_postcode' => [
685 988 'id' => 'billing_postcode',
686 989 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
@@ -696,9 +999,8 @@
696 999 'value' => 'required',
697 1000 'label' => 'Required Field',
698 1001 ],
699 1002 ],
700 - // 'tab' => 'postcode',
701 1003 ],
702 1004 'billing_postcode_label' => [
703 1005 'id' => 'billing_postcode_label',
704 1006 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
@@ -703,9 +1005,8 @@
703 1005 'id' => 'billing_postcode_label',
704 1006 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
705 1007 'type' => 'text',
706 1008 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
707 - // 'tab' => 'postcode',
708 1009 'dependency' => [
709 1010 'rules' => [
710 1011 [
711 1012 'item' => 'general.billing_form.billing_postcode',
@@ -719,9 +1020,8 @@
719 1020 'id' => 'billing_postcode_placeholder',
720 1021 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
721 1022 'type' => 'text',
722 1023 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
723 - // 'tab' => 'postcode',
724 1024 'dependency' => [
725 1025 'rules' => [
726 1026 [
727 1027 'item' => 'general.billing_form.billing_postcode',
@@ -734,9 +1034,8 @@
734 1034 'billing_phone_heading' => [
735 1035 'id' => 'billing_phone_heading',
736 1036 'type' => 'title',
737 1037 'label' => esc_html__( 'Phone', 'shopbuilder' ),
738 - // 'tab' => 'phone',
739 1038 ],
740 1039 'billing_phone' => [
741 1040 'id' => 'billing_phone',
742 1041 'label' => esc_html__( 'Phone', 'shopbuilder' ),
@@ -741,9 +1040,8 @@
741 1040 'id' => 'billing_phone',
742 1041 'label' => esc_html__( 'Phone', 'shopbuilder' ),
743 1042 'type' => 'checkbox',
744 1043 'orientation' => 'vertical',
745 - // 'tab' => 'phone',
746 1044 'value' => [
747 1045 'show',
748 1046 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional',
749 1047 ],
@@ -763,9 +1061,8 @@
763 1061 'id' => 'billing_phone_label',
764 1062 'label' => esc_html__( 'Phone field label', 'shopbuilder' ),
765 1063 'type' => 'text',
766 1064 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
767 - // 'tab' => 'phone',
768 1065 'dependency' => [
769 1066 'rules' => [
770 1067 [
771 1068 'item' => 'general.billing_form.billing_phone',
@@ -779,9 +1076,8 @@
779 1076 'id' => 'billing_phone_placeholder',
780 1077 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ),
781 1078 'type' => 'text',
782 1079 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
783 - // 'tab' => 'phone',
784 1080 'dependency' => [
785 1081 'rules' => [
786 1082 [
787 1083 'item' => 'general.billing_form.billing_phone',
@@ -794,9 +1090,8 @@
794 1090 'billing_email_heading' => [
795 1091 'id' => 'billing_email_heading',
796 1092 'type' => 'title',
797 1093 'label' => esc_html__( 'Email', 'shopbuilder' ),
798 - // 'tab' => 'email',
799 1094 ],
800 1095 'billing_email' => [
801 1096 'id' => 'billing_email',
802 1097 'label' => esc_html__( 'Email address', 'shopbuilder' ),
@@ -801,9 +1096,8 @@
801 1096 'id' => 'billing_email',
802 1097 'label' => esc_html__( 'Email address', 'shopbuilder' ),
803 1098 'type' => 'checkbox',
804 1099 'orientation' => 'vertical',
805 - // 'tab' => 'email',
806 1100 'value' => [ 'show', 'required' ],
807 1101 'options' => [
808 1102 [
809 1103 'value' => 'show',
@@ -819,9 +1113,8 @@
819 1113 'id' => 'billing_email_label',
820 1114 'label' => esc_html__( 'Email address field label', 'shopbuilder' ),
821 1115 'type' => 'text',
822 1116 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
823 - // 'tab' => 'email',
824 1117 'dependency' => [
825 1118 'rules' => [
826 1119 [
827 1120 'item' => 'general.billing_form.billing_email',
@@ -835,9 +1128,8 @@
835 1128 'id' => 'billing_email_placeholder',
836 1129 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ),
837 1130 'type' => 'text',
838 1131 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
839 - // 'tab' => 'email',
840 1132 'dependency' => [
841 1133 'rules' => [
842 1134 [
843 1135 'item' => 'general.billing_form.billing_email',
@@ -850,9 +1142,9 @@
850 1142 ],
851 1143
852 1144 ]
853 1145 ),
854 - 'shipping_form' => apply_filters(
1146 + 'shipping_form' => apply_filters(
855 1147 'rtsb/module/shipping_form/options',
856 1148 [
857 1149 'id' => 'shipping_form',
858 1150 'category' => 'checkout',
@@ -858,17 +1150,22 @@
858 1150 'category' => 'checkout',
859 1151 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ),
860 1152 'package' => 'free',
861 1153 'active_field' => [
862 - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ),
863 - 'help' => esc_html__( 'Switch on to Shipping form settings.', 'shopbuilder' ),
1154 + 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ),
1155 + 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ),
864 1156 ],
865 1157 'fields' => [
1158 + 'checkout_shipping_info' => [
1159 + 'id' => 'checkout_shipping_info',
1160 + 'type' => 'title',
1161 + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ),
1162 + 'customClass' => 'checkout-notice',
1163 + ],
866 1164 'shipping_first_name_heading' => [
867 1165 'id' => 'shipping_first_name_heading',
868 1166 'type' => 'title',
869 1167 'label' => esc_html__( 'First Name', 'shopbuilder' ),
870 - // 'tab' => 'name',
871 1168 ],
872 1169 'shipping_first_name' => [
873 1170 'id' => 'shipping_first_name',
874 1171 'label' => esc_html__( 'First name', 'shopbuilder' ),
@@ -884,9 +1181,8 @@
884 1181 'value' => 'required',
885 1182 'label' => 'Required Field',
886 1183 ],
887 1184 ],
888 - // 'tab' => 'name',
889 1185 ],
890 1186 'shipping_first_name_label' => [
891 1187 'id' => 'shipping_first_name_label',
892 1188 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
@@ -891,9 +1187,8 @@
891 1187 'id' => 'shipping_first_name_label',
892 1188 'label' => esc_html__( 'First name Label', 'shopbuilder' ),
893 1189 'type' => 'text',
894 1190 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
895 - // 'tab' => 'name',
896 1191 'dependency' => [
897 1192 'rules' => [
898 1193 [
899 1194 'item' => 'general.shipping_form.shipping_first_name',
@@ -907,9 +1202,8 @@
907 1202 'id' => 'shipping_first_name_placeholder',
908 1203 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ),
909 1204 'type' => 'text',
910 1205 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
911 - // 'tab' => 'country',
912 1206 'dependency' => [
913 1207 'rules' => [
914 1208 [
915 1209 'item' => 'general.shipping_form.shipping_first_name',
@@ -922,9 +1216,8 @@
922 1216 'shipping_first_last_heading' => [
923 1217 'id' => 'shipping_first_last_heading',
924 1218 'type' => 'title',
925 1219 'label' => esc_html__( 'Last Name', 'shopbuilder' ),
926 - // 'tab' => 'name',
927 1220 ],
928 1221 'shipping_last_name' => [
929 1222 'id' => 'shipping_last_name',
930 1223 'label' => esc_html__( 'Last name', 'shopbuilder' ),
@@ -940,9 +1233,8 @@
940 1233 'value' => 'required',
941 1234 'label' => 'Required Field',
942 1235 ],
943 1236 ],
944 - // 'tab' => 'name',
945 1237 ],
946 1238
947 1239 'shipping_last_name_label' => [
948 1240 'id' => 'shipping_last_name_label',
@@ -948,9 +1240,8 @@
948 1240 'id' => 'shipping_last_name_label',
949 1241 'label' => esc_html__( 'Last name label', 'shopbuilder' ),
950 1242 'type' => 'text',
951 1243 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
952 - // 'tab' => 'name',
953 1244 'dependency' => [
954 1245 'rules' => [
955 1246 [
956 1247 'item' => 'general.shipping_form.shipping_last_name',
@@ -964,9 +1255,8 @@
964 1255 'id' => 'shipping_last_name_placeholder',
965 1256 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ),
966 1257 'type' => 'text',
967 1258 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
968 - // 'tab' => 'country',
969 1259 'dependency' => [
970 1260 'rules' => [
971 1261 [
972 1262 'item' => 'general.shipping_form.shipping_last_name',
@@ -979,9 +1269,8 @@
979 1269 'shipping_company_heading' => [
980 1270 'id' => 'shipping_company_heading',
981 1271 'type' => 'title',
982 1272 'label' => esc_html__( 'Company', 'shopbuilder' ),
983 - // 'tab' => 'name',
984 1273 ],
985 1274 'shipping_company' => [
986 1275 'id' => 'shipping_company',
987 1276 'label' => esc_html__( 'Company name', 'shopbuilder' ),
@@ -997,9 +1286,8 @@
997 1286 'value' => 'required',
998 1287 'label' => 'Required Field',
999 1288 ],
1000 1289 ],
1001 - // 'tab' => 'company',
1002 1290 ],
1003 1291
1004 1292 'shipping_company_label' => [
1005 1293 'id' => 'shipping_company_label',
@@ -1005,9 +1293,8 @@
1005 1293 'id' => 'shipping_company_label',
1006 1294 'label' => esc_html__( 'Company label', 'shopbuilder' ),
1007 1295 'type' => 'text',
1008 1296 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1009 - // 'tab' => 'company',
1010 1297 'dependency' => [
1011 1298 'rules' => [
1012 1299 [
1013 1300 'item' => 'general.shipping_form.shipping_company',
@@ -1021,9 +1308,8 @@
1021 1308 'id' => 'shipping_company_placeholder',
1022 1309 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ),
1023 1310 'type' => 'text',
1024 1311 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1025 - // 'tab' => 'country',
1026 1312 'dependency' => [
1027 1313 'rules' => [
1028 1314 [
1029 1315 'item' => 'general.shipping_form.shipping_company',
@@ -1036,9 +1322,8 @@
1036 1322 'shipping_country_heading' => [
1037 1323 'id' => 'shipping_country_heading',
1038 1324 'type' => 'title',
1039 1325 'label' => esc_html__( 'Country', 'shopbuilder' ),
1040 - // 'tab' => 'name',
1041 1326 ],
1042 1327 'shipping_country' => [
1043 1328 'id' => 'shipping_country',
1044 1329 'label' => esc_html__( 'Country', 'shopbuilder' ),
@@ -1048,17 +1333,14 @@
1048 1333 'options' => [
1049 1334 [
1050 1335 'value' => 'show',
1051 1336 'label' => 'Show Country?',
1052 - // 'disabled' => true,
1053 1337 ],
1054 1338 [
1055 1339 'value' => 'required',
1056 1340 'label' => 'Required Field',
1057 - // 'disabled' => true,
1058 1341 ],
1059 1342 ],
1060 - // 'tab' => 'country',
1061 1343 ],
1062 1344
1063 1345 'shipping_country_label' => [
1064 1346 'id' => 'shipping_country_label',
@@ -1078,9 +1360,8 @@
1078 1360 'shipping_address_1_heading' => [
1079 1361 'id' => 'shipping_address_1_heading',
1080 1362 'type' => 'title',
1081 1363 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
1082 - // 'tab' => 'name',
1083 1364 ],
1084 1365 'shipping_address_1' => [
1085 1366 'id' => 'shipping_address_1',
1086 1367 'label' => esc_html__( 'Address 1', 'shopbuilder' ),
@@ -1096,9 +1377,8 @@
1096 1377 'value' => 'required',
1097 1378 'label' => 'Required Field',
1098 1379 ],
1099 1380 ],
1100 - // 'tab' => 'country',
1101 1381 ],
1102 1382
1103 1383 'shipping_address_1_label' => [
1104 1384 'id' => 'shipping_address_1_label',
@@ -1104,9 +1384,8 @@
1104 1384 'id' => 'shipping_address_1_label',
1105 1385 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ),
1106 1386 'type' => 'text',
1107 1387 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1108 - // 'tab' => 'country',
1109 1388 'dependency' => [
1110 1389 'rules' => [
1111 1390 [
1112 1391 'item' => 'general.shipping_form.shipping_address_1',
@@ -1120,9 +1399,8 @@
1120 1399 'id' => 'shipping_address_1_placeholder',
1121 1400 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ),
1122 1401 'type' => 'text',
1123 1402 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1124 - // 'tab' => 'country',
1125 1403 'dependency' => [
1126 1404 'rules' => [
1127 1405 [
1128 1406 'item' => 'general.shipping_form.shipping_address_1',
@@ -1135,9 +1413,8 @@
1135 1413 'shipping_address_2_heading' => [
1136 1414 'id' => 'shipping_address_2_heading',
1137 1415 'type' => 'title',
1138 1416 'label' => esc_html__( 'Address 2', 'shopbuilder' ),
1139 - // 'tab' => 'name',
1140 1417 'dependency' => [
1141 1418 'rules' => [
1142 1419 [
1143 1420 'item' => 'general.shipping_form.shipping_address_1',
@@ -1159,9 +1436,8 @@
1159 1436 'label' => 'Show Address field?',
1160 1437 ],
1161 1438 ],
1162 1439 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ),
1163 - // 'tab' => 'country',
1164 1440 'dependency' => [
1165 1441 'rules' => [
1166 1442 [
1167 1443 'item' => 'general.shipping_form.shipping_address_1',
@@ -1176,9 +1452,8 @@
1176 1452 'id' => 'shipping_address_2_label',
1177 1453 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ),
1178 1454 'type' => 'text',
1179 1455 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1180 - // 'tab' => 'country',
1181 1456 'dependency' => [
1182 1457 'rules' => [
1183 1458 [
1184 1459 'item' => 'general.shipping_form.shipping_address_1',
@@ -1197,9 +1472,8 @@
1197 1472 'id' => 'shipping_address_2_placeholder',
1198 1473 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ),
1199 1474 'type' => 'text',
1200 1475 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1201 - // 'tab' => 'country',
1202 1476 'dependency' => [
1203 1477 'rules' => [
1204 1478 [
1205 1479 'item' => 'general.shipping_form.shipping_address_1',
@@ -1217,9 +1491,8 @@
1217 1491 'shipping_city_heading' => [
1218 1492 'id' => 'shipping_city_heading',
1219 1493 'type' => 'title',
1220 1494 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
1221 - // 'tab' => 'name',
1222 1495 ],
1223 1496 'shipping_city' => [
1224 1497 'id' => 'shipping_city',
1225 1498 'label' => esc_html__( 'Town / City', 'shopbuilder' ),
@@ -1235,9 +1508,8 @@
1235 1508 'value' => 'required',
1236 1509 'label' => 'Required Field',
1237 1510 ],
1238 1511 ],
1239 - // 'tab' => 'country',
1240 1512 ],
1241 1513 'shipping_city_label' => [
1242 1514 'id' => 'shipping_city_label',
1243 1515 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
@@ -1242,9 +1514,8 @@
1242 1514 'id' => 'shipping_city_label',
1243 1515 'label' => esc_html__( 'Town / City label', 'shopbuilder' ),
1244 1516 'type' => 'text',
1245 1517 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1246 - // 'tab' => 'country',
1247 1518 'dependency' => [
1248 1519 'rules' => [
1249 1520 [
1250 1521 'item' => 'general.shipping_form.shipping_city',
@@ -1258,9 +1529,8 @@
1258 1529 'id' => 'shipping_city_placeholder',
1259 1530 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ),
1260 1531 'type' => 'text',
1261 1532 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1262 - // 'tab' => 'country',
1263 1533 'dependency' => [
1264 1534 'rules' => [
1265 1535 [
1266 1536 'item' => 'general.shipping_form.shipping_city',
@@ -1273,9 +1543,8 @@
1273 1543 'shipping_state_heading' => [
1274 1544 'id' => 'shipping_state_heading',
1275 1545 'type' => 'title',
1276 1546 'label' => esc_html__( 'Others', 'shopbuilder' ),
1277 - // 'tab' => 'name',
1278 1547 ],
1279 1548 'shipping_state' => [
1280 1549 'id' => 'shipping_state',
1281 1550 'label' => esc_html__( 'State', 'shopbuilder' ),
@@ -1291,33 +1560,9 @@
1291 1560 'value' => 'required',
1292 1561 'label' => 'Required Field',
1293 1562 ],
1294 1563 ],
1295 - // 'tab' => 'country',
1296 1564 ],
1297 - //
1298 - // 'shipping_state_label' => [
1299 - // 'id' => 'shipping_state_label',
1300 - // 'label' => esc_html__( 'State label', 'shopbuilder' ),
1301 - // 'type' => 'text',
1302 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1303 - // 'tab' => 'country',
1304 - // 'dependency' => [
1305 - // 'rules' => [
1306 - // [
1307 - // 'item' => 'general.shipping_form.shipping_state',
1308 - // 'value' => 'show',
1309 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1310 - // ],
1311 - // ],
1312 - // ],
1313 - // ],
1314 - // 'shipping_postcode_heading' => [
1315 - // 'id' => 'shipping_postcode_heading',
1316 - // 'type' => 'title',
1317 - // 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1318 - // 'tab' => 'name',
1319 - // ],
1320 1565 'shipping_postcode' => [
1321 1566 'id' => 'shipping_postcode',
1322 1567 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ),
1323 1568 'type' => 'checkbox',
@@ -1328,47 +1573,69 @@
1328 1573 'value' => 'show',
1329 1574 'label' => 'Show Postcode / ZIP?',
1330 1575 ],
1331 1576 ],
1332 - // 'tab' => 'country',
1333 1577 ],
1334 - // 'shipping_postcode_label' => [
1335 - // 'id' => 'shipping_postcode_label',
1336 - // 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ),
1337 - // 'type' => 'text',
1338 - // 'help' => esc_html__( 'Leave empty to set default. ', 'shopbuilder' ),
1339 - // 'tab' => 'country',
1340 - // 'dependency' => [
1341 - // 'rules' => [
1342 - // [
1343 - // 'item' => 'general.shipping_form.shipping_postcode',
1344 - // 'value' => 'show',
1345 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1346 - // ],
1347 - // ],
1348 - // ],
1349 - // ],
1350 - // 'shipping_postcode_placeholder' => [
1351 - // 'id' => 'shipping_postcode_placeholder',
1352 - // 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ),
1353 - // 'type' => 'text',
1354 - // 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ),
1355 - // 'tab' => 'country',
1356 - // 'dependency' => [
1357 - // 'rules' => [
1358 - // [
1359 - // 'item' => 'general.shipping_form.shipping_postcode',
1360 - // 'value' => 'show',
1361 - // 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value //
1362 - // ],
1363 - // ],
1364 - // ],
1365 - // ],
1366 1578
1367 1579 ],
1368 1580 ]
1369 1581 ),
1582 +
1370 1583 ];
1371 1584
1585 + if ( ! defined( 'ELEMENTOR_VERSION' ) ) {
1586 + unset( $list['optimization']['fields']['load_elementor_scripts'] );
1587 + }
1372 1588 return apply_filters( 'rtsb/core/general_settings/raw_list', $list );
1589 + }
1590 +
1591 +
1592 + /**
1593 + * Get the Data Training Note field.
1594 + *
1595 + * @return array
1596 + */
1597 + public function get_data_training_note_field(): array {
1598 + $progress = get_option(
1599 + 'rtsb_embedding_progress',
1600 + [
1601 + 'processed' => 0,
1602 + 'total' => 0,
1603 + ]
1604 + );
1605 + $total = (int) $progress['total'];
1606 + $processed = (int) $progress['processed'];
1607 + $remaining = max( $total - $processed, 0 );
1608 + // Build the correct text based on embedding progress.
1609 + if ( $remaining > 0 ) {
1610 + $generate_url = add_query_arg(
1611 + [
1612 + rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ),
1613 + 'action' => 'rtsb_start_embedding_process',
1614 + ],
1615 + admin_url( 'admin.php?page=rtsb-settings' )
1616 + );
1617 + $text = sprintf(
1618 + '%1$s <a class="rtsb-generate-embedding" href="%2$s">%3$s</a>',
1619 + esc_html__( 'Compatible your existing products with semantic search process.', 'shopbuilder' ),
1620 + esc_url( $generate_url ),
1621 + esc_html__( 'Generate Embeddings', 'shopbuilder' )
1622 + );
1623 + } else {
1624 + $text = esc_html__( '🎉 Congratulations! All your products are successfully embedded and up to date.', 'shopbuilder' );
1625 + }
1626 + return [
1627 + 'id' => 'data_training_note',
1628 + 'type' => 'description',
1629 + 'text' => $text,
1630 + 'dependency' => [
1631 + 'rules' => [
1632 + [
1633 + 'item' => 'general.ai_implementation.ai_tools',
1634 + 'value' => [ 'OpenAI', 'Gemini' ],
1635 + 'operator' => 'in',
1636 + ],
1637 + ],
1638 + ],
1639 + ];
1373 1640 }
1374 1641 }