| @@ -1,11 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace RadiusTheme\SB\Models; |
| 4 | 4 | |
| 5 | -use RadiusTheme\SB\AI\AIFns; | |
| 6 | 5 | use RadiusTheme\SB\Helpers\Fns; |
| 7 | -use RadiusTheme\SB\Helpers\SvgIcons; | |
| 8 | 6 | use RadiusTheme\SB\Models\Base\ListModel; |
| 9 | 7 | use RadiusTheme\SB\Traits\SingletonTrait; |
| 10 | 8 | |
| 11 | 9 | defined( 'ABSPATH' ) || exit; |
| @@ -51,21 +49,16 @@ | ||
| 51 | 49 | * @return array |
| 52 | 50 | */ |
| 53 | 51 | protected function raw_list() { |
| 54 | 52 | $list = [ |
| 55 | - 'optimization' => apply_filters( | |
| 53 | + 'optimization' => apply_filters( | |
| 56 | 54 | 'rtsb/settings/optimization/options', |
| 57 | 55 | [ |
| 58 | 56 | 'id' => 'optimization', |
| 59 | - 'icon' => SvgIcons::get( 'optimization' ), | |
| 60 | 57 | 'category' => 'general', |
| 61 | 58 | 'title' => esc_html__( 'Advanced Optimizations', 'shopbuilder' ), |
| 62 | 59 | 'package' => $this->pro_version_checker(), |
| 63 | 60 | 'badge' => 'new', |
| 64 | - 'links' => [ | |
| 65 | - 'doc' => '', | |
| 66 | - 'video' => '', | |
| 67 | - ], | |
| 68 | 61 | 'active_field' => [ |
| 69 | 62 | 'disable' => true, |
| 70 | 63 | ], |
| 71 | 64 | 'fields' => [ |
| @@ -71,16 +64,15 @@ | ||
| 71 | 64 | 'fields' => [ |
| 72 | 65 | 'optimization_intro' => [ |
| 73 | 66 | 'id' => 'optimization_intro', |
| 74 | 67 | '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' ), | |
| 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' ), | |
| 76 | 69 | ], |
| 77 | 70 | 'enable_optimization' => [ |
| 78 | 71 | 'id' => 'enable', |
| 79 | 72 | 'type' => 'switch', |
| 80 | - 'value' => 'on', | |
| 81 | 73 | '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' ), | |
| 74 | + 'help' => esc_html__( 'Enable this option to dynamically load assets (styles, scripts) only when needed, helping to optimize your website’s performance', 'shopbuilder' ), | |
| 83 | 75 | ], |
| 84 | 76 | 'load_elementor_scripts' => [ |
| 85 | 77 | 'id' => 'enable', |
| 86 | 78 | 'type' => 'switch', |
| @@ -135,319 +127,15 @@ | ||
| 135 | 127 | */ |
| 136 | 128 | ], |
| 137 | 129 | ], |
| 138 | 130 | ), |
| 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( | |
| 131 | + 'notification' => apply_filters( | |
| 439 | 132 | 'rtsb/settings/notification/options', |
| 440 | 133 | [ |
| 441 | 134 | 'id' => 'notification', |
| 442 | - 'icon' => SvgIcons::get( 'notification' ), | |
| 443 | 135 | 'category' => 'general', |
| 444 | 136 | 'title' => esc_html__( 'Notification Settings', 'shopbuilder' ), |
| 445 | 137 | 'package' => 'free', |
| 446 | - 'links' => [ | |
| 447 | - 'doc' => '', | |
| 448 | - 'video' => '', | |
| 449 | - ], | |
| 450 | 138 | 'active_field' => [ |
| 451 | 139 | 'disable' => true, |
| 452 | 140 | ], |
| 453 | 141 | 'fields' => [ |
| @@ -470,21 +158,8 @@ | ||
| 470 | 158 | 'top-center' => esc_html__( 'Top center', 'shopbuilder' ), |
| 471 | 159 | 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ), |
| 472 | 160 | ], |
| 473 | 161 | ], |
| 474 | - 'notification_timeOut' => [ | |
| 475 | - 'id' => 'notification_timeOut', | |
| 476 | - 'label' => esc_html__( 'Notification Time-Out (in seconds)', 'shopbuilder' ), | |
| 477 | - 'type' => 'number', | |
| 478 | - 'help' => esc_html__( | |
| 479 | - 'Duration (in seconds) before the notification hides automatically.', | |
| 480 | - 'shopbuilder' | |
| 481 | - ), | |
| 482 | - 'min' => 1, | |
| 483 | - 'max' => 20, | |
| 484 | - 'value' => 5, | |
| 485 | - 'placeholder' => esc_html__( '3', 'shopbuilder' ), | |
| 486 | - ], | |
| 487 | 162 | 'notification_color' => [ |
| 488 | 163 | 'id' => 'notification_color', |
| 489 | 164 | 'label' => esc_html__( 'Text Color', 'shopbuilder' ), |
| 490 | 165 | 'type' => 'color', |
| @@ -510,20 +185,15 @@ | ||
| 510 | 185 | ], |
| 511 | 186 | ], |
| 512 | 187 | ], |
| 513 | 188 | ), |
| 514 | - 'social_share' => apply_filters( | |
| 189 | + 'social_share' => apply_filters( | |
| 515 | 190 | 'rtsb/settings/social_share/options', |
| 516 | 191 | [ |
| 517 | 192 | 'id' => 'social_share', |
| 518 | - 'icon' => SvgIcons::get( 'social_share' ), | |
| 519 | 193 | 'category' => 'general', |
| 520 | 194 | 'title' => esc_html__( 'Social Share Settings', 'shopbuilder' ), |
| 521 | 195 | 'package' => 'free', |
| 522 | - 'links' => [ | |
| 523 | - 'doc' => '', | |
| 524 | - 'video' => '', | |
| 525 | - ], | |
| 526 | 196 | 'active_field' => [ |
| 527 | 197 | 'disable' => true, |
| 528 | 198 | ], |
| 529 | 199 | 'fields' => [ |
| @@ -566,54 +236,39 @@ | ||
| 566 | 236 | ], |
| 567 | 237 | ], |
| 568 | 238 | ], |
| 569 | 239 | ), |
| 570 | - 'guest_user' => apply_filters( | |
| 240 | + 'guest_user' => apply_filters( | |
| 571 | 241 | 'rtsb/settings/guest_user/options', |
| 572 | 242 | [ |
| 573 | 243 | 'id' => 'guest_user', |
| 574 | - 'icon' => SvgIcons::get( 'guest_user' ), | |
| 575 | 244 | 'category' => 'general', |
| 576 | 245 | 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ), |
| 577 | 246 | 'package' => $this->pro_package(), |
| 578 | - 'links' => [ | |
| 579 | - 'doc' => '', | |
| 580 | - 'video' => '', | |
| 581 | - ], | |
| 582 | 247 | 'active_field' => [ |
| 583 | 248 | 'disable' => true, |
| 584 | 249 | ], |
| 585 | 250 | ], |
| 586 | 251 | ), |
| 587 | - 'tooltip' => apply_filters( | |
| 252 | + 'tooltip' => apply_filters( | |
| 588 | 253 | 'rtsb/settings/tooltip/options', |
| 589 | 254 | [ |
| 590 | 255 | 'id' => 'tooltip', |
| 591 | - 'icon' => SvgIcons::get( 'tooltip' ), | |
| 592 | 256 | 'category' => 'general', |
| 593 | 257 | 'title' => esc_html__( 'Tooltip Settings', 'shopbuilder' ), |
| 594 | 258 | 'package' => $this->pro_package(), |
| 595 | - 'links' => [ | |
| 596 | - 'doc' => '', | |
| 597 | - 'video' => '', | |
| 598 | - ], | |
| 599 | 259 | 'active_field' => [ |
| 600 | 260 | 'disable' => true, |
| 601 | 261 | ], |
| 602 | 262 | ], |
| 603 | 263 | ), |
| 604 | - 'billing_form' => apply_filters( | |
| 264 | + 'billing_form' => apply_filters( | |
| 605 | 265 | 'rtsb/settings/billing_form/options', |
| 606 | 266 | [ |
| 607 | 267 | 'id' => 'billing_form', |
| 608 | - 'icon' => SvgIcons::get( 'billing_form' ), | |
| 609 | 268 | 'category' => 'checkout', |
| 610 | 269 | 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ), |
| 611 | 270 | 'package' => 'free', |
| 612 | - 'links' => [ | |
| 613 | - 'doc' => '', | |
| 614 | - 'video' => '', | |
| 615 | - ], | |
| 616 | 271 | 'active_field' => [ |
| 617 | 272 | 'label' => esc_html__( 'Customize Billing Form Fields?', 'shopbuilder' ), |
| 618 | 273 | 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ), |
| 619 | 274 | ], |
| @@ -618,13 +273,12 @@ | ||
| 618 | 273 | 'help' => esc_html__( 'Switch on to customize billing form fields.', 'shopbuilder' ), |
| 619 | 274 | ], |
| 620 | 275 | 'fields' => [ |
| 621 | 276 | '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, | |
| 277 | + 'id' => 'checkout_billing_info', | |
| 278 | + 'type' => 'title', | |
| 279 | + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ), | |
| 280 | + 'customClass' => 'checkout-notice', | |
| 627 | 281 | ], |
| 628 | 282 | 'billing_first_name_heading' => [ |
| 629 | 283 | 'id' => 'billing_first_name_heading', |
| 630 | 284 | 'type' => 'title', |
| @@ -1215,20 +869,15 @@ | ||
| 1215 | 869 | ], |
| 1216 | 870 | |
| 1217 | 871 | ] |
| 1218 | 872 | ), |
| 1219 | - 'shipping_form' => apply_filters( | |
| 873 | + 'shipping_form' => apply_filters( | |
| 1220 | 874 | 'rtsb/module/shipping_form/options', |
| 1221 | 875 | [ |
| 1222 | 876 | 'id' => 'shipping_form', |
| 1223 | - 'icon' => SvgIcons::get( 'shipping_form' ), | |
| 1224 | 877 | 'category' => 'checkout', |
| 1225 | 878 | 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ), |
| 1226 | 879 | 'package' => 'free', |
| 1227 | - 'links' => [ | |
| 1228 | - 'doc' => '', | |
| 1229 | - 'video' => '', | |
| 1230 | - ], | |
| 1231 | 880 | 'active_field' => [ |
| 1232 | 881 | 'label' => esc_html__( 'Customize Shipping form Fields?', 'shopbuilder' ), |
| 1233 | 882 | 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ), |
| 1234 | 883 | ], |
| @@ -1233,13 +882,12 @@ | ||
| 1233 | 882 | 'help' => esc_html__( 'Switch on to customize shipping form fields.', 'shopbuilder' ), |
| 1234 | 883 | ], |
| 1235 | 884 | 'fields' => [ |
| 1236 | 885 | '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, | |
| 886 | + 'id' => 'checkout_shipping_info', | |
| 887 | + 'type' => 'title', | |
| 888 | + 'label' => __( 'The below form fields customization will be disabled when the <strong><u>Checkout Fields Editor</u></strong> module is activated.', 'shopbuilder' ), | |
| 889 | + 'customClass' => 'checkout-notice', | |
| 1242 | 890 | ], |
| 1243 | 891 | 'shipping_first_name_heading' => [ |
| 1244 | 892 | 'id' => 'shipping_first_name_heading', |
| 1245 | 893 | 'type' => 'title', |
| @@ -1657,128 +1305,13 @@ | ||
| 1657 | 1305 | |
| 1658 | 1306 | ], |
| 1659 | 1307 | ] |
| 1660 | 1308 | ), |
| 1661 | - | |
| 1662 | 1309 | ]; |
| 1663 | 1310 | |
| 1664 | 1311 | if ( ! defined( 'ELEMENTOR_VERSION' ) ) { |
| 1665 | 1312 | unset( $list['optimization']['fields']['load_elementor_scripts'] ); |
| 1666 | 1313 | } |
| 1314 | + | |
| 1667 | 1315 | return apply_filters( 'rtsb/core/general_settings/raw_list', $list ); |
| 1668 | - } | |
| 1669 | - | |
| 1670 | - /** | |
| 1671 | - * Get the Data Training Note field. | |
| 1672 | - * | |
| 1673 | - * @param string $tool Meta values. | |
| 1674 | - * @return array | |
| 1675 | - */ | |
| 1676 | - public function get_data_training_note_field( $tool ): array { | |
| 1677 | - $progress = get_option( 'rtsb_embedding_progress', [ 'processed' => 0 ] ); | |
| 1678 | - $total = AIFns::need_product_embedding(); | |
| 1679 | - $processed = (int) $progress['processed']; | |
| 1680 | - $remaining = max( $total - $processed, 0 ); | |
| 1681 | - $generate_url = add_query_arg( | |
| 1682 | - [ | |
| 1683 | - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 1684 | - 'action' => 'rtsb_start_embedding_process', | |
| 1685 | - ], | |
| 1686 | - admin_url( 'admin.php?page=rtsb-settings' ) | |
| 1687 | - ); | |
| 1688 | - | |
| 1689 | - if ( wp_next_scheduled( 'rtsb_embedding_cron_run' ) ) { | |
| 1690 | - $text = esc_html__( 'Processing embeddings in the background. You can continue using the site.', 'shopbuilder' ); | |
| 1691 | - } else { | |
| 1692 | - if ( $remaining > 0 ) { | |
| 1693 | - // Build the correct text based on embedding progress. | |
| 1694 | - $text = sprintf( | |
| 1695 | - '%1$s <a class="rtsb-generate-embedding" href="%2$s">%3$s</a>', | |
| 1696 | - esc_html__( 'Make Compatible your existing products with semantic search process.', 'shopbuilder' ), | |
| 1697 | - esc_url( $generate_url ), | |
| 1698 | - esc_html__( 'Generate Embeddings', 'shopbuilder' ) | |
| 1699 | - ); | |
| 1700 | - } else { | |
| 1701 | - $text = esc_html__( '🎉 Congratulations! All your products are successfully embedded and up to date.', 'shopbuilder' ); | |
| 1702 | - } | |
| 1703 | - } | |
| 1704 | - $note = [ | |
| 1705 | - 'OpenAI' => [ | |
| 1706 | - 'id' => 'data_training_note_openai', | |
| 1707 | - 'type' => 'description', | |
| 1708 | - 'text' => $text, | |
| 1709 | - 'dependency' => [ | |
| 1710 | - 'rules' => [ | |
| 1711 | - [ | |
| 1712 | - 'item' => 'general.ai_implementation.ai_tools', | |
| 1713 | - 'value' => 'OpenAI', | |
| 1714 | - 'operator' => '==', | |
| 1715 | - ], | |
| 1716 | - [ | |
| 1717 | - 'item' => 'general.ai_implementation.gpt_api_key', | |
| 1718 | - 'value' => '', | |
| 1719 | - 'operator' => '!=', | |
| 1720 | - ], | |
| 1721 | - ], | |
| 1722 | - ], | |
| 1723 | - ], | |
| 1724 | - 'Gemini' => [ | |
| 1725 | - 'id' => 'data_training_note_gemini', | |
| 1726 | - 'type' => 'description', | |
| 1727 | - 'text' => $text, | |
| 1728 | - 'dependency' => [ | |
| 1729 | - 'rules' => [ | |
| 1730 | - [ | |
| 1731 | - 'item' => 'general.ai_implementation.ai_tools', | |
| 1732 | - 'value' => 'Gemini', | |
| 1733 | - 'operator' => '==', | |
| 1734 | - ], | |
| 1735 | - [ | |
| 1736 | - 'item' => 'general.ai_implementation.gemini_api_key', | |
| 1737 | - 'value' => '', | |
| 1738 | - 'operator' => '!=', | |
| 1739 | - ], | |
| 1740 | - ], | |
| 1741 | - ], | |
| 1742 | - ], | |
| 1743 | - 'missingGeminiKey' => [ | |
| 1744 | - 'id' => 'data_training_note_missing_gemneni_key', | |
| 1745 | - 'type' => 'description', | |
| 1746 | - 'text' => esc_html__( 'Missing Gemini API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ), | |
| 1747 | - 'dependency' => [ | |
| 1748 | - 'rules' => [ | |
| 1749 | - [ | |
| 1750 | - 'item' => 'general.ai_implementation.ai_tools', | |
| 1751 | - 'value' => 'Gemini', | |
| 1752 | - 'operator' => '==', | |
| 1753 | - ], | |
| 1754 | - [ | |
| 1755 | - 'item' => 'general.ai_implementation.gemini_api_key', | |
| 1756 | - 'value' => '', | |
| 1757 | - 'operator' => '==', | |
| 1758 | - ], | |
| 1759 | - ], | |
| 1760 | - ], | |
| 1761 | - ], | |
| 1762 | - 'missingOpenAIKey' => [ | |
| 1763 | - 'id' => 'data_training_note_missing_openai_key', | |
| 1764 | - 'type' => 'description', | |
| 1765 | - 'text' => esc_html__( 'Missing OpenAI API key. Enter and save your API key to turn on the data training feature.', 'shopbuilder' ), | |
| 1766 | - 'dependency' => [ | |
| 1767 | - 'rules' => [ | |
| 1768 | - [ | |
| 1769 | - 'item' => 'general.ai_implementation.ai_tools', | |
| 1770 | - 'value' => 'OpenAI', | |
| 1771 | - 'operator' => '==', | |
| 1772 | - ], | |
| 1773 | - [ | |
| 1774 | - 'item' => 'general.ai_implementation.gpt_api_key', | |
| 1775 | - 'value' => '', | |
| 1776 | - 'operator' => '==', | |
| 1777 | - ], | |
| 1778 | - ], | |
| 1779 | - ], | |
| 1780 | - ], | |
| 1781 | - ]; | |
| 1782 | - return $note[ $tool ] ?? []; | |
| 1783 | 1316 | } |
| 1784 | 1317 | } |