PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.2.7
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.2.7
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 / complementary-products / admin / options.php

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

837 lines 28.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Add To Cart Text Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // Settings
14 Merchant_Admin_Options::create( array(
15 'title' => esc_html__( 'Complementary Offers', 'merchant' ),
16 'module' => Merchant_Complementary_Products::MODULE_ID,
17 'fields' => array(
18 array(
19 'id' => 'offers',
20 'type' => 'flexible_content',
21 'button_label' => esc_html__( 'Add New Complementary Offer', 'merchant' ),
22 'style' => Merchant_Complementary_Products::MODULE_ID . '-style default',
23 'sorting' => true,
24 'duplicate' => true,
25 'accordion' => true,
26 'layouts' => array(
27 'offer-details' => array(
28 'title' => esc_html__( 'Create Discount Tiers', 'merchant' ),
29 'title-field' => 'offer-title', // text field ID to use as title for the layout
30 'status-field' => 'campaign_status',
31 'fields' => array(
32 array(
33 'id' => 'campaign_status',
34 'type' => 'select',
35 'title' => esc_html__( 'Status', 'merchant' ),
36 'options' => array(
37 'active' => esc_html__( 'Active', 'merchant' ),
38 'inactive' => esc_html__( 'Inactive', 'merchant' ),
39 ),
40 'default' => 'active',
41 ),
42 array(
43 'id' => 'offer-title',
44 'type' => 'text',
45 'title' => esc_html__( 'Offer name', 'merchant' ),
46 'default' => esc_html__( 'Campaign', 'merchant' ),
47 ),
48 array(
49 'id' => 'rules_to_display',
50 'type' => 'select',
51 'title' => esc_html__( 'Trigger', 'merchant' ),
52 'options' => array(
53 'all' => esc_html__( 'All Products', 'merchant' ),
54 'products' => esc_html__( 'Specific Products', 'merchant' ),
55 'categories' => esc_html__( 'Specific Categories', 'merchant' ),
56 'tags' => esc_html__( 'Specific Tags', 'merchant' ),
57 'brands' => esc_html__( 'Specific Brands', 'merchant' ),
58 ),
59 'default' => 'products',
60 ),
61 array(
62 'id' => 'product_to_display',
63 'type' => 'products_selector',
64 'title' => esc_html__( 'Select a product', 'merchant' ),
65 'multiple' => false,
66 'desc' => esc_html__( 'Select the product you want to pair with the complementary items.', 'merchant' ),
67 'condition' => array( 'rules_to_display', '==', 'products' ),
68 ),
69 array(
70 'id' => 'category_slugs',
71 'type' => 'select_ajax',
72 'title' => esc_html__( 'Categories', 'merchant' ),
73 'source' => 'options',
74 'multiple' => true,
75 'options' => Merchant_Admin_Options::get_category_select2_choices(),
76 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
77 'desc' => esc_html__( 'Select the product categories that will show the complementary items.', 'merchant' ),
78 'condition' => array( 'rules_to_display', '==', 'categories' ),
79 ),
80
81 array(
82 'id' => 'tag_slugs',
83 'type' => 'select_ajax',
84 'title' => esc_html__( 'Tags', 'merchant' ),
85 'source' => 'options',
86 'multiple' => true,
87 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
88 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
89 'desc' => esc_html__( 'Select the product tags that will show the complementary items.', 'merchant' ),
90 'condition' => array( 'rules_to_display', '==', 'tags' ),
91 ),
92 array(
93 'id' => 'brand_slugs',
94 'type' => 'select_ajax',
95 'title' => esc_html__( 'Brands', 'merchant' ),
96 'source' => 'options',
97 'multiple' => true,
98 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
99 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
100 'desc' => esc_html__( 'Select the product brands that will show the complementary items.', 'merchant' ),
101 'condition' => array( 'rules_to_display', '==', 'brands' ),
102 ),
103
104 array(
105 'id' => 'exclude_products_toggle',
106 'type' => 'switcher',
107 'title' => esc_html__( 'Exclude products', 'merchant' ),
108 'default' => 0,
109 'conditions' => array(
110 'relation' => 'AND',
111 'terms' => array(
112 array(
113 'field' => 'rules_to_display',
114 'operator' => 'in',
115 'value' => array( 'all', 'categories', 'tags', 'brands' ),
116 ),
117 ),
118 ),
119 ),
120
121 array(
122 'id' => 'excluded_products',
123 'type' => 'products_selector',
124 'title' => esc_html__( 'Excluded Products List', 'merchant' ),
125 'multiple' => true,
126 'desc' => esc_html__( 'Exclude products from this campaign.', 'merchant' ),
127 'conditions' => array(
128 'relation' => 'AND',
129 'terms' => array(
130 array(
131 'field' => 'rules_to_display',
132 'operator' => 'in',
133 'value' => array( 'all', 'categories', 'tags', 'brands' ),
134 ),
135 array(
136 'field' => 'exclude_products_toggle',
137 'operator' => '===',
138 'value' => true,
139 ),
140 ),
141 ),
142 ),
143
144 array(
145 'id' => 'exclude_categories_toggle',
146 'type' => 'switcher',
147 'title' => esc_html__( 'Exclude categories', 'merchant' ),
148 'default' => 0,
149 'conditions' => array(
150 'relation' => 'AND',
151 'terms' => array(
152 array(
153 'field' => 'rules_to_display',
154 'operator' => 'in',
155 'value' => array( 'all', 'tags', 'brands' ),
156 ),
157 ),
158 ),
159 ),
160
161 array(
162 'id' => 'excluded_categories',
163 'type' => 'select_ajax',
164 'title' => esc_html__( 'Excluded Categories List', 'merchant' ),
165 'source' => 'options',
166 'multiple' => true,
167 'options' => Merchant_Admin_Options::get_category_select2_choices(),
168 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
169 'desc' => esc_html__( 'Exclude categories from this campaign.', 'merchant' ),
170 'conditions' => array(
171 'relation' => 'AND',
172 'terms' => array(
173 array(
174 'field' => 'rules_to_display',
175 'operator' => 'in',
176 'value' => array( 'all', 'tags', 'brands' ),
177 ),
178 array(
179 'field' => 'exclude_categories_toggle',
180 'operator' => '===',
181 'value' => true,
182 ),
183 ),
184 ),
185 ),
186
187 array(
188 'id' => 'exclude_tags_toggle',
189 'type' => 'switcher',
190 'title' => esc_html__( 'Exclude product tags', 'merchant' ),
191 'default' => 0,
192 'conditions' => array(
193 'relation' => 'AND',
194 'terms' => array(
195 array(
196 'field' => 'rules_to_display',
197 'operator' => 'in',
198 'value' => array( 'all', 'categories', 'brands' ),
199 ),
200 ),
201 ),
202 ),
203
204 array(
205 'id' => 'excluded_tags',
206 'type' => 'select_ajax',
207 'title' => esc_html__( 'Excluded Tags List', 'merchant' ),
208 'source' => 'options',
209 'multiple' => true,
210 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
211 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
212 'desc' => esc_html__( 'Exclude tags from this campaign.', 'merchant' ),
213 'conditions' => array(
214 'relation' => 'AND',
215 'terms' => array(
216 array(
217 'field' => 'rules_to_display',
218 'operator' => 'in',
219 'value' => array( 'all', 'categories', 'brands' ),
220 ),
221 array(
222 'field' => 'exclude_tags_toggle',
223 'operator' => '===',
224 'value' => true,
225 ),
226 ),
227 ),
228 ),
229
230 array(
231 'id' => 'exclude_brands_toggle',
232 'type' => 'switcher',
233 'title' => esc_html__( 'Exclude Brands', 'merchant' ),
234 'default' => 0,
235 'conditions' => array(
236 'relation' => 'AND',
237 'terms' => array(
238 array(
239 'field' => 'rules_to_display',
240 'operator' => 'in',
241 'value' => array( 'all', 'categories', 'tags' ),
242 ),
243 ),
244 ),
245 ),
246
247 array(
248 'id' => 'excluded_brands',
249 'type' => 'select_ajax',
250 'title' => esc_html__( 'Excluded Brands List', 'merchant' ),
251 'source' => 'options',
252 'multiple' => true,
253 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
254 'placeholder' => esc_html__( 'Select brands', 'merchant' ),
255 'desc' => esc_html__( 'Exclude brands from this campaign.', 'merchant' ),
256 'conditions' => array(
257 'relation' => 'AND',
258 'terms' => array(
259 array(
260 'field' => 'rules_to_display',
261 'operator' => 'in',
262 'value' => array( 'all', 'categories', 'tags' ),
263 ),
264 array(
265 'field' => 'exclude_brands_toggle',
266 'operator' => '===',
267 'value' => true,
268 ),
269 ),
270 ),
271 ),
272
273 array(
274 'id' => 'products',
275 'title' => esc_html__( 'Complementary products', 'merchant' ),
276 'type' => 'products_selector',
277 'multiple' => true,
278 'desc' => esc_html__( 'Select the products you want to sell alongside the main product', 'merchant' ),
279 ),
280 array(
281 'id' => 'enable_discount',
282 'type' => 'switcher',
283 'title' => __( 'Offer a discount on this bundle', 'merchant' ),
284 'default' => 0,
285 ),
286 array(
287 'id' => 'discount_type',
288 'type' => 'radio',
289 'title' => esc_html__( 'Discount', 'merchant' ),
290 'options' => array(
291 'percentage_discount' => esc_html__( 'Percentage', 'merchant' ),
292 'fixed_discount' => esc_html__( 'Fixed', 'merchant' ),
293 'cheapest_item_free' => esc_html__( 'Cheapest item free', 'merchant' ),
294 'free_shipping' => esc_html__( 'Free Shipping', 'merchant' ),
295 ),
296 'default' => 'percentage_discount',
297 'conditions' => array(
298 'relation' => 'AND',
299 'terms' => array(
300 array(
301 'field' => 'enable_discount',
302 'operator' => '===',
303 'value' => true,
304 ),
305 ),
306 ),
307 ),
308 array(
309 'id' => 'discount_value',
310 'type' => 'number',
311 'default' => 10,
312 'step' => 0.01,
313 'conditions' => array(
314 'relation' => 'AND',
315 'terms' => array(
316 array(
317 'field' => 'enable_discount',
318 'operator' => '===',
319 'value' => true,
320 ),
321 array(
322 'field' => 'discount_type',
323 'operator' => 'in',
324 'value' => array( 'percentage_discount', 'fixed_discount' ),
325 ),
326 ),
327 ),
328 ),
329 array(
330 'id' => 'min_selection_discount',
331 'title' => esc_html__( 'Minimum product selection to trigger the discount', 'merchant' ),
332 'type' => 'number',
333 'default' => 1,
334 'step' => 1,
335 'conditions' => array(
336 'relation' => 'AND',
337 'terms' => array(
338 array(
339 'field' => 'enable_discount',
340 'operator' => '===',
341 'value' => true,
342 ),
343 ),
344 ),
345 ),
346 array(
347 'id' => 'checkboxes-state',
348 'type' => 'radio',
349 'title' => esc_html__( 'Checkboxes for each product', 'merchant' ),
350 'options' => array(
351 'auto-checked' => esc_html__( 'Auto checked', 'merchant' ),
352 'unchecked' => esc_html__( 'Unchecked', 'merchant' ),
353 ),
354 'default' => 'unchecked',
355 ),
356 array(
357 'id' => 'user_condition',
358 'type' => 'select',
359 'title' => esc_html__( 'User Condition', 'merchant' ),
360 'options' => array(
361 'all' => esc_html__( 'All Users', 'merchant' ),
362 'customers' => esc_html__( 'Selected Users', 'merchant' ),
363 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
364 ),
365 'default' => 'all',
366 ),
367 array(
368 'id' => 'user_condition_roles',
369 'type' => 'select_ajax',
370 'title' => esc_html__( 'User Roles', 'merchant' ),
371 'desc' => esc_html__( 'This will limit the offer to users with these roles.', 'merchant' ),
372 'source' => 'options',
373 'multiple' => true,
374 'classes' => array( 'flex-grow' ),
375 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
376 'condition' => array( 'user_condition', '==', 'roles' ),
377 ),
378
379 array(
380 'id' => 'user_condition_users',
381 'type' => 'select_ajax',
382 'title' => esc_html__( 'Users', 'merchant' ),
383 'desc' => esc_html__( 'This will limit the offer to the selected customers.', 'merchant' ),
384 'source' => 'user',
385 'multiple' => true,
386 'classes' => array( 'flex-grow' ),
387 'condition' => array( 'user_condition', '==', 'customers' ),
388 ),
389
390 array(
391 'id' => 'user_exclusion_enabled',
392 'type' => 'switcher',
393 'title' => esc_html__( 'Exclusion List', 'merchant' ),
394 'desc' => esc_html__( 'Hide this offer from certain users.', 'merchant' ),
395 'default' => 0,
396 'conditions' => array(
397 'relation' => 'AND',
398 'terms' => array(
399 array(
400 'field' => 'user_condition',
401 'operator' => 'in',
402 'value' => array( 'all', 'roles' ),
403 ),
404 ),
405 ),
406 ),
407
408 array(
409 'id' => 'exclude_roles',
410 'type' => 'select_ajax',
411 'title' => esc_html__( 'Exclude Roles', 'merchant' ),
412 'desc' => esc_html__( 'This will exclude the offer for users with these roles.', 'merchant' ),
413 'source' => 'options',
414 'multiple' => true,
415 'classes' => array( 'flex-grow' ),
416 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
417 'conditions' => array(
418 'relation' => 'AND',
419 'terms' => array(
420 array(
421 'field' => 'user_condition',
422 'operator' => 'in',
423 'value' => array( 'all' ),
424 ),
425 array(
426 'field' => 'user_exclusion_enabled',
427 'operator' => '===',
428 'value' => true,
429 ),
430 ),
431 ),
432 ),
433
434 array(
435 'id' => 'exclude_users',
436 'type' => 'select_ajax',
437 'title' => esc_html__( 'Exclude Users', 'merchant' ),
438 'desc' => esc_html__( 'This will exclude the offer for the selected customers.', 'merchant' ),
439 'source' => 'user',
440 'multiple' => true,
441 'classes' => array( 'flex-grow' ),
442 'conditions' => array(
443 'relation' => 'AND',
444 'terms' => array(
445 array(
446 'field' => 'user_condition',
447 'operator' => 'in',
448 'value' => array( 'all', 'roles' ),
449 ),
450 array(
451 'field' => 'user_exclusion_enabled',
452 'operator' => '===',
453 'value' => true,
454 ),
455 ),
456 ),
457 ),
458
459 array(
460 'id' => 'product_single_page',
461 'type' => 'fields_group',
462 'title' => esc_html__( 'Product Single Page', 'merchant' ),
463 'sub-desc' => esc_html__( 'Use these settings to control how complementary product offers appear on product pages.',
464 'merchant' ),
465 'state' => 'open',
466 'default' => 'active',
467 'accordion' => true,
468 'display_status' => true,
469 'fields' => array(
470 array(
471 'id' => 'single_product_placement',
472 'type' => 'select',
473 'title' => esc_html__( 'Placement on product page', 'merchant' ),
474 'options' => array(
475 'before-add-to-cart' => esc_html__( 'Before Add to Cart', 'merchant' ),
476 'after-summary' => esc_html__( 'After Product Summary', 'merchant' ),
477 'after-tabs' => esc_html__( 'After Product Tabs', 'merchant' ),
478 ),
479 'default' => 'before-add-to-cart',
480 ),
481
482 // text formatting settings
483 array(
484 'id' => 'offer-title',
485 'type' => 'text',
486 'title' => esc_html__( 'Offer title', 'merchant' ),
487 'default' => esc_html__( 'Campaign', 'merchant' ),
488 'desc' => esc_html__( 'Enter an optional title to show before the complementary products', 'merchant' ),
489 ),
490
491 array(
492 'id' => 'offer-description',
493 'type' => 'textarea',
494 'title' => esc_html__( 'Short description', 'merchant' ),
495 'desc' => esc_html__( 'Enter an optional description to display after the offer title.', 'merchant' ),
496 'hidden_desc' => sprintf(
497 /* Translators: %1$s: Display the discount amount */
498 __(
499 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
500 'merchant'
501 ),
502 '{discount_amount}',
503 ),
504 ),
505 ),
506 ),
507
508 array(
509 'id' => 'cart_page',
510 'type' => 'fields_group',
511 'title' => esc_html__( 'Cart Page', 'merchant' ),
512 'default' => 'inactive',
513 'sub-desc' => esc_html__( 'Use these settings to control how complementary product offers appear on the cart page.', 'merchant' ),
514 'state' => 'closed',
515 'accordion' => true,
516 'display_status' => true,
517 'fields' => array(
518 // text formatting settings
519 array(
520 'id' => 'title',
521 'type' => 'text',
522 'title' => esc_html__( 'Campaign title', 'merchant' ),
523 'default' => esc_html__( 'Add', 'merchant' ),
524 'desc' => esc_html__( 'Add discount title', 'merchant' ),
525 'hidden_desc' => sprintf(
526 /* Translators: %1$s: Display the discount amount */
527 __(
528 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
529 'merchant'
530 ),
531 '{discount_amount}',
532 ),
533 ),
534 array(
535 'id' => 'button_text',
536 'type' => 'text',
537 'title' => esc_html__( 'Button text', 'merchant' ),
538 'default' => esc_html__( 'Add to cart', 'merchant' ),
539 ),
540 ),
541 ),
542
543 array(
544 'id' => 'checkout_page',
545 'type' => 'fields_group',
546 'title' => esc_html__( 'Checkout Page', 'merchant' ),
547 'sub-desc' => esc_html__( 'Use these settings to control how complementary product offers appear on the checkout page.', 'merchant' ),
548 'state' => 'closed',
549 'default' => 'inactive',
550 'accordion' => true,
551 'display_status' => true,
552 'fields' => array(
553 array(
554 'id' => 'placement',
555 'type' => 'select',
556 'title' => esc_html__( 'Placement', 'merchant' ),
557 'options' => array(
558 'before_billing_details' => esc_html__( 'Before Billing Details', 'merchant' ),
559 'after_billing_details' => esc_html__( 'After Billing Details', 'merchant' ),
560 'before_order_details' => esc_html__( 'Before Order Details', 'merchant' ),
561 'before_payment_options' => esc_html__( 'Before Payment Gateways', 'merchant' ),
562 'before_order_placement_btn' => esc_html__( 'Before Order Placement Button', 'merchant' ),
563 'after_order_placement_btn' => esc_html__( 'After Order Placement Button', 'merchant' ),
564 ),
565 'default' => 'before_payment_options',
566 ),
567 array(
568 'id' => 'title',
569 'type' => 'text',
570 'title' => esc_html__( 'Offer title', 'merchant' ),
571 'default' => esc_html__( 'Recommended For You', 'merchant' ),
572 'desc' => esc_html__( 'Enter an optional title to show before the complementary products', 'merchant' ),
573 'hidden_desc' => sprintf(
574 /* Translators: %1$s: Display the discount amount */
575 __(
576 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
577 'merchant'
578 ),
579 '{discount_amount}',
580 ),
581 ),
582 array(
583 'id' => 'offer_description',
584 'type' => 'textarea',
585 'title' => esc_html__( 'Description', 'merchant' ),
586 'desc' => esc_html__( 'Enter an optional campaign description', 'merchant' ),
587 'hidden_desc' => sprintf(
588 /* Translators: %1$s: Display the discount amount */
589 __(
590 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
591 'merchant'
592 ),
593 '{discount_amount}',
594 ),
595 ),
596 array(
597 'id' => 'button_text',
598 'type' => 'text',
599 'title' => esc_html__( 'Button text', 'merchant' ),
600 'default' => esc_html__( 'Add To Cart', 'merchant' ),
601 ),
602 ),
603 ),
604
605 array(
606 'id' => 'thank_you_page',
607 'type' => 'fields_group',
608 'title' => esc_html__( 'Thank you Page', 'merchant' ),
609 'default' => 'inactive',
610 'sub-desc' => esc_html__( 'Use these settings to control how complementary product offers appear on the thank you page.', 'merchant' ),
611 'state' => 'closed',
612 'accordion' => true,
613 'display_status' => true,
614 'fields' => array(
615 array(
616 'id' => 'placement',
617 'type' => 'select',
618 'title' => esc_html__( 'Placement', 'merchant' ),
619 'options' => array(
620 'on_top' => esc_html__( 'On Top', 'merchant' ),
621 'before_order_details' => esc_html__( 'Before Order details', 'merchant' ),
622 'after_order_details' => esc_html__( 'After Order details', 'merchant' ),
623 ),
624 'default' => 'before_order_details',
625 ),
626 array(
627 'id' => 'title',
628 'type' => 'text',
629 'title' => esc_html__( 'Bundle title', 'merchant' ),
630 'desc' => esc_html__( 'Add discount title', 'merchant' ),
631 'default' => esc_html__( 'Last chance to get', 'merchant' ),
632 'hidden_desc' => sprintf(
633 /* Translators: %1$s: Display the discount amount */
634 __(
635 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
636 'merchant'
637 ),
638 '{discount_amount}',
639 ),
640 ),
641
642 array(
643 'id' => 'discount_text',
644 'type' => 'text',
645 'title' => esc_html__( 'Discount text', 'merchant' ),
646 'default' => esc_html__( 'With discount', 'merchant' ),
647 'desc' => esc_html__( 'Show the discount details on the product', 'merchant' ),
648 'hidden_desc' => sprintf(
649 /* Translators: %1$s: Display the discount amount */
650 __(
651 '<strong>%1$s:</strong> Display the discount, only applies to percentage or fixed-amount discounts',
652 'merchant'
653 ),
654 '{discount_amount}',
655 ),
656 ),
657
658 array(
659 'id' => 'button_text',
660 'type' => 'text',
661 'title' => esc_html__( 'Button text', 'merchant' ),
662 'default' => esc_html__( 'Add to cart', 'merchant' ),
663 ),
664 ),
665 ),
666 ),
667 ),
668 ),
669 'default' => array(
670 array(
671 'layout' => 'offer-details',
672 'min_quantity' => 2,
673 'discount' => 10,
674 'discount_type' => 'percentage_discount',
675 ),
676 ),
677 ),
678 ),
679 ) );
680
681
682 /**
683 * Style
684 */
685 Merchant_Admin_Options::create( array(
686 'title' => esc_html__( 'Look and Feel', 'merchant' ),
687 'module' => Merchant_Complementary_Products::MODULE_ID,
688 'fields' => array(
689 array(
690 'id' => 'layout',
691 'type' => 'radio',
692 'title' => esc_html__( 'Layout', 'merchant' ),
693 'options' => array(
694 'classic' => esc_html__( 'Classic', 'merchant' ),
695 'compact' => esc_html__( 'Compact', 'merchant' ),
696 // only the copy has been changed to carousel, but the naming is the same "slider"
697 'slider' => esc_html__( 'Carousel', 'merchant' ),
698 ),
699 'default' => 'slider',
700 ),
701
702 array(
703 'id' => 'checkbox_style',
704 'type' => 'radio',
705 'title' => esc_html__( 'Checkbox style', 'merchant' ),
706 'options' => array(
707 'rounded' => esc_html__( 'Rounded', 'merchant' ),
708 'square' => esc_html__( 'Square', 'merchant' ),
709 ),
710 'default' => 'square',
711 ),
712
713 array(
714 'id' => 'checkbox_color',
715 'type' => 'color',
716 'title' => esc_html__( 'Checkbox color', 'merchant' ),
717 'default' => '#000000',
718 ),
719
720 array(
721 'id' => 'title_color',
722 'type' => 'color',
723 'title' => esc_html__( 'Title color', 'merchant' ),
724 'default' => '#000000',
725 ),
726
727 array(
728 'id' => 'description_color',
729 'type' => 'color',
730 'title' => esc_html__( 'Description color', 'merchant' ),
731 'default' => '#000000',
732 ),
733
734 array(
735 'id' => 'border_color',
736 'type' => 'color',
737 'title' => esc_html__( 'Border color', 'merchant' ),
738 'default' => '#000000',
739 ),
740
741 array(
742 'id' => 'image_border_color',
743 'type' => 'color',
744 'title' => esc_html__( 'Image border color', 'merchant' ),
745 'default' => 'rgba(0,0,0,0)',
746 ),
747
748 array(
749 'id' => 'title_heading_size',
750 'type' => 'select',
751 'title' => esc_html__( 'Title heading', 'merchant' ),
752 'options' => array(
753 'h1' => esc_html__( 'H1', 'merchant' ),
754 'h2' => esc_html__( 'H2', 'merchant' ),
755 'h3' => esc_html__( 'H3', 'merchant' ),
756 'h4' => esc_html__( 'H4', 'merchant' ),
757 'h5' => esc_html__( 'H5', 'merchant' ),
758 'h6' => esc_html__( 'H6', 'merchant' ),
759 ),
760 'default' => 'h4',
761 ),
762
763
764 array(
765 'id' => 'description_font_size',
766 'type' => 'range',
767 'title' => esc_html__( 'Description font size', 'merchant' ),
768 'min' => 0,
769 'max' => 100,
770 'step' => 1,
771 'unit' => 'px',
772 'default' => 14,
773 ),
774
775 array(
776 'id' => 'title_description_alignment',
777 'type' => 'radio',
778 'title' => esc_html__( 'Title and description alignment', 'merchant' ),
779 'options' => array(
780 'left' => esc_html__( 'Left', 'merchant' ),
781 'center' => esc_html__( 'Center', 'merchant' ),
782 'right' => esc_html__( 'Right', 'merchant' ),
783 ),
784 'default' => 'left',
785 ),
786
787 array(
788 'id' => 'border_radius',
789 'type' => 'range',
790 'title' => esc_html__( 'Border radius', 'merchant' ),
791 'min' => 0,
792 'max' => 60,
793 'step' => 1,
794 'default' => 0,
795 'unit' => 'px',
796 ),
797
798 array(
799 'id' => 'image_border_radius',
800 'type' => 'range',
801 'title' => esc_html__( 'Image border radius', 'merchant' ),
802 'min' => 0,
803 'max' => 60,
804 'step' => 1,
805 'default' => 0,
806 'unit' => 'px',
807 ),
808 ),
809 ) );
810
811 // Shortcode
812 $merchant_module_id = Merchant_Complementary_Products::MODULE_ID;
813 Merchant_Admin_Options::create( array(
814 'module' => $merchant_module_id,
815 'title' => esc_html__( 'Use shortcode', 'merchant' ),
816 'fields' => array(
817 array(
818 'id' => 'use_shortcode',
819 'type' => 'switcher',
820 'title' => __( 'Use shortcode', 'merchant' ),
821 'default' => 0,
822 ),
823 array(
824 'type' => 'info',
825 'id' => 'shortcode_info',
826 '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.',
827 'merchant' ),
828 ),
829 array(
830 'id' => 'shortcode_text',
831 'type' => 'text_readonly',
832 'title' => esc_html__( 'Shortcode text', 'merchant' ),
833 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
834 'condition' => array( 'use_shortcode', '==', '1' ),
835 ),
836 ),
837 ) );