| @@ -12,9 +12,11 @@ | ||
| 12 | 12 | /** |
| 13 | 13 | * Settings. |
| 14 | 14 | * |
| 15 | 15 | */ |
| 16 | -Merchant_Admin_Options::create( array( | |
| 16 | + | |
| 17 | +return array( | |
| 18 | + array( | |
| 17 | 19 | 'title' => esc_html__( 'Settings', 'merchant' ), |
| 18 | 20 | 'module' => 'quick-view', |
| 19 | 21 | 'fields' => array( |
| 20 | 22 | |
| @@ -27,8 +29,11 @@ | ||
| 27 | 29 | 'icon' => esc_html__( 'Icon', 'merchant' ), |
| 28 | 30 | 'icon-text' => esc_html__( 'Icon + text', 'merchant' ), |
| 29 | 31 | ), |
| 30 | 32 | 'default' => 'text', |
| 33 | + 'ai_meta' => array( | |
| 34 | + 'usage_hint' => 'Controls the quick view button appearance. Set to text, icon, or icon-text. This value gates button_text (text|icon-text) and button_icon (icon|icon-text) fields.', | |
| 35 | + ), | |
| 31 | 36 | ), |
| 32 | 37 | |
| 33 | 38 | array( |
| 34 | 39 | 'id' => 'button_text', |
| @@ -59,8 +64,11 @@ | ||
| 59 | 64 | 'after' => esc_html__( 'After - Add to cart', 'merchant' ), |
| 60 | 65 | 'overlay' => esc_html__( 'Overlay', 'merchant' ), |
| 61 | 66 | ), |
| 62 | 67 | 'default' => 'overlay', |
| 68 | + 'ai_meta' => array( | |
| 69 | + 'usage_hint' => 'Where the quick view button appears on the product card. Set to overlay to float over the image (enables position-top/left controls and mobile_position). Before/after place it relative to the add-to-cart button.', | |
| 70 | + ), | |
| 63 | 71 | ), |
| 64 | 72 | |
| 65 | 73 | array( |
| 66 | 74 | 'id' => 'button-position-top', |
| @@ -91,8 +99,12 @@ | ||
| 91 | 99 | 'type' => 'checkbox', |
| 92 | 100 | 'label' => esc_html__( 'Mobile position', 'merchant' ), |
| 93 | 101 | 'default' => 0, |
| 94 | 102 | 'condition' => array( 'button_position', '==', 'overlay' ), |
| 103 | + 'ai_meta' => array( | |
| 104 | + 'toggle_for' => 'button-position-top-mobile', | |
| 105 | + 'usage_hint' => 'Enable to set a separate overlay position for mobile. Gates button-position-top-mobile and button-position-left-mobile. Only available when button_position=overlay.', | |
| 106 | + ), | |
| 95 | 107 | ), |
| 96 | 108 | |
| 97 | 109 | array( |
| 98 | 110 | 'id' => 'button-position-top-mobile', |
| @@ -206,42 +218,101 @@ | ||
| 206 | 218 | 'default' => '#414141', |
| 207 | 219 | ), |
| 208 | 220 | |
| 209 | 221 | ), |
| 210 | -) ); | |
| 211 | - | |
| 212 | - | |
| 213 | -/** | |
| 214 | - * Modal. | |
| 215 | - * | |
| 216 | - */ | |
| 217 | -Merchant_Admin_Options::create( array( | |
| 222 | +), | |
| 223 | + array( | |
| 218 | 224 | 'title' => esc_html__( 'Modal', 'merchant' ), |
| 219 | 225 | 'module' => 'quick-view', |
| 220 | 226 | 'fields' => array( |
| 221 | 227 | array( |
| 222 | - 'id' => 'modal_width', | |
| 223 | - 'type' => 'range', | |
| 224 | - 'title' => esc_html__( 'Modal width', 'merchant' ), | |
| 225 | - 'min' => 1, | |
| 226 | - 'max' => 2000, | |
| 227 | - 'step' => 1, | |
| 228 | - 'default' => 1000, | |
| 229 | - 'unit' => 'px', | |
| 228 | + 'id' => 'modal_layout', | |
| 229 | + 'type' => 'radio', | |
| 230 | + 'title' => esc_html__( 'Modal layout', 'merchant' ), | |
| 231 | + 'options' => array( | |
| 232 | + 'modal' => esc_html__( 'Centered modal', 'merchant' ), | |
| 233 | + 'side-panel' => esc_html__( 'Side panel', 'merchant' ), | |
| 234 | + ), | |
| 235 | + 'default' => 'modal', | |
| 230 | 236 | ), |
| 231 | 237 | |
| 232 | 238 | array( |
| 233 | - 'id' => 'modal_height', | |
| 234 | - 'type' => 'range', | |
| 235 | - 'title' => esc_html__( 'Modal height', 'merchant' ), | |
| 236 | - 'min' => 1, | |
| 237 | - 'max' => 2000, | |
| 238 | - 'step' => 1, | |
| 239 | - 'default' => 500, | |
| 240 | - 'unit' => 'px', | |
| 239 | + 'id' => 'show_navigation_arrows', | |
| 240 | + 'type' => 'switcher', | |
| 241 | + 'title' => esc_html__( 'Show next/previous navigation arrows', 'merchant' ), | |
| 242 | + 'default' => 0, | |
| 241 | 243 | ), |
| 242 | 244 | |
| 243 | 245 | array( |
| 246 | + 'id' => 'sync_url_hash', | |
| 247 | + 'type' => 'switcher', | |
| 248 | + 'title' => esc_html__( 'Update browser URL when quick view opens', 'merchant' ), | |
| 249 | + 'default' => 0, | |
| 250 | + ), | |
| 251 | + | |
| 252 | + array( | |
| 253 | + 'id' => 'modal_width', | |
| 254 | + 'type' => 'range', | |
| 255 | + 'title' => esc_html__( 'Modal width', 'merchant' ), | |
| 256 | + 'desc' => esc_html__( 'Default: 1000 pixels', 'merchant' ), | |
| 257 | + 'min' => 1, | |
| 258 | + 'max' => 2000, | |
| 259 | + 'step' => 1, | |
| 260 | + 'default' => 1000, | |
| 261 | + 'unit' => 'px', | |
| 262 | + 'conditions' => array( | |
| 263 | + 'terms' => array( | |
| 264 | + array( | |
| 265 | + 'field' => 'modal_layout', | |
| 266 | + 'operator' => '===', | |
| 267 | + 'value' => 'modal', | |
| 268 | + ), | |
| 269 | + ), | |
| 270 | + ), | |
| 271 | + ), | |
| 272 | + | |
| 273 | + array( | |
| 274 | + 'id' => 'modal_height', | |
| 275 | + 'type' => 'range', | |
| 276 | + 'title' => esc_html__( 'Modal height', 'merchant' ), | |
| 277 | + 'min' => 1, | |
| 278 | + 'max' => 2000, | |
| 279 | + 'step' => 1, | |
| 280 | + 'default' => 500, | |
| 281 | + 'unit' => 'px', | |
| 282 | + 'conditions' => array( | |
| 283 | + 'terms' => array( | |
| 284 | + array( | |
| 285 | + 'field' => 'modal_layout', | |
| 286 | + 'operator' => '===', | |
| 287 | + 'value' => 'modal', | |
| 288 | + ), | |
| 289 | + ), | |
| 290 | + ), | |
| 291 | + ), | |
| 292 | + | |
| 293 | + array( | |
| 294 | + 'id' => 'side_panel_width', | |
| 295 | + 'type' => 'range', | |
| 296 | + 'title' => esc_html__( 'Side panel width', 'merchant' ), | |
| 297 | + 'desc' => esc_html__( 'Default: 420 pixels', 'merchant' ), | |
| 298 | + 'min' => 280, | |
| 299 | + 'max' => 800, | |
| 300 | + 'step' => 1, | |
| 301 | + 'default' => 420, | |
| 302 | + 'unit' => 'px', | |
| 303 | + 'conditions' => array( | |
| 304 | + 'terms' => array( | |
| 305 | + array( | |
| 306 | + 'field' => 'modal_layout', | |
| 307 | + 'operator' => '===', | |
| 308 | + 'value' => 'side-panel', | |
| 309 | + ), | |
| 310 | + ), | |
| 311 | + ), | |
| 312 | + ), | |
| 313 | + | |
| 314 | + array( | |
| 244 | 315 | 'id' => 'place_product_image', |
| 245 | 316 | 'type' => 'radio', |
| 246 | 317 | 'title' => esc_html__( 'Product gallery image placement', 'merchant' ), |
| 247 | 318 | 'options' => array( |
| @@ -314,8 +385,12 @@ | ||
| 314 | 385 | 'pro' => true, // Merchant Pro dependent |
| 315 | 386 | 'type' => 'switcher', |
| 316 | 387 | 'title' => esc_html__( 'Show suggested products', 'merchant' ), |
| 317 | 388 | 'default' => 1, |
| 389 | + 'ai_meta' => array( | |
| 390 | + 'toggle_for' => 'suggested_products_module', | |
| 391 | + 'usage_hint' => 'Enable to display upsell/cross-sell products inside the quick view modal. Gates suggested_products_module and suggested_products_placement fields. Requires Merchant Pro.', | |
| 392 | + ), | |
| 318 | 393 | ), |
| 319 | 394 | array( |
| 320 | 395 | 'id' => 'suggested_products_module', |
| 321 | 396 | 'pro' => true, |
| @@ -334,8 +409,12 @@ | ||
| 334 | 409 | 'value' => true, |
| 335 | 410 | ), |
| 336 | 411 | ), |
| 337 | 412 | ), |
| 413 | + 'ai_meta' => array( | |
| 414 | + 'toggled_by' => 'show_suggested_products', | |
| 415 | + 'usage_hint' => 'Which Merchant module provides the suggested products shown inside quick view. Requires show_suggested_products=true and the chosen module to be active.', | |
| 416 | + ), | |
| 338 | 417 | ), |
| 339 | 418 | array( |
| 340 | 419 | 'id' => 'suggested_products_instructions_bulk_discounts', |
| 341 | 420 | 'pro' => true, |
| @@ -440,14 +519,11 @@ | ||
| 440 | 519 | 'default' => '#999999', |
| 441 | 520 | ), |
| 442 | 521 | |
| 443 | 522 | ), |
| 444 | -) ); | |
| 445 | - | |
| 446 | -// Shortcode | |
| 447 | -$merchant_module_id = Merchant_Quick_View::MODULE_ID; | |
| 448 | -Merchant_Admin_Options::create( array( | |
| 449 | - 'module' => $merchant_module_id, | |
| 523 | +), | |
| 524 | + array( | |
| 525 | + 'module' => Merchant_Quick_View::MODULE_ID, | |
| 450 | 526 | 'title' => esc_html__( 'Use shortcode', 'merchant' ), |
| 451 | 527 | 'fields' => array( |
| 452 | 528 | array( |
| 453 | 529 | 'id' => 'use_shortcode', |
| @@ -463,9 +539,10 @@ | ||
| 463 | 539 | array( |
| 464 | 540 | 'id' => 'shortcode_text', |
| 465 | 541 | 'type' => 'text_readonly', |
| 466 | 542 | 'title' => esc_html__( 'Shortcode text', 'merchant' ), |
| 467 | - 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']', | |
| 543 | + 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Quick_View::MODULE_ID ) . ']', | |
| 468 | 544 | 'condition' => array( 'use_shortcode', '==', '1' ), |
| 469 | 545 | ), |
| 470 | 546 | ), |
| 471 | -) ); | |
| 547 | +), | |
| 548 | +); | |