| @@ -370,8 +370,34 @@ | ||
| 370 | 370 | 'usage_hint' => 'Cart products from these categories will NOT trigger this upsell. Dynamic: future products in the category are automatically excluded. Requires exclusion_toggle=true and upsell_based_on=all.', |
| 371 | 371 | ), |
| 372 | 372 | ), |
| 373 | 373 | array( |
| 374 | + 'id' => 'include_subcategories', | |
| 375 | + 'type' => 'switcher', | |
| 376 | + 'title' => esc_html__( 'Include subcategories', 'merchant' ), | |
| 377 | + 'desc' => esc_html__( 'When enabled, selecting a parent category also applies to all of its child categories.', 'merchant' ), | |
| 378 | + 'default' => 0, | |
| 379 | + 'conditions' => array( | |
| 380 | + 'relation' => 'OR', | |
| 381 | + 'terms' => array( | |
| 382 | + array( | |
| 383 | + 'field' => 'upsell_based_on', | |
| 384 | + 'operator' => '===', | |
| 385 | + 'value' => 'categories', | |
| 386 | + ), | |
| 387 | + array( | |
| 388 | + 'field' => 'exclusion_toggle', | |
| 389 | + 'operator' => '===', | |
| 390 | + 'value' => true, | |
| 391 | + ), | |
| 392 | + ), | |
| 393 | + ), | |
| 394 | + 'ai_meta' => array( | |
| 395 | + 'semantic_group' => 'product_targeting', | |
| 396 | + 'usage_hint' => 'Enable so selected parent categories also cover their child categories, for both the upsell trigger and the category exclusion. Off by default, which matches only the exact categories chosen. Does not affect which products are recommended.', | |
| 397 | + ), | |
| 398 | + ), | |
| 399 | + array( | |
| 374 | 400 | 'id' => 'custom_upsell_type', |
| 375 | 401 | 'type' => 'select', |
| 376 | 402 | 'title' => esc_html__( 'Trigger upsells', 'merchant' ), |
| 377 | 403 | 'options' => array( |