PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.2
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
← All changes | inc/modules/pre-orders/admin/options.php +202 -4 2.2.72.3.2 View file →
@@ -14,11 +14,10 @@
14 14 * Hook functionality before including modules options.
15 15 *
16 16 * @since 1.9.8
17 17 */
18 -do_action( 'merchant_admin_before_include_modules_options', Merchant_Pre_Orders::MODULE_ID );
19 18
20 -Merchant_Admin_Options::create(
19 +return array(
21 20 array(
22 21 'title' => esc_html__( 'Pre-order Rule', 'merchant' ),
23 22 'module' => Merchant_Pre_Orders::MODULE_ID,
24 23 'fields' => array(
@@ -44,8 +43,11 @@
44 43 'active' => esc_html__( 'Active', 'merchant' ),
45 44 'inactive' => esc_html__( 'Inactive', 'merchant' ),
46 45 ),
47 46 'default' => 'active',
47 + 'ai_meta' => array(
48 + 'usage_hint' => 'Controls whether this campaign is active or inactive. Set to active to enable, inactive to disable.',
49 + ),
48 50 ),
49 51 array(
50 52 'id' => 'offer-title',
51 53 'type' => 'text',
@@ -64,8 +66,12 @@
64 66 'tags' => esc_html__( 'Specific Tags', 'merchant' ),
65 67 'brands' => esc_html__( 'Specific Brands', 'merchant' ),
66 68 ),
67 69 'default' => 'product',
70 + 'ai_meta' => array(
71 + 'semantic_group' => 'product_targeting',
72 + 'usage_hint' => 'Controls which products this pre-order campaign applies to. Set this BEFORE setting product_ids, category_slugs, tag_slugs, or brand_slugs — those fields are conditional on this value.',
73 + ),
68 74 ),
69 75 array(
70 76 'id' => 'product_ids',
71 77 'type' => 'products_selector',
@@ -72,8 +78,16 @@
72 78 'multiple' => true,
73 79 'allowed_types' => array( 'simple', 'variable', 'variation', 'merchant_pro_bundle' ),
74 80 'desc' => esc_html__( 'Select the product(s) included in this pre-order.', 'merchant' ),
75 81 'condition' => array( 'trigger_on', '==', 'product' ),
82 + 'ai_meta' => array(
83 + 'entity' => 'product',
84 + 'reference_type' => 'static',
85 + 'value_format' => 'product_id',
86 + 'semantic_group' => 'product_targeting',
87 + 'abstraction_level' => 1,
88 + 'usage_hint' => 'Product IDs included in this pre-order. Only used when trigger_on is set to product.',
89 + ),
76 90 ),
77 91 array(
78 92 'id' => 'category_slugs',
79 93 'type' => 'select_ajax',
@@ -83,8 +97,17 @@
83 97 'options' => Merchant_Admin_Options::get_category_select2_choices(),
84 98 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
85 99 'desc' => esc_html__( 'Select the category or categories for which the products will be available for pre-order.', 'merchant' ),
86 100 'condition' => array( 'trigger_on', '==', 'category' ),
101 + 'ai_meta' => array(
102 + 'entity' => 'category',
103 + 'reference_type' => 'dynamic',
104 + 'taxonomy' => 'product_cat',
105 + 'value_format' => 'slug',
106 + 'semantic_group' => 'product_targeting',
107 + 'abstraction_level' => 3,
108 + 'usage_hint' => 'Category slugs for this pre-order. Only used when trigger_on is set to category.',
109 + ),
87 110 ),
88 111 array(
89 112 'id' => 'tag_slugs',
90 113 'type' => 'select_ajax',
@@ -94,8 +117,17 @@
94 117 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
95 118 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
96 119 'desc' => esc_html__( 'Select the tag or tags for which the products will be available for pre-order.', 'merchant' ),
97 120 'condition' => array( 'trigger_on', '==', 'tags' ),
121 + 'ai_meta' => array(
122 + 'entity' => 'tag',
123 + 'reference_type' => 'dynamic',
124 + 'taxonomy' => 'product_tag',
125 + 'value_format' => 'slug',
126 + 'semantic_group' => 'product_targeting',
127 + 'abstraction_level' => 2,
128 + 'usage_hint' => 'Tag slugs for this pre-order. Only used when trigger_on is set to tags.',
129 + ),
98 130 ),
99 131 array(
100 132 'id' => 'brand_slugs',
101 133 'type' => 'select_ajax',
@@ -105,8 +137,17 @@
105 137 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
106 138 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
107 139 'desc' => esc_html__( 'Select the brand or brands for which the products will be available for pre-order.', 'merchant' ),
108 140 'condition' => array( 'trigger_on', '==', 'brands' ),
141 + 'ai_meta' => array(
142 + 'entity' => 'brand',
143 + 'reference_type' => 'dynamic',
144 + 'taxonomy' => 'product_brand',
145 + 'value_format' => 'slug',
146 + 'semantic_group' => 'product_targeting',
147 + 'abstraction_level' => 4,
148 + 'usage_hint' => 'Brand slugs for this pre-order. Only used when trigger_on is set to brands.',
149 + ),
109 150 ),
110 151
111 152 // Individual exclusion toggles
112 153 array(
@@ -124,8 +165,13 @@
124 165 'value' => array( 'all', 'category', 'tags', 'brands' ),
125 166 ),
126 167 ),
127 168 ),
169 + 'ai_meta' => array(
170 + 'toggle_for' => 'excluded_products',
171 + 'semantic_group' => 'product_exclusion',
172 + 'usage_hint' => 'Enable this to reveal the excluded_products field.',
173 + ),
128 174 ),
129 175
130 176 array(
131 177 'id' => 'excluded_products',
@@ -133,8 +179,17 @@
133 179 'title' => esc_html__( 'Excluded Products List', 'merchant' ),
134 180 'desc' => esc_html__( 'Exclude products from this pre-order campaign.', 'merchant' ),
135 181 'allowed_types' => array( 'simple', 'variable' ),
136 182 'multiple' => true,
183 + 'ai_meta' => array(
184 + 'entity' => 'product',
185 + 'reference_type' => 'static',
186 + 'value_format' => 'product_id',
187 + 'semantic_group' => 'product_exclusion',
188 + 'abstraction_level' => 1,
189 + 'toggled_by' => 'exclude_products_toggle',
190 + 'usage_hint' => 'Products excluded from this pre-order campaign. Requires exclude_products_toggle.',
191 + ),
137 192 'conditions' => array(
138 193 'relation' => 'AND',
139 194 'terms' => array(
140 195 array(
@@ -166,8 +221,13 @@
166 221 'value' => array( 'all', 'tags', 'brands' ),
167 222 ),
168 223 ),
169 224 ),
225 + 'ai_meta' => array(
226 + 'toggle_for' => 'excluded_categories',
227 + 'semantic_group' => 'product_exclusion',
228 + 'usage_hint' => 'Enable this to reveal the excluded_categories field.',
229 + ),
170 230 ),
171 231
172 232 array(
173 233 'id' => 'excluded_categories',
@@ -177,8 +237,18 @@
177 237 'multiple' => true,
178 238 'options' => Merchant_Admin_Options::get_category_select2_choices(),
179 239 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
180 240 'desc' => esc_html__( 'Exclude categories from this pre-order campaign.', 'merchant' ),
241 + 'ai_meta' => array(
242 + 'entity' => 'category',
243 + 'reference_type' => 'dynamic',
244 + 'taxonomy' => 'product_cat',
245 + 'value_format' => 'slug',
246 + 'semantic_group' => 'product_exclusion',
247 + 'abstraction_level' => 3,
248 + 'toggled_by' => 'exclude_categories_toggle',
249 + 'usage_hint' => 'Categories excluded from this pre-order campaign. Requires exclude_categories_toggle.',
250 + ),
181 251 'conditions' => array(
182 252 'relation' => 'AND',
183 253 'terms' => array(
184 254 array(
@@ -195,8 +265,35 @@
195 265 ),
196 266 ),
197 267
198 268 array(
269 + 'id' => 'include_subcategories',
270 + 'type' => 'switcher',
271 + 'title' => esc_html__( 'Include subcategories', 'merchant' ),
272 + 'desc' => esc_html__( 'When enabled, selecting a parent category also applies to all of its child categories.', 'merchant' ),
273 + 'default' => 0,
274 + 'conditions' => array(
275 + 'relation' => 'OR',
276 + 'terms' => array(
277 + array(
278 + 'field' => 'trigger_on',
279 + 'operator' => '===',
280 + 'value' => 'category',
281 + ),
282 + array(
283 + 'field' => 'exclude_categories_toggle',
284 + 'operator' => '===',
285 + 'value' => true,
286 + ),
287 + ),
288 + ),
289 + 'ai_meta' => array(
290 + 'semantic_group' => 'product_targeting',
291 + 'usage_hint' => 'Enable so selected parent categories also cover their child categories, for both targeting and exclusion. Off by default, which matches only the exact categories chosen.',
292 + ),
293 + ),
294 +
295 + array(
199 296 'id' => 'exclude_tags_toggle',
200 297 'type' => 'switcher',
201 298 'title' => esc_html__( 'Exclude tags', 'merchant' ),
202 299 'desc' => esc_html__( 'Exclude specific tags from this pre-order campaign.', 'merchant' ),
@@ -210,8 +307,13 @@
210 307 'value' => array( 'all', 'category', 'brands' ),
211 308 ),
212 309 ),
213 310 ),
311 + 'ai_meta' => array(
312 + 'toggle_for' => 'excluded_tags',
313 + 'semantic_group' => 'product_exclusion',
314 + 'usage_hint' => 'Enable this to reveal the excluded_tags field.',
315 + ),
214 316 ),
215 317
216 318 array(
217 319 'id' => 'excluded_tags',
@@ -221,8 +323,18 @@
221 323 'multiple' => true,
222 324 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
223 325 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
224 326 'desc' => esc_html__( 'Exclude tags from this pre-order campaign.', 'merchant' ),
327 + 'ai_meta' => array(
328 + 'entity' => 'tag',
329 + 'reference_type' => 'dynamic',
330 + 'taxonomy' => 'product_tag',
331 + 'value_format' => 'slug',
332 + 'semantic_group' => 'product_exclusion',
333 + 'abstraction_level' => 2,
334 + 'toggled_by' => 'exclude_tags_toggle',
335 + 'usage_hint' => 'Tags excluded from this pre-order campaign. Requires exclude_tags_toggle.',
336 + ),
225 337 'conditions' => array(
226 338 'relation' => 'AND',
227 339 'terms' => array(
228 340 array(
@@ -254,8 +366,13 @@
254 366 'value' => array( 'all', 'category', 'tags' ),
255 367 ),
256 368 ),
257 369 ),
370 + 'ai_meta' => array(
371 + 'toggle_for' => 'excluded_brands',
372 + 'semantic_group' => 'product_exclusion',
373 + 'usage_hint' => 'Enable this to reveal the excluded_brands field.',
374 + ),
258 375 ),
259 376
260 377 array(
261 378 'id' => 'excluded_brands',
@@ -265,8 +382,18 @@
265 382 'multiple' => true,
266 383 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
267 384 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
268 385 'desc' => esc_html__( 'Exclude brands from this pre-order campaign.', 'merchant' ),
386 + 'ai_meta' => array(
387 + 'entity' => 'brand',
388 + 'reference_type' => 'dynamic',
389 + 'taxonomy' => 'product_brand',
390 + 'value_format' => 'slug',
391 + 'semantic_group' => 'product_exclusion',
392 + 'abstraction_level' => 4,
393 + 'toggled_by' => 'exclude_brands_toggle',
394 + 'usage_hint' => 'Brands excluded from this pre-order campaign. Requires exclude_brands_toggle.',
395 + ),
269 396 'conditions' => array(
270 397 'relation' => 'AND',
271 398 'terms' => array(
272 399 array(
@@ -287,8 +414,13 @@
287 414 'id' => 'discount_toggle',
288 415 'type' => 'switcher',
289 416 'title' => __( 'Do you want to offer a discount on this pre-order?', 'merchant' ),
290 417 'default' => 0,
418 + 'ai_meta' => array(
419 + 'toggle_for' => 'discount_type',
420 + 'semantic_group' => 'offer_rules',
421 + 'usage_hint' => 'Enable this to reveal discount_type and discount_amount fields for this pre-order.',
422 + ),
291 423 ),
292 424 array(
293 425 'id' => 'discount_type',
294 426 'type' => 'radio',
@@ -297,8 +429,12 @@
297 429 'percentage' => esc_html__( 'Percentage', 'merchant' ),
298 430 'fixed' => esc_html__( 'Fixed', 'merchant' ),
299 431 ),
300 432 'default' => 'percentage',
433 + 'ai_meta' => array(
434 + 'semantic_group' => 'offer_rules',
435 + 'usage_hint' => 'Type of discount applied to this pre-order. Only relevant when discount_toggle is enabled.',
436 + ),
301 437 'conditions' => array(
302 438 'terms' => array(
303 439 array(
304 440 'field' => 'discount_toggle', // field ID
@@ -312,8 +448,12 @@
312 448 'id' => 'discount_amount',
313 449 'type' => 'number',
314 450 'step' => 0.01,
315 451 'default' => 10,
452 + 'ai_meta' => array(
453 + 'semantic_group' => 'offer_rules',
454 + 'usage_hint' => 'Discount amount for this pre-order. Interpretation depends on discount_type (percentage or fixed). Only relevant when discount_toggle is enabled.',
455 + ),
316 456 'conditions' => array(
317 457 'terms' => array(
318 458 array(
319 459 'field' => 'discount_toggle', // field ID
@@ -334,8 +474,13 @@
334 474 'merchant' ),
335 475 '<strong>' . wp_timezone_string() . '</strong>',
336 476 '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '" target="_blank">' . esc_html__( 'WordPress Settings', 'merchant' ) . '</a>'
337 477 ),
478 + 'ai_meta' => array(
479 + 'allow_empty' => false,
480 + 'value_format' => 'm-d-Y h:i A',
481 + 'usage_hint' => 'Required. Shipping date in m-d-Y h:i A format (e.g., 06-24-2026 03:30 PM). Uses WordPress timezone.',
482 + ),
338 483 ),
339 484 array(
340 485 'id' => 'pre_order_start',
341 486 'type' => 'date_time',
@@ -341,8 +486,13 @@
341 486 'type' => 'date_time',
342 487 'title' => esc_html__( 'Pre-order starts at', 'merchant' ),
343 488 'placeholder' => esc_html__( 'mm/dd/yy, --:-- --', 'merchant' ),
344 489 'desc' => esc_html__( 'If you want your pre-order settings to take effect immediately, leave the pre-order start empty.', 'merchant' ),
490 + 'ai_meta' => array(
491 + 'allow_empty' => true,
492 + 'value_format' => 'm-d-Y h:i A',
493 + 'usage_hint' => 'Optional. Leave empty to start immediately. Format: m-d-Y h:i A (e.g., 06-24-2026 03:30 PM).',
494 + ),
345 495 ),
346 496 array(
347 497 'id' => 'pre_order_end',
348 498 'type' => 'date_time',
@@ -354,8 +504,13 @@
354 504 'merchant' ),
355 505 '<strong>' . wp_timezone_string() . '</strong>',
356 506 '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '" target="_blank">' . esc_html__( 'WordPress Settings', 'merchant' ) . '</a>'
357 507 ),
508 + 'ai_meta' => array(
509 + 'allow_empty' => true,
510 + 'value_format' => 'm-d-Y h:i A',
511 + 'usage_hint' => 'Optional. Leave empty for no end date. Format: m-d-Y h:i A (e.g., 06-24-2026 03:30 PM).',
512 + ),
358 513 ),
359 514
360 515 array(
361 516 'id' => 'user_condition',
@@ -366,8 +521,12 @@
366 521 'customers' => esc_html__( 'Selected Users', 'merchant' ),
367 522 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
368 523 ),
369 524 'default' => 'all',
525 + 'ai_meta' => array(
526 + 'semantic_group' => 'user_targeting',
527 + 'usage_hint' => 'Controls which users see this pre-order campaign. Set this BEFORE setting user_condition_users or user_condition_roles.',
528 + ),
370 529 ),
371 530
372 531 array(
373 532 'id' => 'user_condition_roles',
@@ -378,8 +537,16 @@
378 537 'multiple' => true,
379 538 'classes' => array( 'flex-grow' ),
380 539 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
381 540 'condition' => array( 'user_condition', '==', 'roles' ),
541 + 'ai_meta' => array(
542 + 'entity' => 'role',
543 + 'reference_type' => 'dynamic',
544 + 'value_format' => 'role_slug',
545 + 'semantic_group' => 'user_targeting',
546 + 'abstraction_level' => 2,
547 + 'usage_hint' => 'Roles allowed for this pre-order campaign. Only used when user_condition is roles.',
548 + ),
382 549 ),
383 550
384 551 array(
385 552 'id' => 'user_condition_users',
@@ -389,8 +556,16 @@
389 556 'source' => 'user',
390 557 'multiple' => true,
391 558 'classes' => array( 'flex-grow' ),
392 559 'condition' => array( 'user_condition', '==', 'customers' ),
560 + 'ai_meta' => array(
561 + 'entity' => 'user',
562 + 'reference_type' => 'static',
563 + 'value_format' => 'user_id',
564 + 'semantic_group' => 'user_targeting',
565 + 'abstraction_level' => 1,
566 + 'usage_hint' => 'Specific users for this pre-order campaign. Only used when user_condition is customers.',
567 + ),
393 568 ),
394 569
395 570 array(
396 571 'id' => 'user_exclusion_enabled',
@@ -407,8 +582,13 @@
407 582 'value' => array( 'all', 'roles' ),
408 583 ),
409 584 ),
410 585 ),
586 + 'ai_meta' => array(
587 + 'toggle_for' => 'exclude_roles',
588 + 'semantic_group' => 'user_exclusion',
589 + 'usage_hint' => 'Enable this to reveal exclude_roles and exclude_users fields.',
590 + ),
411 591 ),
412 592
413 593 array(
414 594 'id' => 'exclude_roles',
@@ -418,8 +598,17 @@
418 598 'source' => 'options',
419 599 'multiple' => true,
420 600 'classes' => array( 'flex-grow' ),
421 601 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
602 + 'ai_meta' => array(
603 + 'entity' => 'role',
604 + 'reference_type' => 'dynamic',
605 + 'value_format' => 'role_slug',
606 + 'semantic_group' => 'user_exclusion',
607 + 'abstraction_level' => 2,
608 + 'toggled_by' => 'user_exclusion_enabled',
609 + 'usage_hint' => 'Roles excluded from this pre-order campaign. Requires user_exclusion_enabled.',
610 + ),
422 611 'conditions' => array(
423 612 'relation' => 'AND',
424 613 'terms' => array(
425 614 array(
@@ -443,8 +632,17 @@
443 632 'desc' => esc_html__( 'This will exclude the offer for the selected customers.', 'merchant' ),
444 633 'source' => 'user',
445 634 'multiple' => true,
446 635 'classes' => array( 'flex-grow' ),
636 + 'ai_meta' => array(
637 + 'entity' => 'user',
638 + 'reference_type' => 'static',
639 + 'value_format' => 'user_id',
640 + 'semantic_group' => 'user_exclusion',
641 + 'abstraction_level' => 1,
642 + 'toggled_by' => 'user_exclusion_enabled',
643 + 'usage_hint' => 'Users excluded from this pre-order campaign. Requires user_exclusion_enabled.',
644 + ),
447 645 'conditions' => array(
448 646 'relation' => 'AND',
449 647 'terms' => array(
450 648 array(
@@ -629,6 +827,6 @@
629 827 ),
630 828 ),
631 829 ),
632 830 ),
633 - )
634 -);
831 + ),
832 +);