PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.0
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.0
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.3.0, at inc/modules/free-shipping-progress-bar/admin/options.php

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