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
merchant / inc / modules / product-labels / admin / options.php

options.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 2.3.2, at inc/modules/product-labels/admin/options.php

706 lines 25.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Merchant - Product Labels
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10 $text_shapes = array();
11 $image_shapes = array();
12
13 for ( $i = 1; $i <= 24; $i++ ) {
14 if ( $i <= 8 ) {
15 $text_shapes[ 'text-shape-' . $i ] = MERCHANT_URI . 'assets/images/icons/product-labels/text-shape-' . $i . '.svg';
16 }
17
18 $image_shapes[ 'image-shape-' . $i ] = MERCHANT_URI . 'assets/images/icons/product-labels/image-shape-' . $i . '.svg';
19 }
20
21 $display_rules = array(
22 'featured_products' => esc_html__( 'Featured Products', 'merchant' ),
23 'products_on_sale' => esc_html__( 'Products on Sale', 'merchant' ),
24 'new_products' => esc_html__( 'New Products', 'merchant' ),
25 'out_of_stock' => esc_html__( 'Out of Stock Products', 'merchant' ),
26 'all_products' => esc_html__( 'All Products', 'merchant' ),
27 'specific_products' => esc_html__( 'Specific Products', 'merchant' ),
28 'by_category' => esc_html__( 'Specific Categories', 'merchant' ),
29 'by_tags' => esc_html__( 'Specific Tags', 'merchant' ),
30 'by_brands' => esc_html__( 'Specific Brands', 'merchant' ),
31 );
32
33 /**
34 * `merchant_product_labels_display_rules`
35 *
36 * @since 1.10.1
37 */
38 $display_rules = apply_filters( 'merchant_product_labels_display_rules', $display_rules, Merchant_Product_Labels::MODULE_ID );
39
40 /**
41 * Settings
42 */
43
44 return array(
45 array(
46 'title' => esc_html__( 'Settings', 'merchant' ),
47 'module' => Merchant_Product_Labels::MODULE_ID,
48 'fields' => array(
49 array(
50 'id' => 'labels',
51 'type' => 'flexible_content',
52 'sorting' => true,
53 'accordion' => true,
54 'duplicate' => true,
55 'style' => Merchant_Product_Labels::MODULE_ID . '-style default',
56 'button_label' => esc_html__( 'Add New Label', 'merchant' ),
57 'layouts' => array(
58 'single-label' => array(
59 'title' => esc_html__( 'Product label', 'merchant' ),
60 'title-field' => 'label-title',
61 'status-field' => 'campaign_status',
62 'fields' => array(
63 array(
64 'id' => 'campaign_status',
65 'type' => 'select',
66 'title' => esc_html__( 'Status', 'merchant' ),
67 'options' => array(
68 'active' => esc_html__( 'Active', 'merchant' ),
69 'inactive' => esc_html__( 'Inactive', 'merchant' ),
70 ),
71 'default' => 'active',
72 'ai_meta' => array(
73 'usage_hint' => 'Controls whether this label is active or inactive.',
74 ),
75 ),
76 array(
77 'id' => 'label-title',
78 'title' => esc_html__( 'Label name', 'merchant' ),
79 'desc' => esc_html__( 'Internal label name. This is not visible to customers.', 'merchant' ),
80 'type' => 'text',
81 'default' => esc_html__( 'Product label', 'merchant' ),
82 ),
83
84 array(
85 'id' => 'label_type',
86 'type' => 'buttons_content',
87 'title' => '',
88 'desc' => '',
89 'options' => array(
90 'text' => array(
91 'title' => esc_html__( 'Text', 'merchant' ),
92 'desc' => esc_html__( 'Add text label', 'merchant' ),
93 'icon' => MERCHANT_URI . 'assets/images/icons/product-labels/text-icon.svg',
94 ),
95 'image' => array(
96 'title' => esc_html__( 'Image', 'merchant' ),
97 'desc' => esc_html__( 'Add image label', 'merchant' ),
98 'icon' => MERCHANT_URI . 'assets/images/icons/product-labels/image-icon.svg',
99 ),
100 ),
101 'default' => 'text',
102 ),
103
104 array(
105 'id' => 'label',
106 'title' => esc_html__( 'Label content', 'merchant' ),
107 'type' => 'text',
108 'default' => esc_html__( 'SALE', 'merchant' ),
109 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
110 'hidden_desc' => sprintf(
111 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
112 __(
113 '<strong>%1$s:</strong> to show discount percentage<br><strong>%2$s:</strong> to show discount amount<br><strong>%3$s:</strong> to show In Stock, Sold Out<br><strong>%4$s:</strong> to show total quantity in inventory',
114 'merchant'
115 ),
116 '{sale}',
117 '{sale_amount}',
118 '{inventory}',
119 '{inventory_quantity}'
120 ),
121 'condition' => array( 'label_type', '==', 'text' ),
122 ),
123
124 array(
125 'id' => 'label_text_shape',
126 'type' => 'choices',
127 'title' => esc_html__( 'Label shape', 'merchant' ),
128 'options' => $text_shapes,
129 'default' => 'text-shape-1',
130 'condition' => array( 'label_type', '==', 'text' ),
131 ),
132
133 array(
134 'id' => 'label_image_shape',
135 'type' => 'choices',
136 'title' => esc_html__( 'Image label', 'merchant' ),
137 'options' => $image_shapes,
138 'default' => 'image-shape-1',
139 'condition' => array( 'label_type', '==', 'image' ),
140 ),
141
142 array(
143 'id' => 'label_image_shape_custom',
144 'type' => 'upload',
145 'drag_drop' => true,
146 'title' => esc_html__( 'Upload custom image label', 'merchant' ),
147 'label' => esc_html__( 'Click to upload or drag and drop', 'merchant' ),
148 'condition' => array( 'label_type', '==', 'image' ),
149 ),
150
151 array(
152 'id' => 'position_anchor',
153 'type' => 'select',
154 'title' => esc_html__( 'Anchor Point', 'merchant' ),
155 'desc' => esc_html__( 'Which point of the label to use as the anchor for positioning.', 'merchant' ),
156 'options' => array(
157 'top-left' => esc_html__( 'Top Left', 'merchant' ),
158 'top-right' => esc_html__( 'Top Right', 'merchant' ),
159 ),
160 'default' => 'top-left',
161 ),
162
163 array(
164 'id' => 'position_x',
165 'type' => 'range',
166 'title' => esc_html__( 'Horizontal Position (X)', 'merchant' ),
167 'desc' => esc_html__( 'Horizontal position from left edge.', 'merchant' ),
168 'min' => -300,
169 'max' => 300,
170 'step' => 1,
171 'default' => 0,
172 'unit' => 'px',
173 ),
174
175 array(
176 'id' => 'position_y',
177 'type' => 'range',
178 'title' => esc_html__( 'Vertical Position (Y)', 'merchant' ),
179 'desc' => esc_html__( 'Vertical position from top edge.', 'merchant' ),
180 'min' => -300,
181 'max' => 300,
182 'step' => 1,
183 'default' => 0,
184 'unit' => 'px',
185 ),
186
187 array(
188 'id' => 'label_width',
189 'type' => 'range',
190 'title' => esc_html__( 'Label width', 'merchant' ),
191 'min' => 1,
192 'max' => 1000,
193 'step' => 1,
194 'default' => 100,
195 'unit' => 'px',
196 ),
197 array(
198 'id' => 'label_height',
199 'type' => 'range',
200 'title' => esc_html__( 'Label height', 'merchant' ),
201 'min' => 1,
202 'max' => 250,
203 'step' => 1,
204 'default' => 32,
205 'unit' => 'px',
206 ),
207
208 array(
209 'id' => 'background_color',
210 'type' => 'color',
211 'title' => esc_html__( 'Background color', 'merchant' ),
212 'default' => '#212121',
213 'condition' => array( 'label_type', '==', 'text' ),
214 ),
215
216 array(
217 'id' => 'shape_radius',
218 'type' => 'range',
219 'title' => esc_html__( 'Shape radius', 'merchant' ),
220 'min' => 0,
221 'max' => 250,
222 'step' => 1,
223 'unit' => 'px',
224 'default' => 5,
225 'condition' => array( 'label_type', '==', 'text' ),
226 ),
227
228 array(
229 'id' => 'font_size',
230 'type' => 'range',
231 'title' => esc_html__( 'Font size', 'merchant' ),
232 'min' => 0,
233 'max' => 250,
234 'step' => 1,
235 'unit' => 'px',
236 'default' => 14,
237 'condition' => array( 'label_type', '==', 'text' ),
238 ),
239
240 array(
241 'id' => 'font_style',
242 'type' => 'select',
243 'title' => esc_html__( 'Font style', 'merchant' ),
244 'options' => array(
245 'normal' => esc_html__( 'Normal', 'merchant' ),
246 'italic' => esc_html__( 'Italic', 'merchant' ),
247 'bold' => esc_html__( 'Bold', 'merchant' ),
248 'bold_italic' => esc_html__( 'Bold Italic', 'merchant' ),
249 ),
250 'default' => 'normal',
251 'condition' => array( 'label_type', '==', 'text' ),
252 ),
253
254 array(
255 'id' => 'text_color',
256 'type' => 'color',
257 'title' => esc_html__( 'Font color', 'merchant' ),
258 'default' => '#ffffff',
259 'condition' => array( 'label_type', '==', 'text' ),
260 ),
261
262 array(
263 'id' => 'display_rules',
264 'type' => 'select',
265 'title' => esc_html__( 'Product trigger', 'merchant' ),
266 'options' => $display_rules,
267 'default' => 'products_on_sale',
268 'ai_meta' => array(
269 'semantic_group' => 'product_targeting',
270 'usage_hint' => 'Which products this label appears on. Set this BEFORE setting product_cats, product_tags, product_brands, or product_ids — those fields are conditional on this value.',
271 ),
272 ),
273
274 array(
275 'id' => 'new_products_days',
276 'type' => 'number',
277 'min' => 0,
278 'step' => 1,
279 'title' => esc_html__( 'How long counts as new', 'merchant' ),
280 'desc' => esc_html__( 'Set the number of days the product will be marked as ‘New’ after it has been created', 'merchant' ),
281 'default' => 3,
282 'condition' => array( 'display_rules', '==', 'new_products' ),
283 'ai_meta' => array(
284 'semantic_group' => 'offer_rules',
285 'usage_hint' => 'Number of days after publication during which a product is considered "new". Only used when display_rules is new_products.',
286 ),
287 ),
288
289 array(
290 'id' => 'product_cats',
291 'type' => 'select_ajax',
292 'title' => esc_html__( 'Categories', 'merchant' ),
293 'source' => 'options',
294 'multiple' => true,
295 'options' => Merchant_Admin_Options::get_category_select2_choices(),
296 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
297 'desc' => esc_html__( 'Select the product categories that will show the label.', 'merchant' ),
298 'condition' => array( 'display_rules', '==', 'by_category' ),
299 'ai_meta' => array(
300 'entity' => 'category',
301 'reference_type' => 'dynamic',
302 'taxonomy' => 'product_cat',
303 'value_format' => 'slug',
304 'semantic_group' => 'product_targeting',
305 'abstraction_level' => 3,
306 'usage_hint' => 'Categories that show this label. Only used when display_rules is by_category.',
307 ),
308 ),
309
310 array(
311 'id' => 'product_tags',
312 'type' => 'select_ajax',
313 'title' => esc_html__( 'Tags', 'merchant' ),
314 'source' => 'options',
315 'multiple' => true,
316 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
317 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
318 'desc' => esc_html__( 'Select the product tags that will show the label.', 'merchant' ),
319 'condition' => array( 'display_rules', '==', 'by_tags' ),
320 'ai_meta' => array(
321 'entity' => 'tag',
322 'reference_type' => 'dynamic',
323 'taxonomy' => 'product_tag',
324 'value_format' => 'slug',
325 'semantic_group' => 'product_targeting',
326 'abstraction_level' => 2,
327 'usage_hint' => 'Tags that show this label. Only used when display_rules is by_tags.',
328 ),
329 ),
330
331 array(
332 'id' => 'product_brands',
333 'type' => 'select_ajax',
334 'title' => esc_html__( 'Brands', 'merchant' ),
335 'source' => 'options',
336 'multiple' => true,
337 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
338 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
339 'desc' => esc_html__( 'Select the product brands that will show the label.', 'merchant' ),
340 'condition' => array( 'display_rules', '==', 'by_brands' ),
341 'ai_meta' => array(
342 'entity' => 'brand',
343 'reference_type' => 'dynamic',
344 'taxonomy' => 'product_brand',
345 'value_format' => 'slug',
346 'semantic_group' => 'product_targeting',
347 'abstraction_level' => 4,
348 'usage_hint' => 'Brands that show this label. Only used when display_rules is by_brands.',
349 ),
350 ),
351
352 array(
353 'id' => 'product_ids',
354 'type' => 'products_selector',
355 'multiple' => true,
356 'desc' => esc_html__( 'Select the products that will show the label.', 'merchant' ),
357 'allowed_types' => array( 'simple', 'variable' ),
358 'condition' => array( 'display_rules', '==', 'specific_products' ),
359 'ai_meta' => array(
360 'entity' => 'product',
361 'reference_type' => 'static',
362 'value_format' => 'product_id',
363 'semantic_group' => 'product_targeting',
364 'abstraction_level' => 1,
365 'usage_hint' => 'Specific product IDs that show this label. Only used when display_rules is specific_products.',
366 ),
367 ),
368
369 array(
370 'id' => 'exclude_products_toggle',
371 'type' => 'switcher',
372 'title' => esc_html__( 'Exclude Products', 'merchant' ),
373 'desc' => esc_html__( 'Exclude specific products from this label.', 'merchant' ),
374 'default' => 0,
375 'conditions' => array(
376 'relation' => 'AND',
377 'terms' => array(
378 array(
379 'field' => 'display_rules',
380 'operator' => 'in',
381 'value' => array( 'all_products', 'by_category', 'by_tags', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
382 ),
383 ),
384 ),
385 'ai_meta' => array(
386 'toggle_for' => 'excluded_products',
387 'semantic_group' => 'product_exclusion',
388 'usage_hint' => 'Enable this to reveal the excluded_products field.',
389 ),
390 ),
391
392 array(
393 'id' => 'excluded_products',
394 'type' => 'products_selector',
395 'title' => esc_html__( 'Excluded Products List', 'merchant' ),
396 'desc' => esc_html__( 'Exclude products from this label.', 'merchant' ),
397 'multiple' => true,
398 'allowed_types' => array( 'simple', 'variable' ),
399 'conditions' => array(
400 'relation' => 'AND',
401 'terms' => array(
402 array(
403 'field' => 'display_rules',
404 'operator' => 'in',
405 'value' => array( 'all_products', 'by_category', 'by_tags', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
406 ),
407 array(
408 'field' => 'exclude_products_toggle',
409 'operator' => '===',
410 'value' => true,
411 ),
412 ),
413 ),
414 'ai_meta' => array(
415 'entity' => 'product',
416 'reference_type' => 'static',
417 'value_format' => 'product_id',
418 'semantic_group' => 'product_exclusion',
419 'abstraction_level' => 1,
420 'toggled_by' => 'exclude_products_toggle',
421 'usage_hint' => 'Products excluded from showing this label. Requires exclude_products_toggle.',
422 ),
423 ),
424
425 array(
426 'id' => 'exclude_categories_toggle',
427 'type' => 'switcher',
428 'title' => esc_html__( 'Exclude Categories', 'merchant' ),
429 'desc' => esc_html__( 'Exclude specific categories from this label.', 'merchant' ),
430 'default' => 0,
431 'conditions' => array(
432 'relation' => 'AND',
433 'terms' => array(
434 array(
435 'field' => 'display_rules',
436 'operator' => 'in',
437 'value' => array( 'all_products', 'by_tags', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
438 ),
439 ),
440 ),
441 'ai_meta' => array(
442 'toggle_for' => 'excluded_categories',
443 'semantic_group' => 'product_exclusion',
444 'usage_hint' => 'Enable this to reveal the excluded_categories field.',
445 ),
446 ),
447
448 array(
449 'id' => 'excluded_categories',
450 'type' => 'select_ajax',
451 'title' => esc_html__( 'Excluded Categories List', 'merchant' ),
452 'source' => 'options',
453 'multiple' => true,
454 'options' => Merchant_Admin_Options::get_category_select2_choices(),
455 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
456 'desc' => esc_html__( 'Exclude categories from this label.', 'merchant' ),
457 'conditions' => array(
458 'relation' => 'AND',
459 'terms' => array(
460 array(
461 'field' => 'display_rules',
462 'operator' => 'in',
463 'value' => array( 'all_products', 'by_tags', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
464 ),
465 array(
466 'field' => 'exclude_categories_toggle',
467 'operator' => '===',
468 'value' => true,
469 ),
470 ),
471 ),
472 'ai_meta' => array(
473 'entity' => 'category',
474 'reference_type' => 'dynamic',
475 'taxonomy' => 'product_cat',
476 'value_format' => 'slug',
477 'semantic_group' => 'product_exclusion',
478 'abstraction_level' => 3,
479 'toggled_by' => 'exclude_categories_toggle',
480 'usage_hint' => 'Categories excluded from this label. Requires exclude_categories_toggle.',
481 ),
482 ),
483
484 array(
485 'id' => 'include_subcategories',
486 'type' => 'switcher',
487 'title' => esc_html__( 'Include subcategories', 'merchant' ),
488 'desc' => esc_html__( 'When enabled, selecting a parent category also applies to all of its child categories.', 'merchant' ),
489 'default' => 0,
490 'conditions' => array(
491 'relation' => 'OR',
492 'terms' => array(
493 array(
494 'field' => 'display_rules',
495 'operator' => '===',
496 'value' => 'by_category',
497 ),
498 array(
499 'relation' => 'AND',
500 'terms' => array(
501 array(
502 'field' => 'display_rules',
503 'operator' => 'in',
504 'value' => array( 'all_products', 'by_tags', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
505 ),
506 array(
507 'field' => 'exclude_categories_toggle',
508 'operator' => '===',
509 'value' => true,
510 ),
511 ),
512 ),
513 ),
514 ),
515 'ai_meta' => array(
516 'semantic_group' => 'product_targeting',
517 '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.',
518 ),
519 ),
520
521 array(
522 'id' => 'exclude_tags_toggle',
523 'type' => 'switcher',
524 'title' => esc_html__( 'Exclude Tags', 'merchant' ),
525 'desc' => esc_html__( 'Exclude specific tags from this label.', 'merchant' ),
526 'default' => 0,
527 'conditions' => array(
528 'relation' => 'AND',
529 'terms' => array(
530 array(
531 'field' => 'display_rules',
532 'operator' => 'in',
533 'value' => array( 'all_products', 'by_category', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
534 ),
535 ),
536 ),
537 'ai_meta' => array(
538 'toggle_for' => 'excluded_tags',
539 'semantic_group' => 'product_exclusion',
540 'usage_hint' => 'Enable this to reveal the excluded_tags field.',
541 ),
542 ),
543
544 array(
545 'id' => 'excluded_tags',
546 'type' => 'select_ajax',
547 'title' => esc_html__( 'Excluded Tags List', 'merchant' ),
548 'source' => 'options',
549 'multiple' => true,
550 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
551 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
552 'desc' => esc_html__( 'Exclude tags from this label.', 'merchant' ),
553 'conditions' => array(
554 'relation' => 'AND',
555 'terms' => array(
556 array(
557 'field' => 'display_rules',
558 'operator' => 'in',
559 'value' => array( 'all_products', 'by_category', 'by_brands', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
560 ),
561 array(
562 'field' => 'exclude_tags_toggle',
563 'operator' => '===',
564 'value' => true,
565 ),
566 ),
567 ),
568 'ai_meta' => array(
569 'entity' => 'tag',
570 'reference_type' => 'dynamic',
571 'taxonomy' => 'product_tag',
572 'value_format' => 'slug',
573 'semantic_group' => 'product_exclusion',
574 'abstraction_level' => 2,
575 'toggled_by' => 'exclude_tags_toggle',
576 'usage_hint' => 'Tags excluded from this label. Requires exclude_tags_toggle.',
577 ),
578 ),
579
580 array(
581 'id' => 'exclude_brands_toggle',
582 'type' => 'switcher',
583 'title' => esc_html__( 'Exclude Brands', 'merchant' ),
584 'desc' => esc_html__( 'Exclude specific brands from this label.', 'merchant' ),
585 'default' => 0,
586 'conditions' => array(
587 'relation' => 'AND',
588 'terms' => array(
589 array(
590 'field' => 'display_rules',
591 'operator' => 'in',
592 'value' => array( 'all_products', 'by_category', 'by_tags', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
593 ),
594 ),
595 ),
596 'ai_meta' => array(
597 'toggle_for' => 'excluded_brands',
598 'semantic_group' => 'product_exclusion',
599 'usage_hint' => 'Enable this to reveal the excluded_brands field.',
600 ),
601 ),
602
603 array(
604 'id' => 'excluded_brands',
605 'type' => 'select_ajax',
606 'title' => esc_html__( 'Excluded Brands List', 'merchant' ),
607 'source' => 'options',
608 'multiple' => true,
609 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
610 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
611 'desc' => esc_html__( 'Exclude brands from this label.', 'merchant' ),
612 'conditions' => array(
613 'relation' => 'AND',
614 'terms' => array(
615 array(
616 'field' => 'display_rules',
617 'operator' => 'in',
618 'value' => array( 'all_products', 'by_category', 'by_tags', 'featured_products', 'new_products', 'products_on_sale', 'out_of_stock', 'pre-order' ),
619 ),
620 array(
621 'field' => 'exclude_brands_toggle',
622 'operator' => '===',
623 'value' => true,
624 ),
625 ),
626 ),
627 'ai_meta' => array(
628 'entity' => 'brand',
629 'reference_type' => 'dynamic',
630 'taxonomy' => 'product_brand',
631 'value_format' => 'slug',
632 'semantic_group' => 'product_exclusion',
633 'abstraction_level' => 4,
634 'toggled_by' => 'exclude_brands_toggle',
635 'usage_hint' => 'Brands excluded from this label. Requires exclude_brands_toggle.',
636 ),
637 ),
638
639 array(
640 'id' => 'show_pages',
641 'type' => 'checkbox_multiple',
642 'title' => esc_html__( 'Show on pages', 'merchant' ),
643 'options' => array(
644 'homepage' => esc_html__( 'Homepage', 'merchant' ),
645 'single' => esc_html__( 'Product Single', 'merchant' ),
646 'archive' => esc_html__( 'Product Archive', 'merchant' ),
647 ),
648 'default' => array( 'homepage', 'single', 'archive' ),
649 ),
650
651 array(
652 'id' => 'show_devices',
653 'type' => 'checkbox_multiple',
654 'title' => esc_html__( 'Show on devices', 'merchant' ),
655 'options' => array(
656 'desktop' => esc_html__( 'Desktop', 'merchant' ),
657 'mobile' => esc_html__( 'Mobile', 'merchant' ),
658 ),
659 'default' => array( 'desktop', 'mobile' ),
660 ),
661 ),
662 ),
663 ),
664 'default' => array(
665 array(
666 'layout' => 'single-label',
667 'label' => esc_html__( 'SALE', 'merchant' ),
668 'display_rules' => 'featured_products',
669 ),
670 ),
671 ),
672 array(
673 'id' => 'multiple_labels',
674 'type' => 'switcher',
675 'title' => __( 'Use multiple labels', 'merchant' ),
676 'desc' => __( 'Enable this to display multiple labels assigned to the product when multiple labels are available.', 'merchant' ),
677 'default' => 0,
678 ),
679 ),
680 ),
681 array(
682 'module' => Merchant_Product_Labels::MODULE_ID,
683 'title' => esc_html__( 'Use shortcode', 'merchant' ),
684 'fields' => array(
685 array(
686 'id' => 'use_shortcode',
687 'type' => 'switcher',
688 'title' => __( 'Use shortcode', 'merchant' ),
689 'default' => 0,
690 ),
691 array(
692 'type' => 'info',
693 'id' => 'shortcode_info',
694 'content' => esc_html__( 'If you are using a page builder or a theme that supports shortcodes, then you can output the module using the shortcode above. This might be useful if, for example, you find that you want to control the position of the module output more precisely than with the module settings. Note that the shortcodes can only be used on single product pages.', 'merchant' ),
695 ),
696 array(
697 'id' => 'shortcode_text',
698 'type' => 'text_readonly',
699 'title' => esc_html__( 'Shortcode text', 'merchant' ),
700 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Product_Labels::MODULE_ID ) . ']',
701 'condition' => array( 'use_shortcode', '==', '1' ),
702 ),
703 ),
704 ),
705 );
706