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 +515 -13 1.9.112.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(
@@ -25,17 +24,32 @@
25 24 array(
26 25 'id' => 'rules',
27 26 'type' => 'flexible_content',
28 27 'sorting' => true,
28 + 'duplicate' => true,
29 29 'accordion' => true,
30 30 'style' => Merchant_Pre_Orders::MODULE_ID . '-style default',
31 - 'button_label' => esc_html__( 'Add New Offer', 'merchant' ),
31 + 'button_label' => esc_html__( 'Add New Pre-Order', 'merchant' ),
32 32 'layouts' => array(
33 33 'rule-details' => array(
34 34 'title' => esc_html__( 'Campaign', 'merchant' ),
35 35 'title-field' => 'offer-title', // text field ID to use as title for the layout
36 + 'status-field' => 'campaign_status',
36 37 'fields' => array(
37 38 array(
39 + 'id' => 'campaign_status',
40 + 'type' => 'select',
41 + 'title' => esc_html__( 'Status', 'merchant' ),
42 + 'options' => array(
43 + 'active' => esc_html__( 'Active', 'merchant' ),
44 + 'inactive' => esc_html__( 'Inactive', 'merchant' ),
45 + ),
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 + ),
50 + ),
51 + array(
38 52 'id' => 'offer-title',
39 53 'type' => 'text',
40 54 'title' => esc_html__( 'Order name', 'merchant' ),
41 55 'default' => esc_html__( 'Custom Pre-order', 'merchant' ),
@@ -45,20 +59,35 @@
45 59 'id' => 'trigger_on',
46 60 'type' => 'select',
47 61 'title' => esc_html__( 'Trigger', 'merchant' ),
48 62 'options' => array(
49 - 'product' => esc_html__( 'Specific product', 'merchant' ),
50 - 'category' => esc_html__( 'Specific category', 'merchant' ),
63 + 'all' => esc_html__( 'All Products', 'merchant' ),
64 + 'product' => esc_html__( 'Specific Products', 'merchant' ),
65 + 'category' => esc_html__( 'Specific Categories', 'merchant' ),
66 + 'tags' => esc_html__( 'Specific Tags', 'merchant' ),
67 + 'brands' => esc_html__( 'Specific Brands', 'merchant' ),
51 68 ),
52 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 + ),
53 74 ),
54 75 array(
55 76 'id' => 'product_ids',
56 77 'type' => 'products_selector',
57 78 'multiple' => true,
58 - 'allowed_types' => array( 'simple', 'variable', 'variation' ),
79 + 'allowed_types' => array( 'simple', 'variable', 'variation', 'merchant_pro_bundle' ),
59 80 'desc' => esc_html__( 'Select the product(s) included in this pre-order.', 'merchant' ),
60 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 + ),
61 90 ),
62 91 array(
63 92 'id' => 'category_slugs',
64 93 'type' => 'select_ajax',
@@ -66,16 +95,332 @@
66 95 'source' => 'options',
67 96 'multiple' => true,
68 97 'options' => Merchant_Admin_Options::get_category_select2_choices(),
69 98 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
70 - 'desc' => esc_html__( 'Select the product categories that will show the offer.', 'merchant' ),
99 + 'desc' => esc_html__( 'Select the category or categories for which the products will be available for pre-order.', 'merchant' ),
71 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 + ),
72 110 ),
73 111 array(
112 + 'id' => 'tag_slugs',
113 + 'type' => 'select_ajax',
114 + 'title' => esc_html__( 'Tags', 'merchant' ),
115 + 'source' => 'options',
116 + 'multiple' => true,
117 + 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
118 + 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
119 + 'desc' => esc_html__( 'Select the tag or tags for which the products will be available for pre-order.', 'merchant' ),
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 + ),
130 + ),
131 + array(
132 + 'id' => 'brand_slugs',
133 + 'type' => 'select_ajax',
134 + 'title' => esc_html__( 'Brands', 'merchant' ),
135 + 'source' => 'options',
136 + 'multiple' => true,
137 + 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
138 + 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
139 + 'desc' => esc_html__( 'Select the brand or brands for which the products will be available for pre-order.', 'merchant' ),
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 + ),
150 + ),
151 +
152 + // Individual exclusion toggles
153 + array(
154 + 'id' => 'exclude_products_toggle',
155 + 'type' => 'switcher',
156 + 'title' => esc_html__( 'Exclude products', 'merchant' ),
157 + 'desc' => esc_html__( 'Exclude specific products from this pre-order campaign.', 'merchant' ),
158 + 'default' => 0,
159 + 'conditions' => array(
160 + 'relation' => 'AND',
161 + 'terms' => array(
162 + array(
163 + 'field' => 'trigger_on',
164 + 'operator' => 'in',
165 + 'value' => array( 'all', 'category', 'tags', 'brands' ),
166 + ),
167 + ),
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 + ),
174 + ),
175 +
176 + array(
177 + 'id' => 'excluded_products',
178 + 'type' => 'products_selector',
179 + 'title' => esc_html__( 'Excluded Products List', 'merchant' ),
180 + 'desc' => esc_html__( 'Exclude products from this pre-order campaign.', 'merchant' ),
181 + 'allowed_types' => array( 'simple', 'variable' ),
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 + ),
192 + 'conditions' => array(
193 + 'relation' => 'AND',
194 + 'terms' => array(
195 + array(
196 + 'field' => 'trigger_on',
197 + 'operator' => 'in',
198 + 'value' => array( 'all', 'category', 'tags', 'brands' ),
199 + ),
200 + array(
201 + 'field' => 'exclude_products_toggle',
202 + 'operator' => '===',
203 + 'value' => true,
204 + ),
205 + ),
206 + ),
207 + ),
208 +
209 + array(
210 + 'id' => 'exclude_categories_toggle',
211 + 'type' => 'switcher',
212 + 'title' => esc_html__( 'Exclude categories', 'merchant' ),
213 + 'desc' => esc_html__( 'Exclude specific categories from this pre-order campaign.', 'merchant' ),
214 + 'default' => 0,
215 + 'conditions' => array(
216 + 'relation' => 'AND',
217 + 'terms' => array(
218 + array(
219 + 'field' => 'trigger_on',
220 + 'operator' => 'in',
221 + 'value' => array( 'all', 'tags', 'brands' ),
222 + ),
223 + ),
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 + ),
230 + ),
231 +
232 + array(
233 + 'id' => 'excluded_categories',
234 + 'type' => 'select_ajax',
235 + 'title' => esc_html__( 'Excluded Categories List', 'merchant' ),
236 + 'source' => 'options',
237 + 'multiple' => true,
238 + 'options' => Merchant_Admin_Options::get_category_select2_choices(),
239 + 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
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 + ),
251 + 'conditions' => array(
252 + 'relation' => 'AND',
253 + 'terms' => array(
254 + array(
255 + 'field' => 'trigger_on',
256 + 'operator' => 'in',
257 + 'value' => array( 'all', 'tags', 'brands' ),
258 + ),
259 + array(
260 + 'field' => 'exclude_categories_toggle',
261 + 'operator' => '===',
262 + 'value' => true,
263 + ),
264 + ),
265 + ),
266 + ),
267 +
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(
296 + 'id' => 'exclude_tags_toggle',
297 + 'type' => 'switcher',
298 + 'title' => esc_html__( 'Exclude tags', 'merchant' ),
299 + 'desc' => esc_html__( 'Exclude specific tags from this pre-order campaign.', 'merchant' ),
300 + 'default' => 0,
301 + 'conditions' => array(
302 + 'relation' => 'AND',
303 + 'terms' => array(
304 + array(
305 + 'field' => 'trigger_on',
306 + 'operator' => 'in',
307 + 'value' => array( 'all', 'category', 'brands' ),
308 + ),
309 + ),
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 + ),
316 + ),
317 +
318 + array(
319 + 'id' => 'excluded_tags',
320 + 'type' => 'select_ajax',
321 + 'title' => esc_html__( 'Excluded Tags List', 'merchant' ),
322 + 'source' => 'options',
323 + 'multiple' => true,
324 + 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
325 + 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
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 + ),
337 + 'conditions' => array(
338 + 'relation' => 'AND',
339 + 'terms' => array(
340 + array(
341 + 'field' => 'trigger_on',
342 + 'operator' => 'in',
343 + 'value' => array( 'all', 'category', 'brands' ),
344 + ),
345 + array(
346 + 'field' => 'exclude_tags_toggle',
347 + 'operator' => '===',
348 + 'value' => true,
349 + ),
350 + ),
351 + ),
352 + ),
353 +
354 + array(
355 + 'id' => 'exclude_brands_toggle',
356 + 'type' => 'switcher',
357 + 'title' => esc_html__( 'Exclude brands', 'merchant' ),
358 + 'desc' => esc_html__( 'Exclude specific brands from this pre-order campaign.', 'merchant' ),
359 + 'default' => 0,
360 + 'conditions' => array(
361 + 'relation' => 'AND',
362 + 'terms' => array(
363 + array(
364 + 'field' => 'trigger_on',
365 + 'operator' => 'in',
366 + 'value' => array( 'all', 'category', 'tags' ),
367 + ),
368 + ),
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 + ),
375 + ),
376 +
377 + array(
378 + 'id' => 'excluded_brands',
379 + 'type' => 'select_ajax',
380 + 'title' => esc_html__( 'Excluded Brands List', 'merchant' ),
381 + 'source' => 'options',
382 + 'multiple' => true,
383 + 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
384 + 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
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 + ),
396 + 'conditions' => array(
397 + 'relation' => 'AND',
398 + 'terms' => array(
399 + array(
400 + 'field' => 'trigger_on',
401 + 'operator' => 'in',
402 + 'value' => array( 'all', 'category', 'tags' ),
403 + ),
404 + array(
405 + 'field' => 'exclude_brands_toggle',
406 + 'operator' => '===',
407 + 'value' => true,
408 + ),
409 + ),
410 + ),
411 + ),
412 +
413 + array(
74 414 'id' => 'discount_toggle',
75 415 'type' => 'switcher',
76 416 'title' => __( 'Do you want to offer a discount on this pre-order?', 'merchant' ),
77 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 + ),
78 423 ),
79 424 array(
80 425 'id' => 'discount_type',
81 426 'type' => 'radio',
@@ -84,8 +429,12 @@
84 429 'percentage' => esc_html__( 'Percentage', 'merchant' ),
85 430 'fixed' => esc_html__( 'Fixed', 'merchant' ),
86 431 ),
87 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 + ),
88 437 'conditions' => array(
89 438 'terms' => array(
90 439 array(
91 440 'field' => 'discount_toggle', // field ID
@@ -96,10 +445,15 @@
96 445 ),
97 446 ),
98 447 array(
99 448 'id' => 'discount_amount',
100 - 'type' => 'text',
449 + 'type' => 'number',
450 + 'step' => 0.01,
101 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 + ),
102 456 'conditions' => array(
103 457 'terms' => array(
104 458 array(
105 459 'field' => 'discount_toggle', // field ID
@@ -120,8 +474,13 @@
120 474 'merchant' ),
121 475 '<strong>' . wp_timezone_string() . '</strong>',
122 476 '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '" target="_blank">' . esc_html__( 'WordPress Settings', 'merchant' ) . '</a>'
123 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 + ),
124 483 ),
125 484 array(
126 485 'id' => 'pre_order_start',
127 486 'type' => 'date_time',
@@ -127,8 +486,13 @@
127 486 'type' => 'date_time',
128 487 'title' => esc_html__( 'Pre-order starts at', 'merchant' ),
129 488 'placeholder' => esc_html__( 'mm/dd/yy, --:-- --', 'merchant' ),
130 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 + ),
131 495 ),
132 496 array(
133 497 'id' => 'pre_order_end',
134 498 'type' => 'date_time',
@@ -140,8 +504,13 @@
140 504 'merchant' ),
141 505 '<strong>' . wp_timezone_string() . '</strong>',
142 506 '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '" target="_blank">' . esc_html__( 'WordPress Settings', 'merchant' ) . '</a>'
143 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 + ),
144 513 ),
145 514
146 515 array(
147 516 'id' => 'user_condition',
@@ -152,8 +521,12 @@
152 521 'customers' => esc_html__( 'Selected Users', 'merchant' ),
153 522 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
154 523 ),
155 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 + ),
156 529 ),
157 530
158 531 array(
159 532 'id' => 'user_condition_roles',
@@ -164,8 +537,16 @@
164 537 'multiple' => true,
165 538 'classes' => array( 'flex-grow' ),
166 539 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
167 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 + ),
168 549 ),
169 550
170 551 array(
171 552 'id' => 'user_condition_users',
@@ -175,14 +556,115 @@
175 556 'source' => 'user',
176 557 'multiple' => true,
177 558 'classes' => array( 'flex-grow' ),
178 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 + ),
179 568 ),
569 +
180 570 array(
571 + 'id' => 'user_exclusion_enabled',
572 + 'type' => 'switcher',
573 + 'title' => esc_html__( 'Exclusion List', 'merchant' ),
574 + 'desc' => esc_html__( 'Select the users that will not show the offer.', 'merchant' ),
575 + 'default' => 0,
576 + 'conditions' => array(
577 + 'relation' => 'AND',
578 + 'terms' => array(
579 + array(
580 + 'field' => 'user_condition',
581 + 'operator' => 'in',
582 + 'value' => array( 'all', 'roles' ),
583 + ),
584 + ),
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 + ),
591 + ),
592 +
593 + array(
594 + 'id' => 'exclude_roles',
595 + 'type' => 'select_ajax',
596 + 'title' => esc_html__( 'Exclude Roles', 'merchant' ),
597 + 'desc' => esc_html__( 'This will exclude the offer for users with these roles.', 'merchant' ),
598 + 'source' => 'options',
599 + 'multiple' => true,
600 + 'classes' => array( 'flex-grow' ),
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 + ),
611 + 'conditions' => array(
612 + 'relation' => 'AND',
613 + 'terms' => array(
614 + array(
615 + 'field' => 'user_condition',
616 + 'operator' => 'in',
617 + 'value' => array( 'all' ),
618 + ),
619 + array(
620 + 'field' => 'user_exclusion_enabled',
621 + 'operator' => '===',
622 + 'value' => true,
623 + ),
624 + ),
625 + ),
626 + ),
627 +
628 + array(
629 + 'id' => 'exclude_users',
630 + 'type' => 'select_ajax',
631 + 'title' => esc_html__( 'Exclude Users', 'merchant' ),
632 + 'desc' => esc_html__( 'This will exclude the offer for the selected customers.', 'merchant' ),
633 + 'source' => 'user',
634 + 'multiple' => true,
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 + ),
645 + 'conditions' => array(
646 + 'relation' => 'AND',
647 + 'terms' => array(
648 + array(
649 + 'field' => 'user_condition',
650 + 'operator' => 'in',
651 + 'value' => array( 'all', 'roles' ),
652 + ),
653 + array(
654 + 'field' => 'user_exclusion_enabled',
655 + 'operator' => '===',
656 + 'value' => true,
657 + ),
658 + ),
659 + ),
660 + ),
661 +
662 + array(
181 663 'id' => 'button_text',
182 664 'type' => 'text',
183 665 'title' => esc_html__( 'Button text', 'merchant' ),
184 - 'default' => esc_html__( 'Pre-Order Now!', 'merchant' ),
666 + 'default' => esc_html__( 'Pre-Order', 'merchant' ),
185 667 ),
186 668
187 669 array(
188 670 'id' => 'additional_text',
@@ -235,8 +717,28 @@
235 717 'default' => '#414141',
236 718 ),
237 719
238 720 array(
721 + 'id' => 'border-width',
722 + 'type' => 'range',
723 + 'title' => esc_html__( 'Button Border Width (px)', 'merchant' ),
724 + 'min' => 0,
725 + 'max' => 10,
726 + 'step' => 1,
727 + 'default' => 0,
728 + ),
729 +
730 + array(
731 + 'id' => 'border-radius',
732 + 'type' => 'range',
733 + 'title' => esc_html__( 'Button Border Radius (px)', 'merchant' ),
734 + 'min' => 0,
735 + 'max' => 50,
736 + 'step' => 1,
737 + 'default' => 0,
738 + ),
739 +
740 + array(
239 741 'id' => 'background-color',
240 742 'type' => 'color',
241 743 'title' => esc_html__( 'Button background color', 'merchant' ),
242 744 'default' => '#212121',
@@ -263,10 +765,10 @@
263 765 'title' => esc_html__( 'Pre-order Modes', 'merchant' ),
264 766 'options' => array(
265 767 'only_pre_orders' => esc_html__( 'Allow only pre-orders', 'merchant' ),
266 768 'unified_order' => esc_html__( 'Treat the whole order as pre-order', 'merchant' ),
267 - 'separate_order_for_pre_orders' => esc_html__( 'Generate separate orders for each pre-order product', 'merchant' ),
268 - 'group_pre_order_into_one_order' => esc_html__( 'Generate two separate orders, one for pre-orders and one for in-stock products', 'merchant' ),
769 +// 'separate_order_for_pre_orders' => esc_html__( 'Generate separate orders for each pre-order product', 'merchant' ),
770 +// 'group_pre_order_into_one_order' => esc_html__( 'Generate two separate orders, one for pre-orders and one for in-stock products', 'merchant' ),
269 771 ),
270 772 'default' => 'unified_order',
271 773 ),
272 774 array(
@@ -325,6 +827,6 @@
325 827 ),
326 828 ),
327 829 ),
328 830 ),
329 - )
330 -);
831 + ),
832 +);