PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.11.1
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.11.1
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 / volume-discounts / admin / options.php

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

703 lines 26.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Volume Discounts Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 Merchant_Admin_Options::create( array(
14 'title' => esc_html__( 'Offers', 'merchant' ),
15 'module' => Merchant_Volume_Discounts::MODULE_ID,
16 'fields' => array(
17 array(
18 'id' => 'offers',
19 'type' => 'flexible_content',
20 'button_label' => esc_html__( 'Add New Offer', 'merchant' ),
21 'style' => Merchant_Volume_Discounts::MODULE_ID . '-style default',
22 'sorting' => true,
23 'accordion' => true,
24 'duplicate' => true,
25 'layouts' => array(
26 'offer-details' => array(
27 'title' => esc_html__( 'Create Discount Tiers', 'merchant' ),
28 'title-field' => 'offer-title', // text field ID to use as title for the layout
29 'fields' => array(
30 array(
31 'id' => 'offer-title',
32 'type' => 'text',
33 'title' => esc_html__( 'Offer name', 'merchant' ),
34 'default' => esc_html__( 'Campaign', 'merchant' ),
35 ),
36 array(
37 'id' => 'rules_to_display',
38 'type' => 'select',
39 'title' => esc_html__( 'Offered product(s)', 'merchant' ),
40 'options' => array(
41 'all' => esc_html__( 'All Products', 'merchant' ),
42 'products' => esc_html__( 'Specific Products', 'merchant' ),
43 'categories' => esc_html__( 'Specific Categories', 'merchant' ),
44 'tags' => esc_html__( 'Specific Tags', 'merchant' ),
45 ),
46 'default' => 'products',
47 ),
48 array(
49 'id' => 'include_all_cart_products',
50 'type' => 'switcher',
51 'title' => esc_html__( 'Include all cart products', 'merchant' ),
52 'desc' => esc_html__( 'Apply the discount based on the total quantity of products added to the cart, rather than requiring a specific quantity of each individual product.', 'merchant' ),
53 'default' => false,
54 'condition' => array( 'rules_to_display', '==', 'all' ),
55 ),
56 array(
57 'id' => 'product_id',
58 'type' => 'products_selector',
59 //'title' => esc_html__( 'Select product', 'merchant' ),
60 'multiple' => true,
61 'desc' => esc_html__( 'Select the product that the customer will get a discount on when they purchase the minimum required quantity.',
62 'merchant' ),
63 'allowed_types' => array( 'simple', 'variable' ),
64 'condition' => array( 'rules_to_display', '==', 'products' ),
65 ),
66 array(
67 'id' => 'category_slugs',
68 'type' => 'select_ajax',
69 'title' => esc_html__( 'Categories', 'merchant' ),
70 'source' => 'options',
71 'multiple' => true,
72 'options' => Merchant_Admin_Options::get_category_select2_choices(),
73 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
74 'desc' => esc_html__( 'Select the product categories that will show the offer.', 'merchant' ),
75 'condition' => array( 'rules_to_display', '==', 'categories' ),
76 ),
77 array(
78 'id' => 'include_all_category_products',
79 'type' => 'switcher',
80 'title' => esc_html__( 'Include all category products', 'merchant' ),
81 'desc' => esc_html__( 'Apply the discount based on the total quantity of products within the same category added to the cart, rather than requiring a specific quantity of each individual product.', 'merchant' ),
82 'default' => false,
83 'condition' => array( 'rules_to_display', '==', 'categories' ),
84 ),
85 array(
86 'id' => 'include_all_products_info',
87 'type' => 'info',
88 'content' => esc_html__( 'When configuring offer priorities, consider the order in which they are applied. Typically, more general offers should be prioritized higher to ensure consistent discount application. You can control the priority by sorting the offers—offers listed at the top have the highest priority. However, note that this setup will not work on the thank you page.',
89 'merchant' ),
90 'conditions' => array(
91 'relation' => 'OR', // AND/OR, If not provided, only first term will be considered
92 'terms' => array(
93 array(
94 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
95 'terms' => array(
96 array(
97 'field' => 'rules_to_display', // field ID
98 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
99 'value' => 'categories', // can be a single value or an array of string/number/int
100 ),
101 array(
102 'field' => 'include_all_category_products', // field ID
103 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
104 'value' => true, // can be a single value or an array of string/number/int
105 ),
106 ),
107 ),
108 array(
109 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
110 'terms' => array(
111 array(
112 'field' => 'rules_to_display', // field ID
113 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
114 'value' => 'all', // can be a single value or an array of string/number/int
115 ),
116 array(
117 'field' => 'include_all_cart_products', // field ID
118 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
119 'value' => true, // can be a single value or an array of string/number/int
120 ),
121 ),
122 ),
123 ),
124 ),
125 ),
126 array(
127 'id' => 'tag_slugs',
128 'type' => 'select_ajax',
129 'title' => esc_html__( 'Tags', 'merchant' ),
130 'source' => 'options',
131 'multiple' => true,
132 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
133 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
134 'desc' => esc_html__( 'Select the product tags that will show the offer.', 'merchant' ),
135 'condition' => array( 'rules_to_display', '==', 'tags' ),
136 ),
137
138 array(
139 'id' => 'exclusion_enabled',
140 'type' => 'switcher',
141 'title' => esc_html__( 'Exclusion List', 'merchant' ),
142 'desc' => esc_html__( 'Select the products that will not show the offer.', 'merchant' ),
143 'default' => 0,
144 'conditions' => array(
145 'relation' => 'AND',
146 'terms' => array(
147 array(
148 'field' => 'rules_to_display',
149 'operator' => 'in',
150 'value' => array( 'all', 'categories', 'tags' ),
151 ),
152 ),
153 ),
154 ),
155
156 array(
157 'id' => 'excluded_products',
158 'type' => 'products_selector',
159 'title' => esc_html__( 'Exclude Products', 'merchant' ),
160 'multiple' => true,
161 'desc' => esc_html__( 'Exclude products from this campaign.', 'merchant' ),
162 'conditions' => array(
163 'relation' => 'AND',
164 'terms' => array(
165 array(
166 'field' => 'rules_to_display',
167 'operator' => 'in',
168 'value' => array( 'all', 'categories', 'tags' ),
169 ),
170 array(
171 'field' => 'exclusion_enabled',
172 'operator' => '===',
173 'value' => true,
174 ),
175 ),
176 ),
177 ),
178
179 array(
180 'id' => 'excluded_categories',
181 'type' => 'select_ajax',
182 'title' => esc_html__( 'Exclude Categories', 'merchant' ),
183 'source' => 'options',
184 'multiple' => true,
185 'options' => Merchant_Admin_Options::get_category_select2_choices(),
186 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
187 'desc' => esc_html__( 'Exclude categories from this campaign.', 'merchant' ),
188 'conditions' => array(
189 'relation' => 'AND',
190 'terms' => array(
191 array(
192 'field' => 'rules_to_display',
193 'operator' => 'in',
194 'value' => array( 'all' ),
195 ),
196 array(
197 'field' => 'exclusion_enabled',
198 'operator' => '===',
199 'value' => true,
200 ),
201 ),
202 ),
203 ),
204
205 array(
206 'id' => 'excluded_tags',
207 'type' => 'select_ajax',
208 'title' => esc_html__( 'Exclude Tags', 'merchant' ),
209 'source' => 'options',
210 'multiple' => true,
211 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
212 'placeholder' => esc_html__( 'Select tags', 'merchant' ),
213 'desc' => esc_html__( 'Exclude tags from this campaign.', 'merchant' ),
214 'conditions' => array(
215 'relation' => 'AND',
216 'terms' => array(
217 array(
218 'field' => 'rules_to_display',
219 'operator' => 'in',
220 'value' => array( 'all' ),
221 ),
222 array(
223 'field' => 'exclusion_enabled',
224 'operator' => '===',
225 'value' => true,
226 ),
227 ),
228 ),
229 ),
230
231 array(
232 'id' => 'quantity',
233 'type' => 'number',
234 'title' => esc_html__( 'Quantity', 'merchant' ),
235 'default' => 2,
236 ),
237
238 array(
239 'id' => 'discount_type',
240 'type' => 'radio',
241 'title' => esc_html__( 'Discount', 'merchant' ),
242 'options' => array(
243 'percentage_discount' => esc_html__( 'Percentage', 'merchant' ),
244 'fixed_discount' => esc_html__( 'Fixed', 'merchant' ),
245 ),
246 'default' => 'percentage_discount',
247 ),
248 array(
249 'id' => 'discount',
250 'type' => 'number',
251 'step' => 0.01,
252 'default' => 10,
253 ),
254
255 array(
256 'id' => 'exclude_coupon',
257 'type' => 'switcher',
258 'title' => esc_html__( 'Exclude coupons', 'merchant' ),
259 'desc' => esc_html__( 'Coupon codes will not be applicable on top of this offer campaign.', 'merchant' ),
260 'default' => false,
261 ),
262
263 array(
264 'id' => 'user_condition',
265 'type' => 'select',
266 'title' => esc_html__( 'User Condition', 'merchant' ),
267 'options' => array(
268 'all' => esc_html__( 'All Users', 'merchant' ),
269 'customers' => esc_html__( 'Selected Users', 'merchant' ),
270 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
271 ),
272 'default' => 'all',
273 ),
274
275 array(
276 'id' => 'user_condition_roles',
277 'type' => 'select_ajax',
278 'title' => esc_html__( 'User Roles', 'merchant' ),
279 'desc' => esc_html__( 'This will limit the offer to users with these roles.', 'merchant' ),
280 'source' => 'options',
281 'multiple' => true,
282 'classes' => array( 'flex-grow' ),
283 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
284 'condition' => array( 'user_condition', '==', 'roles' ),
285 ),
286
287 array(
288 'id' => 'user_condition_users',
289 'type' => 'select_ajax',
290 'title' => esc_html__( 'Users', 'merchant' ),
291 'desc' => esc_html__( 'This will limit the offer to the selected customers.', 'merchant' ),
292 'source' => 'user',
293 'multiple' => true,
294 'classes' => array( 'flex-grow' ),
295 'condition' => array( 'user_condition', '==', 'customers' ),
296 ),
297
298 array(
299 'id' => 'product_single_page',
300 'type' => 'fields_group',
301 'title' => esc_html__( 'Product Single Page', 'merchant' ),
302 'sub-desc' => esc_html__( 'Use these settings to control how bulk discount offers appear on product pages.', 'merchant' ),
303 'state' => 'open',
304 'accordion' => true,
305 'display_status' => true,
306 'default' => 'active',
307 'fields' => array(
308 array(
309 'id' => 'single_product_placement',
310 'type' => 'radio',
311 'title' => esc_html__( 'Placement on product page', 'merchant' ),
312 'options' => array(
313 'before-cart-form' => esc_html__( 'Before add to cart', 'merchant' ),
314 'after-cart-form' => esc_html__( 'After add to cart', 'merchant' ),
315 ),
316 'default' => 'before-cart-form',
317 ),
318
319 // text formatting
320 array(
321 'id' => 'table_title',
322 'type' => 'text',
323 'title' => esc_html__( 'Offer title', 'merchant' ),
324 'default' => __( 'Buy more, save more!', 'merchant' ),
325 ),
326
327 // `hidden_desc` depends on `desc`
328 array(
329 'id' => 'save_label',
330 'type' => 'text',
331 'title' => esc_html__( 'Save label', 'merchant' ),
332 'default' => esc_html__( 'Save {amount}', 'merchant' ),
333 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
334 'hidden_desc' => sprintf(
335 /* Translators: %1$s: Discount amount, %2$s: Discount percentage */
336 __( '<strong>%1$s:</strong> to show discount amount<br><strong>%2$s:</strong> to show discount percentage', 'merchant' ),
337 '{amount}',
338 '{percent}'
339 ),
340 ),
341
342 array(
343 'id' => 'buy_text',
344 'type' => 'text',
345 'title' => esc_html__( 'Tier format text', 'merchant' ),
346 'default' => esc_html__( 'Buy {quantity}, get {discount} off each', 'merchant' ),
347 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
348 'hidden_desc' => sprintf(
349 /* Translators: %1$s: Discount percentage, %2$s: Quantity, %3$s: Discount amount */
350 __( '<strong>%1$s:</strong> to show discount percentage<br><strong>%2$s:</strong> to show the number of items needed to buy to get the discount<br><strong>%3$s:</strong> to show discount amount on each item',
351 'merchant' ),
352 '{percent}',
353 '{quantity}',
354 '{discount}'
355 ),
356 ),
357
358 array(
359 'id' => 'item_text',
360 'type' => 'text',
361 'title' => esc_html__( 'Item text', 'merchant' ),
362 'default' => esc_html__( 'Per item:', 'merchant' ),
363 ),
364
365 array(
366 'id' => 'total_text',
367 'type' => 'text',
368 'title' => esc_html__( 'Total text', 'merchant' ),
369 'default' => esc_html__( 'Total price:', 'merchant' ),
370 ),
371
372 array(
373 'id' => 'cart_title_text',
374 'type' => 'text',
375 'title' => esc_html__( 'Cart item discount title', 'merchant' ),
376 'default' => esc_html__( 'Discount', 'merchant' ),
377 'desc' => esc_html__( 'This is displayed on the cart page.', 'merchant' ),
378 ),
379
380 array(
381 'id' => 'cart_description_text',
382 'type' => 'text',
383 'title' => esc_html__( 'Cart item discount description', 'merchant' ),
384 'default' => esc_html__( 'A discount of {amount} has been applied.', 'merchant' ),
385 'desc' => __( 'This is displayed on the cart page. You can use these codes in the content.', 'merchant' ),
386 'hidden_desc' => sprintf(
387 /* Translators: %1$s: Discount amount, %2$s: Discount percentage */
388 __( '<strong>%1$s:</strong> to show discount amount<br><strong>%2$s:</strong> to show discount percentage', 'merchant' ),
389 '{amount}',
390 '{percent}'
391 ),
392 ),
393
394 // style settings
395 array(
396 'id' => 'title_font_size',
397 'type' => 'range',
398 'title' => esc_html__( 'Title font size', 'merchant' ),
399 'min' => 0,
400 'max' => 100,
401 'step' => 1,
402 'unit' => 'px',
403 'default' => 16,
404 ),
405
406 array(
407 'id' => 'title_font_weight',
408 'type' => 'select',
409 'title' => esc_html__( 'Title font weight', 'merchant' ),
410 'options' => array(
411 'lighter' => esc_html__( 'Light', 'merchant' ),
412 'normal' => esc_html__( 'Normal', 'merchant' ),
413 'bold' => esc_html__( 'Bold', 'merchant' ),
414 ),
415 'default' => 'normal',
416 ),
417
418 array(
419 'id' => 'title_text_color',
420 'type' => 'color',
421 'title' => esc_html__( 'Title text color', 'merchant' ),
422 'default' => '#212121',
423 ),
424
425 array(
426 'id' => 'title_text_color_hover',
427 'type' => 'color',
428 'title' => esc_html__( 'Title text color hover', 'merchant' ),
429 'default' => '#212121',
430 ),
431
432 array(
433 'id' => 'table_item_bg_color',
434 'type' => 'color',
435 'title' => esc_html__( 'Background color', 'merchant' ),
436 'default' => '#fcf0f1',
437 ),
438
439 array(
440 'id' => 'table_item_bg_color_hover',
441 'type' => 'color',
442 'title' => esc_html__( 'Background color hover', 'merchant' ),
443 'default' => '#fcf0f1',
444 ),
445
446 array(
447 'id' => 'table_item_border_color',
448 'type' => 'color',
449 'title' => esc_html__( 'Border color', 'merchant' ),
450 'default' => '#d83b3b',
451 ),
452
453 array(
454 'id' => 'table_item_border_color_hover',
455 'type' => 'color',
456 'title' => esc_html__( 'Border color hover', 'merchant' ),
457 'default' => '#d83b3b',
458 ),
459
460 array(
461 'id' => 'table_item_text_color',
462 'type' => 'color',
463 'title' => esc_html__( 'Text color', 'merchant' ),
464 'default' => '#3c434a',
465 ),
466
467 array(
468 'id' => 'table_item_text_color_hover',
469 'type' => 'color',
470 'title' => esc_html__( 'Text color hover', 'merchant' ),
471 'default' => '#3c434a',
472 ),
473
474 array(
475 'id' => 'table_label_bg_color',
476 'type' => 'color',
477 'title' => esc_html__( 'Label background color', 'merchant' ),
478 'default' => '#d83b3b',
479 ),
480
481 array(
482 'id' => 'table_label_text_color',
483 'type' => 'color',
484 'title' => esc_html__( 'Label text color', 'merchant' ),
485 'default' => '#ffffff',
486 ),
487 ),
488 ),
489 array(
490 'id' => 'cart_page',
491 'type' => 'fields_group',
492 'title' => esc_html__( 'Cart Page', 'merchant' ),
493 'sub-desc' => esc_html__( 'Use these settings to control how bulk discount offers appear on the cart page.', 'merchant' ),
494 'state' => 'closed',
495 'accordion' => true,
496 'display_status' => true,
497 'default' => 'inactive',
498 'fields' => array(
499 // Text Formatting Settings
500 array(
501 'id' => 'title',
502 'type' => 'text',
503 'title' => esc_html__( 'Offer title', 'merchant' ),
504 'default' => esc_html__( 'Add {quantity} more to get a {discount} discount off each', 'merchant' ),
505 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
506 'hidden_desc' => sprintf(
507 /* Translators: %1$s: offer quantity, %2$s: discount amount */
508 __(
509 '<strong>%1$s:</strong> to show offer quantity<br><strong>%2$s:</strong> to show discount amount',
510 'merchant'
511 ),
512 '{quantity}',
513 '{discount}'
514 ),
515 ),
516
517 array(
518 'id' => 'button_text',
519 'type' => 'text',
520 'title' => esc_html__( 'Button text', 'merchant' ),
521 'default' => esc_html__( 'Add To Cart', 'merchant' ),
522 ),
523 ),
524 ),
525 array(
526 'id' => 'checkout_page',
527 'type' => 'fields_group',
528 'title' => esc_html__( 'Checkout Page', 'merchant' ),
529 'sub-desc' => esc_html__( 'Use these settings to control how bulk discount offers appear on the checkout page.', 'merchant' ),
530 'state' => 'closed',
531 'default' => 'inactive',
532 'accordion' => true,
533 'display_status' => true,
534 'fields' => array(
535 array(
536 'id' => 'placement',
537 'type' => 'select',
538 'title' => esc_html__( 'Placement', 'merchant' ),
539 'options' => array(
540 'before_billing_details' => esc_html__( 'Before Billing Details', 'merchant' ),
541 'after_billing_details' => esc_html__( 'After Billing Details', 'merchant' ),
542 'before_order_details' => esc_html__( 'Before Order Details', 'merchant' ),
543 'before_payment_options' => esc_html__( 'Before Payment Gateways', 'merchant' ),
544 'before_order_placement_btn' => esc_html__( 'Before Order Placement Button', 'merchant' ),
545 'after_order_placement_btn' => esc_html__( 'After Order Placement Button', 'merchant' ),
546 ),
547 'default' => 'before_billing_details',
548 ),
549 array(
550 'id' => 'title',
551 'type' => 'text',
552 'title' => esc_html__( 'Offer title', 'merchant' ),
553 'default' => esc_html__( 'Add {quantity} more to get {discount} off', 'merchant' ),
554 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
555 'hidden_desc' => sprintf(
556 /* Translators: %1$s: offer quantity, %2$s: discount amount */
557 __(
558 '<strong>%1$s:</strong> to show offer quantity<br><strong>%2$s:</strong> to show discount amount',
559 'merchant'
560 ),
561 '{quantity}',
562 '{discount}'
563 ),
564 ),
565 array(
566 'id' => 'discount_text',
567 'type' => 'text',
568 'title' => esc_html__( 'Discount text', 'merchant' ),
569 'default' => esc_html__( '{product_price}', 'merchant' ),
570 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
571 'hidden_desc' => sprintf(
572 /* Translators: %1$s: product price */
573 __(
574 '<strong>%1$s:</strong> to show product price<br><strong>%2$s:</strong> to show offer discount amount',
575 'merchant'
576 ),
577 '{product_price}',
578 '{discount}'
579 ),
580 ),
581 array(
582 'id' => 'button_text',
583 'type' => 'text',
584 'title' => esc_html__( 'Button text', 'merchant' ),
585 'default' => esc_html__( 'Add To Cart', 'merchant' ),
586 ),
587 ),
588 ),
589 array(
590 'id' => 'thank_you_page',
591 'type' => 'fields_group',
592 'title' => esc_html__( 'Thank You Page', 'merchant' ),
593 'sub-desc' => esc_html__( 'Use these settings to control how bulk discount offers appear on the thank you page.', 'merchant' ),
594 'state' => 'closed',
595 'accordion' => true,
596 'display_status' => true,
597 'default' => 'inactive',
598 'fields' => array(
599 // Text Formatting Settings
600 array(
601 'id' => 'title',
602 'type' => 'text',
603 'title' => esc_html__( 'Offer title', 'merchant' ),
604 'default' => esc_html__( 'Add {quantity} more to get {discount} off', 'merchant' ),
605 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
606 'hidden_desc' => sprintf(
607 /* Translators: %1$s: quantity, %2$s: post purchase discount, %3$s: In Stock, %4$s: Total quantity */
608 __(
609 '<strong>%1$s:</strong> to show product quantity<br><strong>%2$s:</strong> to show the discount amount',
610 'merchant'
611 ),
612 '{quantity}',
613 '{discount}'
614 ),
615 ),
616
617 array(
618 'id' => 'placement',
619 'type' => 'select',
620 'title' => esc_html__( 'Placement', 'merchant' ),
621 'options' => array(
622 'on_top' => esc_html__( 'On Top', 'merchant' ),
623 'before_order_details' => esc_html__( 'Before Order details', 'merchant' ),
624 'after_order_details' => esc_html__( 'After Order details', 'merchant' ),
625 ),
626 'default' => 'before_order_details',
627 ),
628
629 array(
630 'id' => 'discount_text',
631 'type' => 'text',
632 'title' => esc_html__( 'Discount text', 'merchant' ),
633 'default' => esc_html__( '{product_price}', 'merchant' ),
634 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
635 'hidden_desc' => sprintf(
636 /* Translators: %1$s: Discount amount, %2$s: product price */
637 __(
638 '<strong>%1$s:</strong> to show the discount amount<br><strong>%2$s:</strong> to show the product price before and after the offer discount',
639 'merchant'
640 ),
641 '{discount}',
642 '{product_price}'
643 ),
644 ),
645
646 array(
647 'id' => 'bonus_tip_text',
648 'type' => 'text',
649 'title' => esc_html__( 'Bonus tip text', 'merchant' ),
650 'default' => esc_html__( 'Bonus: You will also receive this discount off each item you just purchased as part of this bulk discount offer.', 'merchant' ),
651 ),
652
653 array(
654 'id' => 'button_text',
655 'type' => 'text',
656 'title' => esc_html__( 'Button text', 'merchant' ),
657 'default' => esc_html__( 'Add To Cart', 'merchant' ),
658 ),
659 ),
660 ),
661 ),
662 ),
663 ),
664 'default' => array(
665 array(
666 'layout' => 'offer-details',
667 'min_quantity' => 2,
668 'discount' => 10,
669 'discount_type' => 'fixed_discount',
670 ),
671 ),
672 ),
673 ),
674 ) );
675
676 // Shortcode
677 $merchant_module_id = Merchant_Volume_Discounts::MODULE_ID;
678 Merchant_Admin_Options::create( array(
679 'module' => $merchant_module_id,
680 'title' => esc_html__( 'Use shortcode', 'merchant' ),
681 'fields' => array(
682 array(
683 'id' => 'use_shortcode',
684 'type' => 'switcher',
685 'title' => __( 'Use shortcode', 'merchant' ),
686 'default' => 0,
687 ),
688 array(
689 'type' => 'info',
690 'id' => 'shortcode_info',
691 '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.',
692 'merchant' ),
693 ),
694 array(
695 'id' => 'shortcode_text',
696 'type' => 'text_readonly',
697 'title' => esc_html__( 'Shortcode text', 'merchant' ),
698 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
699 'condition' => array( 'use_shortcode', '==', '1' ),
700 ),
701 ),
702 ) );
703