| @@ -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', |
| @@ -62,8 +411,13 @@ | ||
| 62 | 411 | 'active_field' => [ |
| 63 | 412 | 'disable' => true, |
| 64 | 413 | ], |
| 65 | 414 | 'fields' => [ |
| 415 | + 'notification_intro' => [ | |
| 416 | + 'id' => 'notification_intro', | |
| 417 | + 'type' => 'description', | |
| 418 | + 'text' => esc_html__( 'Customize notifications for user actions such as adding items to cart, adding to wishlist, or comparing products.', 'shopbuilder' ), | |
| 419 | + ], | |
| 66 | 420 | 'notification_position' => [ |
| 67 | 421 | 'id' => 'notification_position', |
| 68 | 422 | 'value' => 'center-center', |
| 69 | 423 | 'type' => 'select', |
| @@ -68,17 +422,15 @@ | ||
| 68 | 422 | 'value' => 'center-center', |
| 69 | 423 | 'type' => 'select', |
| 70 | 424 | 'label' => esc_html__( 'Notification Position', 'shopbuilder' ), |
| 71 | 425 | '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' ), | |
| 426 | + 'center-center' => esc_html__( 'Center Center', 'shopbuilder' ), | |
| 427 | + 'top-right' => esc_html__( 'Top Right', 'shopbuilder' ), | |
| 428 | + 'bottom-right' => esc_html__( 'Bottom Right', 'shopbuilder' ), | |
| 429 | + 'bottom-left' => esc_html__( 'Bottom Left', 'shopbuilder' ), | |
| 430 | + 'top-left' => esc_html__( 'Top Left', 'shopbuilder' ), | |
| 431 | + 'top-center' => esc_html__( 'Top center', 'shopbuilder' ), | |
| 432 | + 'bottom-center' => esc_html__( 'Bottom center', 'shopbuilder' ), | |
| 81 | 433 | ], |
| 82 | 434 | ], |
| 83 | 435 | 'notification_color' => [ |
| 84 | 436 | 'id' => 'notification_color', |
| @@ -97,13 +449,18 @@ | ||
| 97 | 449 | 'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 98 | 450 | 'type' => 'color', |
| 99 | 451 | 'tab' => 'floating_button', |
| 100 | 452 | ], |
| 101 | - | |
| 453 | + 'hide_notification' => [ | |
| 454 | + 'id' => 'hide_notification', | |
| 455 | + 'type' => 'switch', | |
| 456 | + 'label' => esc_html__( 'Hide Notifications', 'shopbuilder' ), | |
| 457 | + 'help' => esc_html__( 'Enable this option if you don\'t want the notifications to show.', 'shopbuilder' ), | |
| 458 | + ], | |
| 102 | 459 | ], |
| 103 | 460 | ], |
| 104 | 461 | ), |
| 105 | - 'social_share' => apply_filters( | |
| 462 | + 'social_share' => apply_filters( | |
| 106 | 463 | 'rtsb/settings/social_share/options', |
| 107 | 464 | [ |
| 108 | 465 | 'id' => 'social_share', |
| 109 | 466 | 'category' => 'general', |
| @@ -112,8 +469,13 @@ | ||
| 112 | 469 | 'active_field' => [ |
| 113 | 470 | 'disable' => true, |
| 114 | 471 | ], |
| 115 | 472 | 'fields' => [ |
| 473 | + 'social_share_intro' => [ | |
| 474 | + 'id' => 'social_share_intro', | |
| 475 | + 'type' => 'description', | |
| 476 | + 'text' => esc_html__( 'Configure social sharing platforms for products sharing.', 'shopbuilder' ), | |
| 477 | + ], | |
| 116 | 478 | 'share_platforms' => [ |
| 117 | 479 | 'id' => 'share_platforms', |
| 118 | 480 | 'label' => esc_html__( 'Select Social Sharing Platforms', 'shopbuilder' ), |
| 119 | 481 | 'type' => 'checkbox', |
| @@ -126,25 +488,8 @@ | ||
| 126 | 488 | 'type' => 'switch', |
| 127 | 489 | 'label' => esc_html__( 'Sharing Button in Single Product Page', 'shopbuilder' ), |
| 128 | 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' ), |
| 129 | 491 | ], |
| 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 | 492 | 'share_icon_layout' => [ |
| 148 | 493 | 'type' => 'select', |
| 149 | 494 | 'value' => 'share-layout1', |
| 150 | 495 | 'label' => esc_html__( 'Share Button Layout', 'shopbuilder' ), |
| @@ -164,9 +509,21 @@ | ||
| 164 | 509 | ], |
| 165 | 510 | ], |
| 166 | 511 | ], |
| 167 | 512 | ), |
| 168 | - 'tooltip' => apply_filters( | |
| 513 | + 'guest_user' => apply_filters( | |
| 514 | + 'rtsb/settings/guest_user/options', | |
| 515 | + [ | |
| 516 | + 'id' => 'guest_user', | |
| 517 | + 'category' => 'general', | |
| 518 | + 'title' => esc_html__( 'Guest User Controls', 'shopbuilder' ), | |
| 519 | + 'package' => $this->pro_package(), | |
| 520 | + 'active_field' => [ | |
| 521 | + 'disable' => true, | |
| 522 | + ], | |
| 523 | + ], | |
| 524 | + ), | |
| 525 | + 'tooltip' => apply_filters( | |
| 169 | 526 | 'rtsb/settings/tooltip/options', |
| 170 | 527 | [ |
| 171 | 528 | 'id' => 'tooltip', |
| 172 | 529 | 'category' => 'general', |
| @@ -176,9 +533,9 @@ | ||
| 176 | 533 | 'disable' => true, |
| 177 | 534 | ], |
| 178 | 535 | ], |
| 179 | 536 | ), |
| 180 | - 'billing_form' => apply_filters( | |
| 537 | + 'billing_form' => apply_filters( | |
| 181 | 538 | 'rtsb/settings/billing_form/options', |
| 182 | 539 | [ |
| 183 | 540 | 'id' => 'billing_form', |
| 184 | 541 | 'category' => 'checkout', |
| @@ -184,17 +541,22 @@ | ||
| 184 | 541 | 'category' => 'checkout', |
| 185 | 542 | 'title' => esc_html__( 'Billing Form Settings', 'shopbuilder' ), |
| 186 | 543 | 'package' => 'free', |
| 187 | 544 | 'active_field' => [ |
| 188 | - 'label' => esc_html__( 'Enable Billing form settings?', 'shopbuilder' ), | |
| 189 | - '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' ), | |
| 190 | 547 | ], |
| 191 | 548 | 'fields' => [ |
| 192 | - 'billing_first_name_heading' => [ | |
| 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 | + ], | |
| 555 | + 'billing_first_name_heading' => [ | |
| 193 | 556 | 'id' => 'billing_first_name_heading', |
| 194 | 557 | 'type' => 'title', |
| 195 | 558 | 'label' => esc_html__( 'First Name', 'shopbuilder' ), |
| 196 | - // 'tab' => 'name', | |
| 197 | 559 | ], |
| 198 | 560 | 'billing_first_name' => [ |
| 199 | 561 | 'id' => 'billing_first_name', |
| 200 | 562 | 'label' => esc_html__( 'First name', 'shopbuilder' ), |
| @@ -210,9 +572,8 @@ | ||
| 210 | 572 | 'value' => 'required', |
| 211 | 573 | 'label' => 'Required Field', |
| 212 | 574 | ], |
| 213 | 575 | ], |
| 214 | - // 'tab' => 'name', | |
| 215 | 576 | ], |
| 216 | 577 | 'billing_first_name_label' => [ |
| 217 | 578 | 'id' => 'billing_first_name_label', |
| 218 | 579 | 'label' => esc_html__( 'First name Label', 'shopbuilder' ), |
| @@ -217,15 +578,14 @@ | ||
| 217 | 578 | 'id' => 'billing_first_name_label', |
| 218 | 579 | 'label' => esc_html__( 'First name Label', 'shopbuilder' ), |
| 219 | 580 | 'type' => 'text', |
| 220 | 581 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 221 | - // 'tab' => 'name', | |
| 222 | 582 | 'dependency' => [ |
| 223 | 583 | 'rules' => [ |
| 224 | 584 | [ |
| 225 | 585 | 'item' => 'general.billing_form.billing_first_name', |
| 226 | 586 | 'value' => 'show', |
| 227 | - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value // | |
| 587 | + 'operator' => '==', | |
| 228 | 588 | ], |
| 229 | 589 | ], |
| 230 | 590 | ], |
| 231 | 591 | ], |
| @@ -233,25 +593,23 @@ | ||
| 233 | 593 | 'id' => 'billing_first_name_placeholder', |
| 234 | 594 | 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ), |
| 235 | 595 | 'type' => 'text', |
| 236 | 596 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 237 | - // 'tab' => 'name', | |
| 238 | 597 | 'dependency' => [ |
| 239 | 598 | 'rules' => [ |
| 240 | 599 | [ |
| 241 | 600 | 'item' => 'general.billing_form.billing_first_name', |
| 242 | 601 | 'value' => 'show', |
| 243 | - 'operator' => '==', // 'operator' => 'any','in', !in' only valid for multiple value // | |
| 602 | + 'operator' => '==', | |
| 244 | 603 | ], |
| 245 | 604 | ], |
| 246 | 605 | ], |
| 247 | 606 | ], |
| 248 | 607 | |
| 249 | - 'billing_last_name_heading' => [ | |
| 608 | + 'billing_last_name_heading' => [ | |
| 250 | 609 | 'id' => 'billing_last_name_heading', |
| 251 | 610 | 'type' => 'title', |
| 252 | 611 | 'label' => esc_html__( 'Last Name', 'shopbuilder' ), |
| 253 | - //'tab' => 'name', | |
| 254 | 612 | ], |
| 255 | 613 | 'billing_last_name' => [ |
| 256 | 614 | 'id' => 'billing_last_name', |
| 257 | 615 | 'label' => esc_html__( 'Last name', 'shopbuilder' ), |
| @@ -267,9 +625,8 @@ | ||
| 267 | 625 | 'value' => 'required', |
| 268 | 626 | 'label' => 'Required Field', |
| 269 | 627 | ], |
| 270 | 628 | ], |
| 271 | - // 'tab' => 'name', | |
| 272 | 629 | ], |
| 273 | 630 | |
| 274 | 631 | 'billing_last_name_label' => [ |
| 275 | 632 | 'id' => 'billing_last_name_label', |
| @@ -275,9 +632,8 @@ | ||
| 275 | 632 | 'id' => 'billing_last_name_label', |
| 276 | 633 | 'label' => esc_html__( 'Last name label', 'shopbuilder' ), |
| 277 | 634 | 'type' => 'text', |
| 278 | 635 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 279 | - // 'tab' => 'name', | |
| 280 | 636 | 'dependency' => [ |
| 281 | 637 | 'rules' => [ |
| 282 | 638 | [ |
| 283 | 639 | 'item' => 'general.billing_form.billing_last_name', |
| @@ -291,9 +647,8 @@ | ||
| 291 | 647 | 'id' => 'billing_last_name_placeholder', |
| 292 | 648 | 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ), |
| 293 | 649 | 'type' => 'text', |
| 294 | 650 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 295 | - // 'tab' => 'name', | |
| 296 | 651 | 'dependency' => [ |
| 297 | 652 | 'rules' => [ |
| 298 | 653 | [ |
| 299 | 654 | 'item' => 'general.billing_form.billing_last_name', |
| @@ -303,13 +658,12 @@ | ||
| 303 | 658 | ], |
| 304 | 659 | ], |
| 305 | 660 | ], |
| 306 | 661 | |
| 307 | - 'billing_company_heading' => [ | |
| 662 | + 'billing_company_heading' => [ | |
| 308 | 663 | 'id' => 'billing_company_heading', |
| 309 | 664 | 'type' => 'title', |
| 310 | 665 | 'label' => esc_html__( 'Company', 'shopbuilder' ), |
| 311 | - //'tab' => 'company', | |
| 312 | 666 | ], |
| 313 | 667 | 'billing_company' => [ |
| 314 | 668 | 'id' => 'billing_company', |
| 315 | 669 | 'label' => esc_html__( 'Company name', 'shopbuilder' ), |
| @@ -328,9 +682,8 @@ | ||
| 328 | 682 | 'value' => 'required', |
| 329 | 683 | 'label' => 'Required Field', |
| 330 | 684 | ], |
| 331 | 685 | ], |
| 332 | - // 'tab' => 'company', | |
| 333 | 686 | ], |
| 334 | 687 | |
| 335 | 688 | 'billing_company_label' => [ |
| 336 | 689 | 'id' => 'billing_company_label', |
| @@ -336,9 +689,8 @@ | ||
| 336 | 689 | 'id' => 'billing_company_label', |
| 337 | 690 | 'label' => esc_html__( 'Company label', 'shopbuilder' ), |
| 338 | 691 | 'type' => 'text', |
| 339 | 692 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 340 | - // 'tab' => 'company', | |
| 341 | 693 | 'dependency' => [ |
| 342 | 694 | 'rules' => [ |
| 343 | 695 | [ |
| 344 | 696 | 'item' => 'general.billing_form.billing_company', |
| @@ -352,9 +704,8 @@ | ||
| 352 | 704 | 'id' => 'billing_company_placeholder', |
| 353 | 705 | 'label' => esc_html__( 'Company Placeholder', 'shopbuilder' ), |
| 354 | 706 | 'type' => 'text', |
| 355 | 707 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 356 | - // 'tab' => 'company', | |
| 357 | 708 | 'dependency' => [ |
| 358 | 709 | 'rules' => [ |
| 359 | 710 | [ |
| 360 | 711 | 'item' => 'general.billing_form.billing_company', |
| @@ -364,13 +715,12 @@ | ||
| 364 | 715 | ], |
| 365 | 716 | ], |
| 366 | 717 | ], |
| 367 | 718 | |
| 368 | - 'billing_country_heading' => [ | |
| 719 | + 'billing_country_heading' => [ | |
| 369 | 720 | 'id' => 'billing_country_heading', |
| 370 | 721 | 'type' => 'title', |
| 371 | 722 | 'label' => esc_html__( 'Country', 'shopbuilder' ), |
| 372 | - //'tab' => 'country', | |
| 373 | 723 | ], |
| 374 | 724 | 'billing_country' => [ |
| 375 | 725 | 'id' => 'billing_country', |
| 376 | 726 | 'label' => esc_html__( 'Country', 'shopbuilder' ), |
| @@ -376,22 +726,18 @@ | ||
| 376 | 726 | 'label' => esc_html__( 'Country', 'shopbuilder' ), |
| 377 | 727 | 'type' => 'checkbox', |
| 378 | 728 | 'orientation' => 'vertical', |
| 379 | 729 | 'value' => [ 'show', 'required' ], |
| 380 | - // 'help' => esc_html__( 'If the Shipping Form is enabled, the Country field is mandatory.', 'shopbuilder' ), | |
| 381 | 730 | 'options' => [ |
| 382 | 731 | [ |
| 383 | 732 | 'value' => 'show', |
| 384 | 733 | 'label' => 'Show Country?', |
| 385 | - // 'disabled' => true, | |
| 386 | 734 | ], |
| 387 | 735 | [ |
| 388 | 736 | 'value' => 'required', |
| 389 | 737 | 'label' => 'Required Field', |
| 390 | - // 'disabled' => true, | |
| 391 | 738 | ], |
| 392 | 739 | ], |
| 393 | - // 'tab' => 'country', | |
| 394 | 740 | ], |
| 395 | 741 | |
| 396 | 742 | 'billing_country_label' => [ |
| 397 | 743 | 'id' => 'billing_country_label', |
| @@ -397,9 +743,8 @@ | ||
| 397 | 743 | 'id' => 'billing_country_label', |
| 398 | 744 | 'label' => esc_html__( 'Country label', 'shopbuilder' ), |
| 399 | 745 | 'type' => 'text', |
| 400 | 746 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 401 | - // 'tab' => 'country', | |
| 402 | 747 | 'dependency' => [ |
| 403 | 748 | 'rules' => [ |
| 404 | 749 | [ |
| 405 | 750 | 'item' => 'general.billing_form.billing_country', |
| @@ -408,13 +753,12 @@ | ||
| 408 | 753 | ], |
| 409 | 754 | ], |
| 410 | 755 | ], |
| 411 | 756 | ], |
| 412 | - 'billing_address_1_heading' => [ | |
| 757 | + 'billing_address_1_heading' => [ | |
| 413 | 758 | 'id' => 'billing_address_1_heading', |
| 414 | 759 | 'type' => 'title', |
| 415 | 760 | 'label' => esc_html__( 'Address 1', 'shopbuilder' ), |
| 416 | - //'tab' => 'address', | |
| 417 | 761 | ], |
| 418 | 762 | 'billing_address_1' => [ |
| 419 | 763 | 'id' => 'billing_address_1', |
| 420 | 764 | 'label' => esc_html__( 'Address 1', 'shopbuilder' ), |
| @@ -430,9 +774,8 @@ | ||
| 430 | 774 | 'value' => 'required', |
| 431 | 775 | 'label' => 'Required Field', |
| 432 | 776 | ], |
| 433 | 777 | ], |
| 434 | - // 'tab' => 'address', | |
| 435 | 778 | ], |
| 436 | 779 | |
| 437 | 780 | 'billing_address_1_label' => [ |
| 438 | 781 | 'id' => 'billing_address_1_label', |
| @@ -438,9 +781,8 @@ | ||
| 438 | 781 | 'id' => 'billing_address_1_label', |
| 439 | 782 | 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ), |
| 440 | 783 | 'type' => 'text', |
| 441 | 784 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 442 | - // 'tab' => 'address', | |
| 443 | 785 | 'dependency' => [ |
| 444 | 786 | 'rules' => [ |
| 445 | 787 | [ |
| 446 | 788 | 'item' => 'general.billing_form.billing_address_1', |
| @@ -454,9 +796,8 @@ | ||
| 454 | 796 | 'id' => 'billing_address_1_placeholder', |
| 455 | 797 | 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ), |
| 456 | 798 | 'type' => 'text', |
| 457 | 799 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 458 | - // 'tab' => 'address', | |
| 459 | 800 | 'dependency' => [ |
| 460 | 801 | 'rules' => [ |
| 461 | 802 | [ |
| 462 | 803 | 'item' => 'general.billing_form.billing_address_1', |
| @@ -465,14 +806,13 @@ | ||
| 465 | 806 | ], |
| 466 | 807 | ], |
| 467 | 808 | ], |
| 468 | 809 | ], |
| 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' => [ | |
| 810 | + 'billing_address_2_heading' => [ | |
| 811 | + 'id' => 'billing_address_2_heading', | |
| 812 | + 'type' => 'title', | |
| 813 | + 'label' => esc_html__( 'Address 2', 'shopbuilder' ), | |
| 814 | + 'dependency' => [ | |
| 475 | 815 | 'rules' => [ |
| 476 | 816 | [ |
| 477 | 817 | 'item' => 'general.billing_form.billing_address_1', |
| 478 | 818 | 'value' => 'show', |
| @@ -485,11 +825,11 @@ | ||
| 485 | 825 | 'id' => 'billing_address_2', |
| 486 | 826 | 'label' => esc_html__( 'Address 2', 'shopbuilder' ), |
| 487 | 827 | 'type' => 'checkbox', |
| 488 | 828 | 'orientation' => 'vertical', |
| 489 | - // 'tab' => 'address', | |
| 490 | - 'value' => [ 'show', | |
| 491 | - 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional', | |
| 829 | + 'value' => [ | |
| 830 | + 'show', | |
| 831 | + 'required' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ? 'required' : 'optional', | |
| 492 | 832 | ], |
| 493 | 833 | 'options' => [ |
| 494 | 834 | [ |
| 495 | 835 | 'value' => 'show', |
| @@ -512,9 +852,8 @@ | ||
| 512 | 852 | 'id' => 'billing_address_2_label', |
| 513 | 853 | 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ), |
| 514 | 854 | 'type' => 'text', |
| 515 | 855 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 516 | - // 'tab' => 'address', | |
| 517 | 856 | 'dependency' => [ |
| 518 | 857 | 'rules' => [ |
| 519 | 858 | [ |
| 520 | 859 | 'item' => 'general.billing_form.billing_address_1', |
| @@ -533,9 +872,8 @@ | ||
| 533 | 872 | 'id' => 'billing_address_2_placeholder', |
| 534 | 873 | 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ), |
| 535 | 874 | 'type' => 'text', |
| 536 | 875 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 537 | - // 'tab' => 'address', | |
| 538 | 876 | 'dependency' => [ |
| 539 | 877 | 'rules' => [ |
| 540 | 878 | [ |
| 541 | 879 | 'item' => 'general.billing_form.billing_address_1', |
| @@ -549,13 +887,12 @@ | ||
| 549 | 887 | ], |
| 550 | 888 | ], |
| 551 | 889 | ], |
| 552 | 890 | ], |
| 553 | - 'billing_city_heading' => [ | |
| 891 | + 'billing_city_heading' => [ | |
| 554 | 892 | 'id' => 'billing_city_heading', |
| 555 | 893 | 'type' => 'title', |
| 556 | 894 | 'label' => esc_html__( 'Town / City', 'shopbuilder' ), |
| 557 | - // 'tab' => 'city', | |
| 558 | 895 | ], |
| 559 | 896 | 'billing_city' => [ |
| 560 | 897 | 'id' => 'billing_city', |
| 561 | 898 | 'label' => esc_html__( 'Town / City', 'shopbuilder' ), |
| @@ -561,9 +898,8 @@ | ||
| 561 | 898 | 'label' => esc_html__( 'Town / City', 'shopbuilder' ), |
| 562 | 899 | 'type' => 'checkbox', |
| 563 | 900 | 'orientation' => 'vertical', |
| 564 | 901 | 'value' => [ 'show', 'required' ], |
| 565 | - // 'tab' => 'city', | |
| 566 | 902 | 'options' => [ |
| 567 | 903 | [ |
| 568 | 904 | 'value' => 'show', |
| 569 | 905 | 'label' => 'Show Town / City?', |
| @@ -579,9 +915,8 @@ | ||
| 579 | 915 | 'id' => 'billing_city_label', |
| 580 | 916 | 'label' => esc_html__( 'Town / City label', 'shopbuilder' ), |
| 581 | 917 | 'type' => 'text', |
| 582 | 918 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 583 | - // 'tab' => 'city', | |
| 584 | 919 | 'dependency' => [ |
| 585 | 920 | 'rules' => [ |
| 586 | 921 | [ |
| 587 | 922 | 'item' => 'general.billing_form.billing_city', |
| @@ -595,9 +930,8 @@ | ||
| 595 | 930 | 'id' => 'billing_city_placeholder', |
| 596 | 931 | 'label' => esc_html__( 'City placeholder', 'shopbuilder' ), |
| 597 | 932 | 'type' => 'text', |
| 598 | 933 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 599 | - // 'tab' => 'city', | |
| 600 | 934 | 'dependency' => [ |
| 601 | 935 | 'rules' => [ |
| 602 | 936 | [ |
| 603 | 937 | 'item' => 'general.billing_form.billing_city', |
| @@ -606,13 +940,12 @@ | ||
| 606 | 940 | ], |
| 607 | 941 | ], |
| 608 | 942 | ], |
| 609 | 943 | ], |
| 610 | - 'billing_state_heading' => [ | |
| 944 | + 'billing_state_heading' => [ | |
| 611 | 945 | 'id' => 'billing_city_heading', |
| 612 | 946 | 'type' => 'title', |
| 613 | 947 | 'label' => esc_html__( 'State', 'shopbuilder' ), |
| 614 | - // 'tab' => 'state', | |
| 615 | 948 | ], |
| 616 | 949 | 'billing_state' => [ |
| 617 | 950 | 'id' => 'billing_state', |
| 618 | 951 | 'label' => esc_html__( 'State', 'shopbuilder' ), |
| @@ -628,9 +961,8 @@ | ||
| 628 | 961 | 'value' => 'required', |
| 629 | 962 | 'label' => 'Required Field', |
| 630 | 963 | ], |
| 631 | 964 | ], |
| 632 | - // 'tab' => 'state', | |
| 633 | 965 | ], |
| 634 | 966 | |
| 635 | 967 | 'billing_state_label' => [ |
| 636 | 968 | 'id' => 'billing_state_label', |
| @@ -636,10 +968,8 @@ | ||
| 636 | 968 | 'id' => 'billing_state_label', |
| 637 | 969 | 'label' => esc_html__( 'State label', 'shopbuilder' ), |
| 638 | 970 | 'type' => 'text', |
| 639 | 971 | '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 | 972 | 'dependency' => [ |
| 643 | 973 | 'rules' => [ |
| 644 | 974 | [ |
| 645 | 975 | 'item' => 'general.billing_form.billing_state', |
| @@ -648,13 +978,12 @@ | ||
| 648 | 978 | ], |
| 649 | 979 | ], |
| 650 | 980 | ], |
| 651 | 981 | ], |
| 652 | - 'billing_postcode_heading' => [ | |
| 982 | + 'billing_postcode_heading' => [ | |
| 653 | 983 | 'id' => 'billing_postcode_heading', |
| 654 | 984 | 'type' => 'title', |
| 655 | 985 | 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ), |
| 656 | - // 'tab' => 'postcode', | |
| 657 | 986 | ], |
| 658 | 987 | 'billing_postcode' => [ |
| 659 | 988 | 'id' => 'billing_postcode', |
| 660 | 989 | 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ), |
| @@ -670,9 +999,8 @@ | ||
| 670 | 999 | 'value' => 'required', |
| 671 | 1000 | 'label' => 'Required Field', |
| 672 | 1001 | ], |
| 673 | 1002 | ], |
| 674 | - // 'tab' => 'postcode', | |
| 675 | 1003 | ], |
| 676 | 1004 | 'billing_postcode_label' => [ |
| 677 | 1005 | 'id' => 'billing_postcode_label', |
| 678 | 1006 | 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ), |
| @@ -677,9 +1005,8 @@ | ||
| 677 | 1005 | 'id' => 'billing_postcode_label', |
| 678 | 1006 | 'label' => esc_html__( 'Postcode / ZIP label', 'shopbuilder' ), |
| 679 | 1007 | 'type' => 'text', |
| 680 | 1008 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 681 | - // 'tab' => 'postcode', | |
| 682 | 1009 | 'dependency' => [ |
| 683 | 1010 | 'rules' => [ |
| 684 | 1011 | [ |
| 685 | 1012 | 'item' => 'general.billing_form.billing_postcode', |
| @@ -693,9 +1020,8 @@ | ||
| 693 | 1020 | 'id' => 'billing_postcode_placeholder', |
| 694 | 1021 | 'label' => esc_html__( 'Postcode / ZIP placeholder', 'shopbuilder' ), |
| 695 | 1022 | 'type' => 'text', |
| 696 | 1023 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 697 | - // 'tab' => 'postcode', | |
| 698 | 1024 | 'dependency' => [ |
| 699 | 1025 | 'rules' => [ |
| 700 | 1026 | [ |
| 701 | 1027 | 'item' => 'general.billing_form.billing_postcode', |
| @@ -704,13 +1030,12 @@ | ||
| 704 | 1030 | ], |
| 705 | 1031 | ], |
| 706 | 1032 | ], |
| 707 | 1033 | ], |
| 708 | - 'billing_phone_heading' => [ | |
| 1034 | + 'billing_phone_heading' => [ | |
| 709 | 1035 | 'id' => 'billing_phone_heading', |
| 710 | 1036 | 'type' => 'title', |
| 711 | 1037 | 'label' => esc_html__( 'Phone', 'shopbuilder' ), |
| 712 | - // 'tab' => 'phone', | |
| 713 | 1038 | ], |
| 714 | 1039 | 'billing_phone' => [ |
| 715 | 1040 | 'id' => 'billing_phone', |
| 716 | 1041 | 'label' => esc_html__( 'Phone', 'shopbuilder' ), |
| @@ -715,9 +1040,8 @@ | ||
| 715 | 1040 | 'id' => 'billing_phone', |
| 716 | 1041 | 'label' => esc_html__( 'Phone', 'shopbuilder' ), |
| 717 | 1042 | 'type' => 'checkbox', |
| 718 | 1043 | 'orientation' => 'vertical', |
| 719 | - // 'tab' => 'phone', | |
| 720 | 1044 | 'value' => [ |
| 721 | 1045 | 'show', |
| 722 | 1046 | 'required' === get_option( 'woocommerce_checkout_phone_field', 'required' ) ? 'required' : 'optional', |
| 723 | 1047 | ], |
| @@ -737,9 +1061,8 @@ | ||
| 737 | 1061 | 'id' => 'billing_phone_label', |
| 738 | 1062 | 'label' => esc_html__( 'Phone field label', 'shopbuilder' ), |
| 739 | 1063 | 'type' => 'text', |
| 740 | 1064 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 741 | - // 'tab' => 'phone', | |
| 742 | 1065 | 'dependency' => [ |
| 743 | 1066 | 'rules' => [ |
| 744 | 1067 | [ |
| 745 | 1068 | 'item' => 'general.billing_form.billing_phone', |
| @@ -753,9 +1076,8 @@ | ||
| 753 | 1076 | 'id' => 'billing_phone_placeholder', |
| 754 | 1077 | 'label' => esc_html__( 'Phone field placeholder', 'shopbuilder' ), |
| 755 | 1078 | 'type' => 'text', |
| 756 | 1079 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 757 | - // 'tab' => 'phone', | |
| 758 | 1080 | 'dependency' => [ |
| 759 | 1081 | 'rules' => [ |
| 760 | 1082 | [ |
| 761 | 1083 | 'item' => 'general.billing_form.billing_phone', |
| @@ -764,13 +1086,12 @@ | ||
| 764 | 1086 | ], |
| 765 | 1087 | ], |
| 766 | 1088 | ], |
| 767 | 1089 | ], |
| 768 | - 'billing_email_heading' => [ | |
| 1090 | + 'billing_email_heading' => [ | |
| 769 | 1091 | 'id' => 'billing_email_heading', |
| 770 | 1092 | 'type' => 'title', |
| 771 | 1093 | 'label' => esc_html__( 'Email', 'shopbuilder' ), |
| 772 | - // 'tab' => 'email', | |
| 773 | 1094 | ], |
| 774 | 1095 | 'billing_email' => [ |
| 775 | 1096 | 'id' => 'billing_email', |
| 776 | 1097 | 'label' => esc_html__( 'Email address', 'shopbuilder' ), |
| @@ -775,9 +1096,8 @@ | ||
| 775 | 1096 | 'id' => 'billing_email', |
| 776 | 1097 | 'label' => esc_html__( 'Email address', 'shopbuilder' ), |
| 777 | 1098 | 'type' => 'checkbox', |
| 778 | 1099 | 'orientation' => 'vertical', |
| 779 | - // 'tab' => 'email', | |
| 780 | 1100 | 'value' => [ 'show', 'required' ], |
| 781 | 1101 | 'options' => [ |
| 782 | 1102 | [ |
| 783 | 1103 | 'value' => 'show', |
| @@ -793,9 +1113,8 @@ | ||
| 793 | 1113 | 'id' => 'billing_email_label', |
| 794 | 1114 | 'label' => esc_html__( 'Email address field label', 'shopbuilder' ), |
| 795 | 1115 | 'type' => 'text', |
| 796 | 1116 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 797 | - // 'tab' => 'email', | |
| 798 | 1117 | 'dependency' => [ |
| 799 | 1118 | 'rules' => [ |
| 800 | 1119 | [ |
| 801 | 1120 | 'item' => 'general.billing_form.billing_email', |
| @@ -809,9 +1128,8 @@ | ||
| 809 | 1128 | 'id' => 'billing_email_placeholder', |
| 810 | 1129 | 'label' => esc_html__( 'Email address field placeholder', 'shopbuilder' ), |
| 811 | 1130 | 'type' => 'text', |
| 812 | 1131 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 813 | - // 'tab' => 'email', | |
| 814 | 1132 | 'dependency' => [ |
| 815 | 1133 | 'rules' => [ |
| 816 | 1134 | [ |
| 817 | 1135 | 'item' => 'general.billing_form.billing_email', |
| @@ -824,9 +1142,9 @@ | ||
| 824 | 1142 | ], |
| 825 | 1143 | |
| 826 | 1144 | ] |
| 827 | 1145 | ), |
| 828 | - 'shipping_form' => apply_filters( | |
| 1146 | + 'shipping_form' => apply_filters( | |
| 829 | 1147 | 'rtsb/module/shipping_form/options', |
| 830 | 1148 | [ |
| 831 | 1149 | 'id' => 'shipping_form', |
| 832 | 1150 | 'category' => 'checkout', |
| @@ -832,17 +1150,22 @@ | ||
| 832 | 1150 | 'category' => 'checkout', |
| 833 | 1151 | 'title' => esc_html__( 'Shipping Form Settings', 'shopbuilder' ), |
| 834 | 1152 | 'package' => 'free', |
| 835 | 1153 | 'active_field' => [ |
| 836 | - 'label' => esc_html__( 'Enable Shipping form settings?', 'shopbuilder' ), | |
| 837 | - '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' ), | |
| 838 | 1156 | ], |
| 839 | 1157 | 'fields' => [ |
| 840 | - 'shipping_first_name_heading' => [ | |
| 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 | + ], | |
| 1164 | + 'shipping_first_name_heading' => [ | |
| 841 | 1165 | 'id' => 'shipping_first_name_heading', |
| 842 | 1166 | 'type' => 'title', |
| 843 | 1167 | 'label' => esc_html__( 'First Name', 'shopbuilder' ), |
| 844 | - // 'tab' => 'name', | |
| 845 | 1168 | ], |
| 846 | 1169 | 'shipping_first_name' => [ |
| 847 | 1170 | 'id' => 'shipping_first_name', |
| 848 | 1171 | 'label' => esc_html__( 'First name', 'shopbuilder' ), |
| @@ -858,9 +1181,8 @@ | ||
| 858 | 1181 | 'value' => 'required', |
| 859 | 1182 | 'label' => 'Required Field', |
| 860 | 1183 | ], |
| 861 | 1184 | ], |
| 862 | - // 'tab' => 'name', | |
| 863 | 1185 | ], |
| 864 | 1186 | 'shipping_first_name_label' => [ |
| 865 | 1187 | 'id' => 'shipping_first_name_label', |
| 866 | 1188 | 'label' => esc_html__( 'First name Label', 'shopbuilder' ), |
| @@ -865,9 +1187,8 @@ | ||
| 865 | 1187 | 'id' => 'shipping_first_name_label', |
| 866 | 1188 | 'label' => esc_html__( 'First name Label', 'shopbuilder' ), |
| 867 | 1189 | 'type' => 'text', |
| 868 | 1190 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 869 | - // 'tab' => 'name', | |
| 870 | 1191 | 'dependency' => [ |
| 871 | 1192 | 'rules' => [ |
| 872 | 1193 | [ |
| 873 | 1194 | 'item' => 'general.shipping_form.shipping_first_name', |
| @@ -881,9 +1202,8 @@ | ||
| 881 | 1202 | 'id' => 'shipping_first_name_placeholder', |
| 882 | 1203 | 'label' => esc_html__( 'First name Placeholder', 'shopbuilder' ), |
| 883 | 1204 | 'type' => 'text', |
| 884 | 1205 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 885 | - // 'tab' => 'country', | |
| 886 | 1206 | 'dependency' => [ |
| 887 | 1207 | 'rules' => [ |
| 888 | 1208 | [ |
| 889 | 1209 | 'item' => 'general.shipping_form.shipping_first_name', |
| @@ -892,13 +1212,12 @@ | ||
| 892 | 1212 | ], |
| 893 | 1213 | ], |
| 894 | 1214 | ], |
| 895 | 1215 | ], |
| 896 | - 'shipping_first_last_heading' => [ | |
| 1216 | + 'shipping_first_last_heading' => [ | |
| 897 | 1217 | 'id' => 'shipping_first_last_heading', |
| 898 | 1218 | 'type' => 'title', |
| 899 | 1219 | 'label' => esc_html__( 'Last Name', 'shopbuilder' ), |
| 900 | - // 'tab' => 'name', | |
| 901 | 1220 | ], |
| 902 | 1221 | 'shipping_last_name' => [ |
| 903 | 1222 | 'id' => 'shipping_last_name', |
| 904 | 1223 | 'label' => esc_html__( 'Last name', 'shopbuilder' ), |
| @@ -914,9 +1233,8 @@ | ||
| 914 | 1233 | 'value' => 'required', |
| 915 | 1234 | 'label' => 'Required Field', |
| 916 | 1235 | ], |
| 917 | 1236 | ], |
| 918 | - // 'tab' => 'name', | |
| 919 | 1237 | ], |
| 920 | 1238 | |
| 921 | 1239 | 'shipping_last_name_label' => [ |
| 922 | 1240 | 'id' => 'shipping_last_name_label', |
| @@ -922,9 +1240,8 @@ | ||
| 922 | 1240 | 'id' => 'shipping_last_name_label', |
| 923 | 1241 | 'label' => esc_html__( 'Last name label', 'shopbuilder' ), |
| 924 | 1242 | 'type' => 'text', |
| 925 | 1243 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 926 | - // 'tab' => 'name', | |
| 927 | 1244 | 'dependency' => [ |
| 928 | 1245 | 'rules' => [ |
| 929 | 1246 | [ |
| 930 | 1247 | 'item' => 'general.shipping_form.shipping_last_name', |
| @@ -938,9 +1255,8 @@ | ||
| 938 | 1255 | 'id' => 'shipping_last_name_placeholder', |
| 939 | 1256 | 'label' => esc_html__( 'Last name Placeholder', 'shopbuilder' ), |
| 940 | 1257 | 'type' => 'text', |
| 941 | 1258 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 942 | - // 'tab' => 'country', | |
| 943 | 1259 | 'dependency' => [ |
| 944 | 1260 | 'rules' => [ |
| 945 | 1261 | [ |
| 946 | 1262 | 'item' => 'general.shipping_form.shipping_last_name', |
| @@ -949,13 +1265,12 @@ | ||
| 949 | 1265 | ], |
| 950 | 1266 | ], |
| 951 | 1267 | ], |
| 952 | 1268 | ], |
| 953 | - 'shipping_company_heading' => [ | |
| 1269 | + 'shipping_company_heading' => [ | |
| 954 | 1270 | 'id' => 'shipping_company_heading', |
| 955 | 1271 | 'type' => 'title', |
| 956 | 1272 | 'label' => esc_html__( 'Company', 'shopbuilder' ), |
| 957 | - // 'tab' => 'name', | |
| 958 | 1273 | ], |
| 959 | 1274 | 'shipping_company' => [ |
| 960 | 1275 | 'id' => 'shipping_company', |
| 961 | 1276 | 'label' => esc_html__( 'Company name', 'shopbuilder' ), |
| @@ -971,9 +1286,8 @@ | ||
| 971 | 1286 | 'value' => 'required', |
| 972 | 1287 | 'label' => 'Required Field', |
| 973 | 1288 | ], |
| 974 | 1289 | ], |
| 975 | - // 'tab' => 'company', | |
| 976 | 1290 | ], |
| 977 | 1291 | |
| 978 | 1292 | 'shipping_company_label' => [ |
| 979 | 1293 | 'id' => 'shipping_company_label', |
| @@ -979,9 +1293,8 @@ | ||
| 979 | 1293 | 'id' => 'shipping_company_label', |
| 980 | 1294 | 'label' => esc_html__( 'Company label', 'shopbuilder' ), |
| 981 | 1295 | 'type' => 'text', |
| 982 | 1296 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 983 | - // 'tab' => 'company', | |
| 984 | 1297 | 'dependency' => [ |
| 985 | 1298 | 'rules' => [ |
| 986 | 1299 | [ |
| 987 | 1300 | 'item' => 'general.shipping_form.shipping_company', |
| @@ -995,9 +1308,8 @@ | ||
| 995 | 1308 | 'id' => 'shipping_company_placeholder', |
| 996 | 1309 | 'label' => esc_html__( 'Shipping company Placeholder', 'shopbuilder' ), |
| 997 | 1310 | 'type' => 'text', |
| 998 | 1311 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 999 | - // 'tab' => 'country', | |
| 1000 | 1312 | 'dependency' => [ |
| 1001 | 1313 | 'rules' => [ |
| 1002 | 1314 | [ |
| 1003 | 1315 | 'item' => 'general.shipping_form.shipping_company', |
| @@ -1006,13 +1318,12 @@ | ||
| 1006 | 1318 | ], |
| 1007 | 1319 | ], |
| 1008 | 1320 | ], |
| 1009 | 1321 | ], |
| 1010 | - 'shipping_country_heading' => [ | |
| 1322 | + 'shipping_country_heading' => [ | |
| 1011 | 1323 | 'id' => 'shipping_country_heading', |
| 1012 | 1324 | 'type' => 'title', |
| 1013 | 1325 | 'label' => esc_html__( 'Country', 'shopbuilder' ), |
| 1014 | - // 'tab' => 'name', | |
| 1015 | 1326 | ], |
| 1016 | 1327 | 'shipping_country' => [ |
| 1017 | 1328 | 'id' => 'shipping_country', |
| 1018 | 1329 | 'label' => esc_html__( 'Country', 'shopbuilder' ), |
| @@ -1022,17 +1333,14 @@ | ||
| 1022 | 1333 | 'options' => [ |
| 1023 | 1334 | [ |
| 1024 | 1335 | 'value' => 'show', |
| 1025 | 1336 | 'label' => 'Show Country?', |
| 1026 | - // 'disabled' => true, | |
| 1027 | 1337 | ], |
| 1028 | 1338 | [ |
| 1029 | 1339 | 'value' => 'required', |
| 1030 | 1340 | 'label' => 'Required Field', |
| 1031 | - // 'disabled' => true, | |
| 1032 | 1341 | ], |
| 1033 | 1342 | ], |
| 1034 | - // 'tab' => 'country', | |
| 1035 | 1343 | ], |
| 1036 | 1344 | |
| 1037 | 1345 | 'shipping_country_label' => [ |
| 1038 | 1346 | 'id' => 'shipping_country_label', |
| @@ -1048,13 +1356,12 @@ | ||
| 1048 | 1356 | ], |
| 1049 | 1357 | ], |
| 1050 | 1358 | ], |
| 1051 | 1359 | ], |
| 1052 | - 'shipping_address_1_heading' => [ | |
| 1360 | + 'shipping_address_1_heading' => [ | |
| 1053 | 1361 | 'id' => 'shipping_address_1_heading', |
| 1054 | 1362 | 'type' => 'title', |
| 1055 | 1363 | 'label' => esc_html__( 'Address 1', 'shopbuilder' ), |
| 1056 | - // 'tab' => 'name', | |
| 1057 | 1364 | ], |
| 1058 | 1365 | 'shipping_address_1' => [ |
| 1059 | 1366 | 'id' => 'shipping_address_1', |
| 1060 | 1367 | 'label' => esc_html__( 'Address 1', 'shopbuilder' ), |
| @@ -1070,9 +1377,8 @@ | ||
| 1070 | 1377 | 'value' => 'required', |
| 1071 | 1378 | 'label' => 'Required Field', |
| 1072 | 1379 | ], |
| 1073 | 1380 | ], |
| 1074 | - // 'tab' => 'country', | |
| 1075 | 1381 | ], |
| 1076 | 1382 | |
| 1077 | 1383 | 'shipping_address_1_label' => [ |
| 1078 | 1384 | 'id' => 'shipping_address_1_label', |
| @@ -1078,9 +1384,8 @@ | ||
| 1078 | 1384 | 'id' => 'shipping_address_1_label', |
| 1079 | 1385 | 'label' => esc_html__( 'Address 1 label', 'shopbuilder' ), |
| 1080 | 1386 | 'type' => 'text', |
| 1081 | 1387 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1082 | - // 'tab' => 'country', | |
| 1083 | 1388 | 'dependency' => [ |
| 1084 | 1389 | 'rules' => [ |
| 1085 | 1390 | [ |
| 1086 | 1391 | 'item' => 'general.shipping_form.shipping_address_1', |
| @@ -1094,9 +1399,8 @@ | ||
| 1094 | 1399 | 'id' => 'shipping_address_1_placeholder', |
| 1095 | 1400 | 'label' => esc_html__( 'Address 1 Placeholder', 'shopbuilder' ), |
| 1096 | 1401 | 'type' => 'text', |
| 1097 | 1402 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1098 | - // 'tab' => 'country', | |
| 1099 | 1403 | 'dependency' => [ |
| 1100 | 1404 | 'rules' => [ |
| 1101 | 1405 | [ |
| 1102 | 1406 | 'item' => 'general.shipping_form.shipping_address_1', |
| @@ -1105,14 +1409,13 @@ | ||
| 1105 | 1409 | ], |
| 1106 | 1410 | ], |
| 1107 | 1411 | ], |
| 1108 | 1412 | ], |
| 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' => [ | |
| 1413 | + 'shipping_address_2_heading' => [ | |
| 1414 | + 'id' => 'shipping_address_2_heading', | |
| 1415 | + 'type' => 'title', | |
| 1416 | + 'label' => esc_html__( 'Address 2', 'shopbuilder' ), | |
| 1417 | + 'dependency' => [ | |
| 1115 | 1418 | 'rules' => [ |
| 1116 | 1419 | [ |
| 1117 | 1420 | 'item' => 'general.shipping_form.shipping_address_1', |
| 1118 | 1421 | 'value' => 'show', |
| @@ -1133,9 +1436,8 @@ | ||
| 1133 | 1436 | 'label' => 'Show Address field?', |
| 1134 | 1437 | ], |
| 1135 | 1438 | ], |
| 1136 | 1439 | 'help' => esc_html__( 'if "Address 1" is hidden then this field also hides.', 'shopbuilder' ), |
| 1137 | - // 'tab' => 'country', | |
| 1138 | 1440 | 'dependency' => [ |
| 1139 | 1441 | 'rules' => [ |
| 1140 | 1442 | [ |
| 1141 | 1443 | 'item' => 'general.shipping_form.shipping_address_1', |
| @@ -1150,9 +1452,8 @@ | ||
| 1150 | 1452 | 'id' => 'shipping_address_2_label', |
| 1151 | 1453 | 'label' => esc_html__( 'Address 2 label', 'shopbuilder' ), |
| 1152 | 1454 | 'type' => 'text', |
| 1153 | 1455 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1154 | - // 'tab' => 'country', | |
| 1155 | 1456 | 'dependency' => [ |
| 1156 | 1457 | 'rules' => [ |
| 1157 | 1458 | [ |
| 1158 | 1459 | 'item' => 'general.shipping_form.shipping_address_1', |
| @@ -1171,9 +1472,8 @@ | ||
| 1171 | 1472 | 'id' => 'shipping_address_2_placeholder', |
| 1172 | 1473 | 'label' => esc_html__( 'Address 2 Placeholder', 'shopbuilder' ), |
| 1173 | 1474 | 'type' => 'text', |
| 1174 | 1475 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1175 | - // 'tab' => 'country', | |
| 1176 | 1476 | 'dependency' => [ |
| 1177 | 1477 | 'rules' => [ |
| 1178 | 1478 | [ |
| 1179 | 1479 | 'item' => 'general.shipping_form.shipping_address_1', |
| @@ -1187,13 +1487,12 @@ | ||
| 1187 | 1487 | ], |
| 1188 | 1488 | ], |
| 1189 | 1489 | ], |
| 1190 | 1490 | ], |
| 1191 | - 'shipping_city_heading' => [ | |
| 1491 | + 'shipping_city_heading' => [ | |
| 1192 | 1492 | 'id' => 'shipping_city_heading', |
| 1193 | 1493 | 'type' => 'title', |
| 1194 | 1494 | 'label' => esc_html__( 'Town / City', 'shopbuilder' ), |
| 1195 | - // 'tab' => 'name', | |
| 1196 | 1495 | ], |
| 1197 | 1496 | 'shipping_city' => [ |
| 1198 | 1497 | 'id' => 'shipping_city', |
| 1199 | 1498 | 'label' => esc_html__( 'Town / City', 'shopbuilder' ), |
| @@ -1209,9 +1508,8 @@ | ||
| 1209 | 1508 | 'value' => 'required', |
| 1210 | 1509 | 'label' => 'Required Field', |
| 1211 | 1510 | ], |
| 1212 | 1511 | ], |
| 1213 | - // 'tab' => 'country', | |
| 1214 | 1512 | ], |
| 1215 | 1513 | 'shipping_city_label' => [ |
| 1216 | 1514 | 'id' => 'shipping_city_label', |
| 1217 | 1515 | 'label' => esc_html__( 'Town / City label', 'shopbuilder' ), |
| @@ -1216,9 +1514,8 @@ | ||
| 1216 | 1514 | 'id' => 'shipping_city_label', |
| 1217 | 1515 | 'label' => esc_html__( 'Town / City label', 'shopbuilder' ), |
| 1218 | 1516 | 'type' => 'text', |
| 1219 | 1517 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1220 | - // 'tab' => 'country', | |
| 1221 | 1518 | 'dependency' => [ |
| 1222 | 1519 | 'rules' => [ |
| 1223 | 1520 | [ |
| 1224 | 1521 | 'item' => 'general.shipping_form.shipping_city', |
| @@ -1232,9 +1529,8 @@ | ||
| 1232 | 1529 | 'id' => 'shipping_city_placeholder', |
| 1233 | 1530 | 'label' => esc_html__( 'Shipping city placeholder', 'shopbuilder' ), |
| 1234 | 1531 | 'type' => 'text', |
| 1235 | 1532 | 'help' => esc_html__( 'Leave empty to set default.', 'shopbuilder' ), |
| 1236 | - // 'tab' => 'country', | |
| 1237 | 1533 | 'dependency' => [ |
| 1238 | 1534 | 'rules' => [ |
| 1239 | 1535 | [ |
| 1240 | 1536 | 'item' => 'general.shipping_form.shipping_city', |
| @@ -1243,13 +1539,12 @@ | ||
| 1243 | 1539 | ], |
| 1244 | 1540 | ], |
| 1245 | 1541 | ], |
| 1246 | 1542 | ], |
| 1247 | - 'shipping_state_heading' => [ | |
| 1543 | + 'shipping_state_heading' => [ | |
| 1248 | 1544 | 'id' => 'shipping_state_heading', |
| 1249 | 1545 | 'type' => 'title', |
| 1250 | 1546 | 'label' => esc_html__( 'Others', 'shopbuilder' ), |
| 1251 | - // 'tab' => 'name', | |
| 1252 | 1547 | ], |
| 1253 | 1548 | 'shipping_state' => [ |
| 1254 | 1549 | 'id' => 'shipping_state', |
| 1255 | 1550 | 'label' => esc_html__( 'State', 'shopbuilder' ), |
| @@ -1265,33 +1560,9 @@ | ||
| 1265 | 1560 | 'value' => 'required', |
| 1266 | 1561 | 'label' => 'Required Field', |
| 1267 | 1562 | ], |
| 1268 | 1563 | ], |
| 1269 | - // 'tab' => 'country', | |
| 1270 | 1564 | ], |
| 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 | 1565 | 'shipping_postcode' => [ |
| 1295 | 1566 | 'id' => 'shipping_postcode', |
| 1296 | 1567 | 'label' => esc_html__( 'Postcode / ZIP', 'shopbuilder' ), |
| 1297 | 1568 | 'type' => 'checkbox', |
| @@ -1300,49 +1571,71 @@ | ||
| 1300 | 1571 | 'options' => [ |
| 1301 | 1572 | [ |
| 1302 | 1573 | 'value' => 'show', |
| 1303 | 1574 | 'label' => 'Show Postcode / ZIP?', |
| 1304 | - ] | |
| 1575 | + ], | |
| 1305 | 1576 | ], |
| 1306 | - // 'tab' => 'country', | |
| 1307 | 1577 | ], |
| 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 | 1578 | |
| 1341 | 1579 | ], |
| 1342 | 1580 | ] |
| 1343 | 1581 | ), |
| 1582 | + | |
| 1344 | 1583 | ]; |
| 1345 | 1584 | |
| 1585 | + if ( ! defined( 'ELEMENTOR_VERSION' ) ) { | |
| 1586 | + unset( $list['optimization']['fields']['load_elementor_scripts'] ); | |
| 1587 | + } | |
| 1346 | 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 | + ]; | |
| 1347 | 1640 | } |
| 1348 | 1641 | } |