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 / free-shipping-progress-bar / 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/free-shipping-progress-bar/admin/options.php

1,138 lines 35.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Free Shipping Progress Bar
4 *
5 * @package Merchant
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly
10 }
11
12 /**
13 * Hook functionality before including modules options.
14 *
15 * @since 1.9.15
16 */
17 do_action( 'merchant_admin_before_include_modules_options', Merchant_Free_Shipping_Progress_Bar::MODULE_ID );
18
19 $merchant_module_id = Merchant_Free_Shipping_Progress_Bar::MODULE_ID;
20 /**
21 * Content
22 */
23 Merchant_Admin_Options::create( array(
24 'title' => esc_html__( 'Content', 'merchant' ),
25 'module' => Merchant_Free_Shipping_Progress_Bar::MODULE_ID,
26 'fields' => array(
27 array(
28 'id' => 'config_msg',
29 'type' => 'content',
30 'title' => esc_html__( 'Message Configuration', 'merchant' ),
31 'content' => '',
32 'desc' => esc_html__( 'Configure the 3 states of the free shipping offer. Personalize the text to maximize the conversion.', 'merchant' ),
33 ),
34
35 array(
36 'id' => 'free_shipping_initial_text',
37 'type' => 'text',
38 'title' => esc_html__( 'Initial Message', 'merchant' ),
39 'default' => esc_html__( 'Free shipping for orders over {amount}!', 'merchant' ),
40 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
41 'hidden_desc' => sprintf(
42 /* Translators: %1$s: the free shipping amount */
43 __(
44 '<strong>%1$s:</strong> to show the free shipping required amount',
45 'merchant'
46 ),
47 '{amount}'
48 ),
49 ),
50
51 array(
52 'id' => 'free_shipping_text',
53 'type' => 'text',
54 'title' => esc_html__( 'Free shipping text', 'merchant' ),
55 'default' => esc_html__( 'You are {amount_left} away from free shipping.', 'merchant' ),
56 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
57 'hidden_desc' => sprintf(
58 /* Translators: %1$s: the free shipping amount */
59 __(
60 '<strong>%1$s:</strong> to show the free shipping amount left',
61 'merchant'
62 ),
63 '{amount_left}'
64 ),
65 ),
66
67 array(
68 'id' => 'qualified_free_shipping_text',
69 'type' => 'text',
70 'title' => esc_html__( 'Qualified free shipping text', 'merchant' ),
71 'default' => esc_html__( 'You have qualified for free shipping.', 'merchant' ),
72 ),
73
74 array(
75 'id' => 'include_tax',
76 'type' => 'switcher',
77 'title' => esc_html__( 'Include tax in calculation', 'merchant' ),
78 'default' => 0,
79 ),
80
81 array(
82 'id' => 'user_condition',
83 'type' => 'select',
84 'title' => esc_html__( 'User Condition', 'merchant' ),
85 'options' => array(
86 'all' => esc_html__( 'All Users', 'merchant' ),
87 'users' => esc_html__( 'Selected Users', 'merchant' ),
88 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
89 ),
90 'default' => 'all',
91 ),
92
93 array(
94 'id' => 'user_condition_roles',
95 'type' => 'select_ajax',
96 'title' => esc_html__( 'User Roles', 'merchant' ),
97 'desc' => esc_html__( 'This will limit the offer to users with these roles.', 'merchant' ),
98 'source' => 'options',
99 'multiple' => true,
100 'classes' => array( 'flex-grow' ),
101 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
102 'conditions' => array(
103 'terms' => array(
104 array(
105 'field' => 'user_condition', // field ID
106 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
107 'value' => 'roles', // can be a single value or an array of string/number/int
108 ),
109 ),
110 ),
111 ),
112
113 array(
114 'id' => 'user_condition_users',
115 'type' => 'select_ajax',
116 'title' => esc_html__( 'Users', 'merchant' ),
117 'desc' => esc_html__( 'This will limit the offer to the selected customers.', 'merchant' ),
118 'source' => 'user',
119 'multiple' => true,
120 'classes' => array( 'flex-grow' ),
121 'conditions' => array(
122 'terms' => array(
123 array(
124 'field' => 'user_condition', // field ID
125 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
126 'value' => 'users', // can be a single value or an array of string/number/int
127 ),
128 ),
129 ),
130 ),
131
132 array(
133 'id' => 'user_exclusion_enabled',
134 'type' => 'switcher',
135 'title' => esc_html__( 'Exclusion List', 'merchant' ),
136 'desc' => esc_html__( 'Select the users that will not show the offer.', 'merchant' ),
137 'default' => 0,
138 'conditions' => array(
139 'relation' => 'AND',
140 'terms' => array(
141 array(
142 'field' => 'user_condition',
143 'operator' => 'in',
144 'value' => array( 'all', 'roles' ),
145 ),
146 ),
147 ),
148 ),
149
150 array(
151 'id' => 'exclude_roles',
152 'type' => 'select_ajax',
153 'title' => esc_html__( 'Exclude Roles', 'merchant' ),
154 'desc' => esc_html__( 'This will exclude the offer for users with these roles.', 'merchant' ),
155 'source' => 'options',
156 'multiple' => true,
157 'classes' => array( 'flex-grow' ),
158 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
159 'conditions' => array(
160 'relation' => 'AND',
161 'terms' => array(
162 array(
163 'field' => 'user_condition',
164 'operator' => 'in',
165 'value' => array( 'all' ),
166 ),
167 array(
168 'field' => 'user_exclusion_enabled',
169 'operator' => '===',
170 'value' => true,
171 ),
172 ),
173 ),
174 ),
175
176 array(
177 'id' => 'exclude_users',
178 'type' => 'select_ajax',
179 'title' => esc_html__( 'Exclude Users', 'merchant' ),
180 'desc' => esc_html__( 'This will exclude the offer for the selected customers.', 'merchant' ),
181 'source' => 'user',
182 'multiple' => true,
183 'classes' => array( 'flex-grow' ),
184 'conditions' => array(
185 'relation' => 'AND',
186 'terms' => array(
187 array(
188 'field' => 'user_condition',
189 'operator' => 'in',
190 'value' => array( 'all', 'roles' ),
191 ),
192 array(
193 'field' => 'user_exclusion_enabled',
194 'operator' => '===',
195 'value' => true,
196 ),
197 ),
198 ),
199 ),
200 ),
201 ) );
202
203 /**
204 * Placement
205 */
206 Merchant_Admin_Options::create( array(
207 'title' => esc_html__( 'Placement', 'merchant' ),
208 'module' => Merchant_Free_Shipping_Progress_Bar::MODULE_ID,
209 'fields' => array(
210 array(
211 'id' => 'top_bottom_bar',
212 'type' => 'switcher',
213 'title' => esc_html__( 'Top/Bottom Bar', 'merchant' ),
214 'default' => 0,
215 ),
216
217 array(
218 'id' => 'scroll_visibility',
219 'type' => 'radio',
220 'title' => __( 'Position', 'merchant' ),
221 'options' => array(
222 'sticky' => __( 'Sticky (always visible)', 'merchant' ),
223 'fixed' => __( 'Fixed (hidden on scroll)', 'merchant' ),
224 ),
225 'default' => 'fixed',
226 'conditions' => array(
227 'terms' => array(
228 array(
229 'field' => 'top_bottom_bar', // field ID
230 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
231 'value' => true, // can be a single value or an array of string/number/int
232 ),
233 ),
234 ),
235 ),
236
237 array(
238 'id' => 'top_bottom_bar_show_on',
239 'type' => 'select',
240 'title' => esc_html__( 'Show on', 'merchant' ),
241 'options' => array(
242 'both' => esc_html__( 'Both Desktop & Mobile', 'merchant' ),
243 'desktop' => esc_html__( 'Desktop Only', 'merchant' ),
244 'mobile' => esc_html__( 'Mobile Only', 'merchant' ),
245 ),
246 'default' => 'both',
247 'conditions' => array(
248 'terms' => array(
249 array(
250 'field' => 'top_bottom_bar', // field ID
251 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
252 'value' => true, // can be a single value or an array of string/number/int
253 ),
254 ),
255 ),
256 ),
257
258 array(
259 'id' => 'desktop_placement',
260 'type' => 'select',
261 'title' => esc_html__( 'Desktop Placement', 'merchant' ),
262 'options' => array(
263 'top' => esc_html__( 'Top', 'merchant' ),
264 'bottom' => esc_html__( 'Bottom', 'merchant' ),
265 ),
266 'default' => 'bottom',
267 'conditions' => array(
268 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
269 'terms' => array(
270 array(
271 'field' => 'top_bottom_bar', // field ID
272 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
273 'value' => true, // can be a single value or an array of string/number/int
274 ),
275 array(
276 'field' => 'top_bottom_bar_show_on', // field ID
277 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
278 'value' => array( 'desktop', 'both' ), // can be a single value or an array of string/number/int
279 ),
280 ),
281 ),
282 ),
283
284 // array(
285 // 'id' => 'desktop_alignment',
286 // 'type' => 'select',
287 // 'title' => esc_html__( 'Desktop Alignment', 'merchant' ),
288 // 'options' => array(
289 // 'right' => esc_html__( 'Right', 'merchant' ),
290 // 'left' => esc_html__( 'Left', 'merchant' ),
291 // ),
292 // 'default' => 'right',
293 // 'conditions' => array(
294 // 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
295 // 'terms' => array(
296 // array(
297 // 'field' => 'desktop_placement', // field ID
298 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
299 // 'value' => 'top', // can be a single value or an array of string/number/int
300 // ),
301 // array(
302 // 'field' => 'top_bottom_bar', // field ID
303 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
304 // 'value' => true, // can be a single value or an array of string/number/int
305 // ),
306 // array(
307 // 'field' => 'top_bottom_bar_show_on', // field ID
308 // 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
309 // 'value' => array( 'desktop', 'both' ), // can be a single value or an array of string/number/int
310 // ),
311 // ),
312 // ),
313 // ),
314
315 array(
316 'id' => 'desktop_offset_toggle',
317 'type' => 'checkbox',
318 'label' => __( 'Custom vertical offset', 'merchant' ),
319 'default' => 0,
320 'conditions' => array(
321 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
322 'terms' => array(
323 array(
324 'field' => 'top_bottom_bar', // field ID
325 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
326 'value' => true, // can be a single value or an array of string/number/int
327 ),
328 array(
329 'field' => 'top_bottom_bar_show_on', // field ID
330 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
331 'value' => array( 'desktop', 'both' ), // can be a single value or an array of string/number/int
332 ),
333 ),
334 ),
335 ),
336
337 array(
338 'id' => 'desktop_offset',
339 'type' => 'range',
340 'title' => esc_html__( 'Offset', 'merchant' ),
341 'min' => 0,
342 'max' => 200,
343 'step' => 1,
344 'default' => 0,
345 'unit' => 'px',
346 'conditions' => array(
347 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
348 'terms' => array(
349 array(
350 'field' => 'top_bottom_bar', // field ID
351 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
352 'value' => true, // can be a single value or an array of string/number/int
353 ),
354 array(
355 'field' => 'desktop_offset_toggle', // field ID
356 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
357 'value' => true, // can be a single value or an array of string/number/int
358 ),
359 array(
360 'field' => 'top_bottom_bar_show_on', // field ID
361 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
362 'value' => array( 'desktop', 'both' ), // can be a single value or an array of string/number/int
363 ),
364 ),
365 ),
366 ),
367
368 array(
369 'id' => 'mobile_placement',
370 'type' => 'select',
371 'title' => esc_html__( 'Mobile Placement', 'merchant' ),
372 'options' => array(
373 'top' => esc_html__( 'Top', 'merchant' ),
374 'bottom' => esc_html__( 'Bottom', 'merchant' ),
375 ),
376 'default' => 'top',
377 'conditions' => array(
378 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
379 'terms' => array(
380 array(
381 'field' => 'top_bottom_bar', // field ID
382 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
383 'value' => true, // can be a single value or an array of string/number/int
384 ),
385 array(
386 'field' => 'top_bottom_bar_show_on', // field ID
387 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
388 'value' => array( 'mobile', 'both' ), // can be a single value or an array of string/number/int
389 ),
390 ),
391 ),
392 ),
393
394 array(
395 'id' => 'mobile_offset_toggle',
396 'type' => 'checkbox',
397 'label' => __( 'Custom vertical offset', 'merchant' ),
398 'default' => 0,
399 'conditions' => array(
400 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
401 'terms' => array(
402 array(
403 'field' => 'top_bottom_bar', // field ID
404 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
405 'value' => true, // can be a single value or an array of string/number/int
406 ),
407 array(
408 'field' => 'top_bottom_bar_show_on', // field ID
409 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
410 'value' => array( 'mobile', 'both' ), // can be a single value or an array of string/number/int
411 ),
412 ),
413 ),
414 ),
415
416 array(
417 'id' => 'mobile_offset',
418 'type' => 'range',
419 'title' => esc_html__( 'Offset', 'merchant' ),
420 'min' => 0,
421 'max' => 200,
422 'step' => 1,
423 'default' => 0,
424 'unit' => 'px',
425 'conditions' => array(
426 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
427 'terms' => array(
428 array(
429 'field' => 'top_bottom_bar', // field ID
430 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
431 'value' => true, // can be a single value or an array of string/number/int
432 ),
433 array(
434 'field' => 'mobile_offset_toggle', // field ID
435 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
436 'value' => true, // can be a single value or an array of string/number/int
437 ),
438 array(
439 'field' => 'top_bottom_bar_show_on', // field ID
440 'operator' => 'in', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
441 'value' => array( 'mobile', 'both' ), // can be a single value or an array of string/number/int
442 ),
443 ),
444 ),
445 ),
446 array(
447 'id' => 'close_icon',
448 'type' => 'switcher',
449 'title' => esc_html__( 'Close (x) Icon', 'merchant' ),
450 'default' => 1,
451 'conditions' => array(
452 'terms' => array(
453 array(
454 'field' => 'top_bottom_bar', // field ID
455 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
456 'value' => true, // can be a single value or an array of string/number/int
457 ),
458 ),
459 ),
460 ),
461 array(
462 'id' => 'close_card_stay_time',
463 'type' => 'number',
464 'min' => '1',
465 'step' => '1',
466 'default' => '24',
467 'title' => esc_html__( 'Session Expiration Time', 'merchant' ),
468 'desc' => esc_html__( 'After this number of hours, the free shipping bar will show again, even if the user has closed it previously.', 'merchant' ),
469 'conditions' => array(
470 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
471 'terms' => array(
472 array(
473 'field' => 'top_bottom_bar', // field ID
474 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
475 'value' => true, // can be a single value or an array of string/number/int
476 ),
477 array(
478 'field' => 'close_icon', // field ID
479 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
480 'value' => true, // can be a single value or an array of string/number/int
481 ),
482 ),
483 ),
484 ),
485 array(
486 'id' => 'show_progress_bar',
487 'type' => 'switcher',
488 'title' => esc_html__( 'Progress Bar', 'merchant' ),
489 'desc' => esc_html__( 'Enable Progress bar on top and bottom bar', 'merchant' ),
490 'default' => 0,
491 'conditions' => array(
492 'terms' => array(
493 array(
494 'field' => 'top_bottom_bar',
495 'operator' => '===',
496 'value' => true,
497 ),
498 ),
499 ),
500 ),
501 array(
502 'id' => 'show_on_shop_page',
503 'type' => 'switcher',
504 'title' => esc_html__( 'Show on Shop Page', 'merchant' ),
505 'desc' => esc_html__( 'Show the bar on shop page', 'merchant' ),
506 'default' => 1,
507 'conditions' => array(
508 'terms' => array(
509 array(
510 'field' => 'top_bottom_bar',
511 'operator' => '===',
512 'value' => true,
513 ),
514 ),
515 ),
516 ),
517 array(
518 'type' => 'divider',
519 'title' => esc_html__( 'Single Product Page', 'merchant' ),
520 ),
521 array(
522 'id' => 'show_on_single_product_page',
523 'type' => 'switcher',
524 'title' => esc_html__( 'Bar', 'merchant' ),
525 'default' => 1,
526 ),
527 array(
528 'id' => 'single_product_page_shortcode',
529 'type' => 'switcher',
530 'title' => esc_html__( 'Use Shortcode', 'merchant' ),
531 'default' => 0,
532 'conditions' => array(
533 'terms' => array(
534 array(
535 'field' => 'show_on_single_product_page',
536 'operator' => '===',
537 'value' => true,
538 ),
539 ),
540 ),
541 ),
542 array(
543 'id' => 'single_product_page_placement',
544 'type' => 'select',
545 'title' => esc_html__( 'Position', 'merchant' ),
546 'options' => array(
547 'woocommerce_before_add_to_cart_form' => esc_html__( 'Before Add to Cart Form', 'merchant' ),
548 'woocommerce_after_add_to_cart_quantity' => esc_html__( 'After Add to Cart Quantity', 'merchant' ),
549 'woocommerce_after_add_to_cart_form' => esc_html__( 'After Add to Cart Form', 'merchant' ),
550 'woocommerce_after_single_product_summary' => esc_html__( 'After Single Product Summary', 'merchant' ),
551 'woocommerce_after_single_product' => esc_html__( 'After Single Product', 'merchant' ),
552 ),
553 'default' => 'woocommerce_before_add_to_cart_form',
554 'conditions' => array(
555 'relation' => 'AND',
556 'terms' => array(
557 array(
558 'field' => 'show_on_single_product_page',
559 'operator' => '===',
560 'value' => true,
561 ),
562 array(
563 'field' => 'single_product_page_shortcode',
564 'operator' => '===',
565 'value' => false,
566 ),
567 ),
568 ),
569 ),
570
571 array(
572 'id' => 'single_product_page_shortcode_info',
573 'type' => 'info',
574 '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 this shortcode can only be used on single product pages.',
575 'merchant' ),
576 'conditions' => array(
577 'relation' => 'AND',
578 'terms' => array(
579 array(
580 'field' => 'show_on_single_product_page',
581 'operator' => '===',
582 'value' => true,
583 ),
584 array(
585 'field' => 'single_product_page_shortcode',
586 'operator' => '===',
587 'value' => true,
588 ),
589 ),
590 ),
591 ),
592 array(
593 'id' => 'single_product_page_shortcode_text',
594 'type' => 'text_readonly',
595 'title' => esc_html__( 'Shortcode text', 'merchant' ),
596 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . '_single_product_page]',
597 'conditions' => array(
598 'relation' => 'AND',
599 'terms' => array(
600 array(
601 'field' => 'show_on_single_product_page',
602 'operator' => '===',
603 'value' => true,
604 ),
605 array(
606 'field' => 'single_product_page_shortcode',
607 'operator' => '===',
608 'value' => true,
609 ),
610 ),
611 ),
612 ),
613
614 array(
615 'id' => 'single_page_show_progress_bar',
616 'type' => 'switcher',
617 'title' => esc_html__( 'Progress Bar', 'merchant' ),
618 'desc' => esc_html__( 'Enable Progress bar on single product page', 'merchant' ),
619 'default' => 0,
620 'conditions' => array(
621 'terms' => array(
622 array(
623 'field' => 'show_on_single_product_page',
624 'operator' => '===',
625 'value' => true,
626 ),
627 ),
628 ),
629 ),
630 array(
631 'type' => 'divider',
632 'title' => esc_html__( 'Mini Cart', 'merchant' ),
633 ),
634 array(
635 'id' => 'show_on_mini_cart_widget',
636 'type' => 'switcher',
637 'title' => esc_html__( 'Bar', 'merchant' ),
638 'default' => 1,
639 ),
640 array(
641 'id' => 'mini_cart_placement',
642 'type' => 'select',
643 'title' => esc_html__( 'Position', 'merchant' ),
644 'options' => array(
645 'woocommerce_before_mini_cart_contents' => esc_html__( 'Before Cart Items', 'merchant' ),
646 'woocommerce_widget_shopping_cart_total' => esc_html__( 'After Subtotal', 'merchant' ),
647 ),
648 'default' => 'woocommerce_before_mini_cart_contents',
649 'conditions' => array(
650 'terms' => array(
651 array(
652 'field' => 'show_on_mini_cart_widget',
653 'operator' => '===',
654 'value' => true,
655 ),
656 ),
657 ),
658 ),
659 array(
660 'id' => 'mini_cart_show_progress_bar',
661 'type' => 'switcher',
662 'title' => esc_html__( 'Progress Bar', 'merchant' ),
663 'desc' => esc_html__( 'Enable Progress bar on mini cart', 'merchant' ),
664 'default' => 0,
665 'conditions' => array(
666 'terms' => array(
667 array(
668 'field' => 'show_on_mini_cart_widget',
669 'operator' => '===',
670 'value' => true,
671 ),
672 ),
673 ),
674 ),
675 array(
676 'type' => 'divider',
677 'title' => esc_html__( 'Side Cart', 'merchant' ),
678 ),
679 array(
680 'id' => 'show_on_side_cart_widget',
681 'type' => 'switcher',
682 'title' => esc_html__( 'Bar', 'merchant' ),
683 'default' => 1,
684 ),
685 array(
686 'id' => 'side_cart_placement',
687 'type' => 'select',
688 'title' => esc_html__( 'Position', 'merchant' ),
689 'options' => array(
690 'merchant_before_mini_cart_contents' => esc_html__( 'Before Cart Items', 'merchant' ),
691 'merchant_widget_shopping_cart_before_buttons' => esc_html__( 'Before Cart Buttons', 'merchant' ),
692 'merchant_widget_shopping_cart_after_buttons' => esc_html__( 'After Cart Buttons', 'merchant' ),
693 ),
694 'default' => 'merchant_widget_shopping_cart_before_buttons',
695 'conditions' => array(
696 'terms' => array(
697 array(
698 'field' => 'show_on_side_cart_widget',
699 'operator' => '===',
700 'value' => true,
701 ),
702 ),
703 ),
704 ),
705 array(
706 'id' => 'side_cart_show_progress_bar',
707 'type' => 'switcher',
708 'title' => esc_html__( 'Progress Bar', 'merchant' ),
709 'desc' => esc_html__( 'Enable Progress bar on side cart', 'merchant' ),
710 'default' => 0,
711 'conditions' => array(
712 'terms' => array(
713 array(
714 'field' => 'show_on_side_cart_widget',
715 'operator' => '===',
716 'value' => true,
717 ),
718 ),
719 ),
720 ),
721 array(
722 'type' => 'divider',
723 'title' => esc_html__( 'Cart Page', 'merchant' ),
724 ),
725 array(
726 'id' => 'show_on_cart_page',
727 'type' => 'switcher',
728 'title' => esc_html__( 'Bar', 'merchant' ),
729 'default' => 1,
730 ),
731 array(
732 'id' => 'cart_page_shortcode',
733 'type' => 'switcher',
734 'title' => esc_html__( 'Use Shortcode', 'merchant' ),
735 'default' => 0,
736 'conditions' => array(
737 'terms' => array(
738 array(
739 'field' => 'show_on_cart_page',
740 'operator' => '===',
741 'value' => true,
742 ),
743 ),
744 ),
745 ),
746 array(
747 'id' => 'cart_page_shortcode_info',
748 'type' => 'info',
749 '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 this shortcode can only be used on cart page.',
750 'merchant' ),
751 'conditions' => array(
752 'relation' => 'AND',
753 'terms' => array(
754 array(
755 'field' => 'show_on_cart_page',
756 'operator' => '===',
757 'value' => true,
758 ),
759 array(
760 'field' => 'cart_page_shortcode',
761 'operator' => '===',
762 'value' => true,
763 ),
764 ),
765 ),
766 ),
767 array(
768 'id' => 'cart_page_shortcode_text',
769 'type' => 'text_readonly',
770 'title' => esc_html__( 'Shortcode text', 'merchant' ),
771 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . '_cart_page]',
772 'conditions' => array(
773 'relation' => 'AND',
774 'terms' => array(
775 array(
776 'field' => 'show_on_cart_page',
777 'operator' => '===',
778 'value' => true,
779 ),
780 array(
781 'field' => 'cart_page_shortcode',
782 'operator' => '===',
783 'value' => true,
784 ),
785 ),
786 ),
787 ),
788 array(
789 'id' => 'cart_page_placement',
790 'type' => 'select',
791 'title' => esc_html__( 'Position', 'merchant' ),
792 'options' => array(
793 'woocommerce_before_cart' => esc_html__( 'Before Cart', 'merchant' ),
794 'woocommerce_cart_totals_after_order_total' => esc_html__( 'After Order Total', 'merchant' ),
795 'woocommerce_after_cart_table' => esc_html__( 'After Cart Table', 'merchant' ),
796 ),
797 'default' => 'woocommerce_cart_totals_before_order_total',
798 'conditions' => array(
799 'relation' => 'AND',
800 'terms' => array(
801 array(
802 'field' => 'show_on_cart_page',
803 'operator' => '===',
804 'value' => true,
805 ),
806 array(
807 'field' => 'cart_page_shortcode',
808 'operator' => '===',
809 'value' => false,
810 ),
811 ),
812 ),
813 ),
814 array(
815 'id' => 'cart_page_show_progress_bar',
816 'type' => 'switcher',
817 'title' => esc_html__( 'Progress Bar', 'merchant' ),
818 'desc' => esc_html__( 'Enable Progress bar on cart page', 'merchant' ),
819 'default' => 0,
820 'conditions' => array(
821 'terms' => array(
822 array(
823 'field' => 'show_on_cart_page',
824 'operator' => '===',
825 'value' => true,
826 ),
827 ),
828 ),
829 ),
830 array(
831 'type' => 'divider',
832 'title' => esc_html__( 'Checkout Page', 'merchant' ),
833 ),
834 array(
835 'id' => 'show_on_checkout_page',
836 'type' => 'switcher',
837 'title' => esc_html__( 'Bar', 'merchant' ),
838 'default' => 1,
839 ),
840 array(
841 'id' => 'checkout_page_shortcode',
842 'type' => 'switcher',
843 'title' => esc_html__( 'Use Shortcode', 'merchant' ),
844 'default' => 0,
845 'conditions' => array(
846 'terms' => array(
847 array(
848 'field' => 'show_on_checkout_page',
849 'operator' => '===',
850 'value' => true,
851 ),
852 ),
853 ),
854 ),
855 array(
856 'id' => 'checkout_page_shortcode_info',
857 'type' => 'info',
858 '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 this shortcode can only be used on checkout page.',
859 'merchant' ),
860 'conditions' => array(
861 'relation' => 'AND',
862 'terms' => array(
863 array(
864 'field' => 'show_on_checkout_page',
865 'operator' => '===',
866 'value' => true,
867 ),
868 array(
869 'field' => 'checkout_page_shortcode',
870 'operator' => '===',
871 'value' => true,
872 ),
873 ),
874 ),
875 ),
876 array(
877 'id' => 'checkout_page_shortcode_text',
878 'type' => 'text_readonly',
879 'title' => esc_html__( 'Shortcode text', 'merchant' ),
880 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . '_checkout_page]',
881 'conditions' => array(
882 'relation' => 'AND',
883 'terms' => array(
884 array(
885 'field' => 'show_on_checkout_page',
886 'operator' => '===',
887 'value' => true,
888 ),
889 array(
890 'field' => 'checkout_page_shortcode',
891 'operator' => '===',
892 'value' => true,
893 ),
894 ),
895 ),
896 ),
897 array(
898 'id' => 'checkout_page_placement',
899 'type' => 'select',
900 'title' => esc_html__( 'Position', 'merchant' ),
901 'options' => array(
902 'woocommerce_before_checkout_form' => esc_html__( 'Before Checkout Form', 'merchant' ),
903 'woocommerce_checkout_billing' => esc_html__( 'Checkout Billing', 'merchant' ),
904 'woocommerce_checkout_shipping' => esc_html__( 'Checkout Shipping', 'merchant' ),
905 'woocommerce_review_order_before_payment' => esc_html__( 'Before Payment', 'merchant' ),
906 'woocommerce_review_order_after_payment' => esc_html__( 'After Payment', 'merchant' ),
907 'woocommerce_after_checkout_form' => esc_html__( 'After Checkout Form', 'merchant' ),
908 ),
909 'default' => 'woocommerce_before_checkout_form',
910 'conditions' => array(
911 'relation' => 'AND',
912 'terms' => array(
913 array(
914 'field' => 'show_on_checkout_page',
915 'operator' => '===',
916 'value' => true,
917 ),
918 array(
919 'field' => 'checkout_page_shortcode',
920 'operator' => '===',
921 'value' => false,
922 ),
923 ),
924 ),
925 ),
926 array(
927 'id' => 'checkout_page_show_progress_bar',
928 'type' => 'switcher',
929 'title' => esc_html__( 'Progress Bar', 'merchant' ),
930 'desc' => esc_html__( 'Enable Progress bar on checkout page', 'merchant' ),
931 'default' => 0,
932 'conditions' => array(
933 'terms' => array(
934 array(
935 'field' => 'show_on_checkout_page',
936 'operator' => '===',
937 'value' => true,
938 ),
939 ),
940 ),
941 ),
942 ),
943 ) );
944
945 /**
946 * Placement
947 */
948 Merchant_Admin_Options::create( array(
949 'title' => esc_html__( 'Look and Feel', 'merchant' ),
950 'module' => Merchant_Free_Shipping_Progress_Bar::MODULE_ID,
951 'fields' => array(
952 array(
953 'id' => 'preset',
954 'type' => 'select',
955 'title' => esc_html__( 'Template', 'merchant' ),
956 'options' => array(
957 'custom' => esc_html__( 'Custom style', 'merchant' ),
958 'solar_night' => esc_html__( 'Solar Night', 'merchant' ),
959 'lively_breeze' => esc_html__( 'Lively Breeze', 'merchant' ),
960 'midnight_tide' => esc_html__( 'Midnight Tide', 'merchant' ),
961 'clean_slate' => esc_html__( 'Clean Slate', 'merchant' ),
962 'fresh_frost' => esc_html__( 'Fresh Frost', 'merchant' ),
963 'sky_harmony' => esc_html__( 'Sky Harmony', 'merchant' ),
964 'ocean_breeze' => esc_html__( 'Ocean Breeze', 'merchant' ),
965 ),
966 'default' => 'custom',
967 ),
968 array(
969 'id' => 'x_icon_color',
970 'type' => 'color',
971 'title' => esc_html__( 'Close (x) Icon color', 'merchant' ),
972 'default' => '#333333',
973 'conditions' => array(
974 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
975 'terms' => array(
976 array(
977 'field' => 'close_icon', // field ID
978 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
979 'value' => true, // can be a single value or an array of string/number/int
980 ),
981 array(
982 'field' => 'top_bottom_bar', // field ID
983 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
984 'value' => true, // can be a single value or an array of string/number/int
985 ),
986 ),
987 ),
988 ),
989 array(
990 'id' => 'card_text_color',
991 'type' => 'color',
992 'title' => esc_html__( 'Text color', 'merchant' ),
993 'default' => '#212121',
994 ),
995
996 array(
997 'id' => 'variable_text_color',
998 'type' => 'color',
999 'title' => esc_html__( 'Variable Text color', 'merchant' ),
1000 'default' => '#212121',
1001 ),
1002 array(
1003 'id' => 'card_font_size',
1004 'type' => 'range',
1005 'min' => '4',
1006 'max' => '30',
1007 'step' => '1',
1008 'unit' => 'PX',
1009 'default' => '18',
1010 'title' => esc_html__( 'Font Size', 'merchant' ),
1011 ),
1012 array(
1013 'id' => 'card_background_color',
1014 'type' => 'color',
1015 'title' => esc_html__( 'Background Color', 'merchant' ),
1016 'default' => '#e6e6e6',
1017 ),
1018 array(
1019 'id' => 'card_padding_top',
1020 'type' => 'range',
1021 'min' => '0',
1022 'max' => '100',
1023 'step' => '1',
1024 'unit' => 'PX',
1025 'default' => '15',
1026 'title' => esc_html__( 'Spacing Inside Top', 'merchant' ),
1027 ),
1028 array(
1029 'id' => 'card_padding_bottom',
1030 'type' => 'range',
1031 'min' => '0',
1032 'max' => '100',
1033 'step' => '1',
1034 'unit' => 'PX',
1035 'default' => '15',
1036 'title' => esc_html__( 'Spacing Inside Bottom', 'merchant' ),
1037 ),
1038 array(
1039 'id' => 'card_padding_right',
1040 'type' => 'range',
1041 'min' => '0',
1042 'max' => '100',
1043 'step' => '1',
1044 'unit' => 'PX',
1045 'default' => '15',
1046 'title' => esc_html__( 'Spacing Inside Right', 'merchant' ),
1047 ),
1048 array(
1049 'id' => 'card_padding_left',
1050 'type' => 'range',
1051 'min' => '0',
1052 'max' => '100',
1053 'step' => '1',
1054 'unit' => 'PX',
1055 'default' => '15',
1056 'title' => esc_html__( 'Spacing Inside Left', 'merchant' ),
1057 ),
1058 array(
1059 'id' => 'card_text_bottom_spacing',
1060 'type' => 'range',
1061 'min' => '0',
1062 'max' => '100',
1063 'step' => '1',
1064 'unit' => 'PX',
1065 'default' => '0',
1066 'title' => esc_html__( 'Text Bottom Spacing', 'merchant' ),
1067 ),
1068 array(
1069 'id' => 'card_border_radius',
1070 'type' => 'range',
1071 'min' => '0',
1072 'max' => '45',
1073 'step' => '1',
1074 'unit' => 'PX',
1075 'default' => '4',
1076 'title' => esc_html__( 'Corner Radius', 'merchant' ),
1077 ),
1078 array(
1079 'id' => 'card_border_width',
1080 'type' => 'range',
1081 'min' => '0',
1082 'max' => '20',
1083 'step' => '1',
1084 'unit' => 'PX',
1085 'default' => '0',
1086 'title' => esc_html__( 'Border Size', 'merchant' ),
1087 ),
1088 array(
1089 'id' => 'card_border_color',
1090 'type' => 'color',
1091 'title' => esc_html__( 'Border Color', 'merchant' ),
1092 'default' => 'rgba(255, 255, 255, 0)',
1093 ),
1094 array(
1095 'id' => 'bar_background_color',
1096 'type' => 'color',
1097 'title' => esc_html__( 'Progress Bar Background Color', 'merchant' ),
1098 'default' => '#757575',
1099 ),
1100 array(
1101 'id' => 'bar_foreground_color',
1102 'type' => 'color',
1103 'title' => esc_html__( 'Progress Bar Foreground Color', 'merchant' ),
1104 'default' => '#212121',
1105 ),
1106 array(
1107 'id' => 'bar_height',
1108 'type' => 'range',
1109 'min' => '4',
1110 'max' => '30',
1111 'step' => '1',
1112 'unit' => 'PX',
1113 'default' => '10',
1114 'title' => esc_html__( 'Progress Bar Height', 'merchant' ),
1115 ),
1116 array(
1117 'id' => 'bar_width',
1118 'type' => 'range',
1119 'min' => '0',
1120 'max' => '100',
1121 'step' => '1',
1122 'unit' => '%',
1123 'default' => '100',
1124 'title' => esc_html__( 'Progress Bar Width', 'merchant' ),
1125 ),
1126 array(
1127 'id' => 'bar_border_radius',
1128 'type' => 'range',
1129 'min' => '0',
1130 'max' => '30',
1131 'step' => '1',
1132 'unit' => 'PX',
1133 'default' => '0',
1134 'title' => esc_html__( 'Corner Radius', 'merchant' ),
1135 ),
1136 ),
1137 ) );
1138