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

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

965 lines 35.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Advanced Reviews Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // Settings
14 Merchant_Admin_Options::create(
15 array(
16 'title' => __( 'Settings', 'merchant' ),
17 'module' => Merchant_Advanced_Reviews::MODULE_ID,
18 'fields' => array(
19
20 // Title.
21 array(
22 'id' => 'title',
23 'type' => 'text',
24 'title' => __( 'Title', 'merchant' ),
25 'default' => __( 'What our customers are saying', 'merchant' ),
26 ),
27
28 // Title HTML Tag.
29 array(
30 'id' => 'title_tag',
31 'type' => 'select',
32 'title' => __( 'Title HTML tag', 'merchant' ),
33 'options' => array(
34 'h1' => __( 'H1', 'merchant' ),
35 'h2' => __( 'H2', 'merchant' ),
36 'h3' => __( 'H3', 'merchant' ),
37 'h4' => __( 'H4', 'merchant' ),
38 'h5' => __( 'H5', 'merchant' ),
39 'h6' => __( 'H6', 'merchant' ),
40 'div' => __( 'div', 'merchant' ),
41 ),
42 'default' => 'h2',
43 ),
44
45 // Hide Title.
46 array(
47 'id' => 'hide_title',
48 'type' => 'switcher',
49 'title' => __( 'Hide title', 'merchant' ),
50 'default' => 0,
51 ),
52
53 // Description.
54 array(
55 'id' => 'description',
56 'type' => 'textarea',
57 'title' => __( 'Description', 'merchant' ),
58 'default' => '',
59 ),
60
61 // Title and Description Alignment.
62 array(
63 'id' => 'title_desc_align',
64 'type' => 'radio',
65 'title' => __( 'Title and description alignment', 'merchant' ),
66 'options' => array(
67 'left' => __( 'Left', 'merchant' ),
68 'center' => __( 'Center', 'merchant' ),
69 'right' => __( 'Right', 'merchant' ),
70 ),
71 'default' => 'left',
72 ),
73
74 // Default Reviews Sorting.
75 array(
76 'id' => 'default_sorting',
77 'type' => 'select',
78 'title' => __( 'Default reviews sorting', 'merchant' ),
79 'options' => array(
80 'newest' => __( 'Newest', 'merchant' ),
81 'oldest' => __( 'Oldest', 'merchant' ),
82 'top-rated' => __( 'Top rated', 'merchant' ),
83 'low-rated' => __( 'Low rated', 'merchant' ),
84 'photo-first' => __( 'Photo first', 'merchant' ),
85 ),
86 'default' => 'newest',
87 ),
88
89 // Pagination Type.
90 array(
91 'id' => 'pagination_type',
92 'type' => 'select',
93 'title' => __( 'Pagination type', 'merchant' ),
94 'desc' => sprintf(
95 /* Translators: 1. Defualt WordPress discussion settings page. */
96 __( 'This option works only if you have pagination for comments enabled. By default, WordPress doesn\'t have pagination enabled for comments/reviews. You can change it from: <a href="%1$s" target="_blank">Settings > Discusson</a>',
97 'merchant' ),
98 admin_url( 'options-discussion.php' )
99 ),
100 'options' => array(
101 'default' => __( 'Default', 'merchant' ),
102 'load-more' => __( 'Load more button', 'merchant' ),
103 ),
104 'default' => 'load-more',
105 ),
106
107 // Review options.
108 array(
109 'id' => 'review_options',
110 'type' => 'radio',
111 'title' => __( 'Review options', 'merchant' ),
112 'options' => array(
113 'image_and_text' => __( 'Image and text', 'merchant' ),
114 'image' => __( 'Image only', 'merchant' ),
115 'text' => __( 'Text only', 'merchant' ),
116 ),
117 'default' => 'image_and_text',
118 ),
119
120 // Photos Upload limit.
121 array(
122 'id' => 'photos_limit',
123 'type' => 'range',
124 'title' => __( 'Photos upload limit', 'merchant' ),
125 'desc' => __( 'Controls the photos upload limit for a review.', 'merchant' ),
126 'min' => 1,
127 'max' => '',
128 'step' => 1,
129 'unit' => '',
130 'default' => 6,
131 ),
132
133 // Review images carousel.
134 array(
135 'id' => 'review_images_carousel',
136 'type' => 'switcher',
137 'title' => __( 'Review images carousel', 'merchant' ),
138 'desc' => __( 'Display the first image from each review in a carousel to engage shoppers and help their decision-making process.', 'merchant' ),
139 'default' => 0,
140 ),
141
142 // Number of Images per page.
143 array(
144 'id' => 'review_images_carousel_total',
145 'type' => 'range',
146 'title' => __( 'Total images', 'merchant' ),
147 'desc' => __( 'Controls the total number of images to be displayed in the slider.', 'merchant' ),
148 'min' => 1,
149 'step' => 1,
150 'unit' => '',
151 'default' => 12,
152 'condition' => array( 'review_images_carousel', '==', '1' ),
153 ),
154
155 // Number of Columns.
156 array(
157 'id' => 'review_images_carousel_per_page',
158 'type' => 'range',
159 'title' => __( 'Columns', 'merchant' ),
160 'desc' => __( 'Controls the number of images to be displayed per slide.', 'merchant' ),
161 'min' => 1,
162 'max' => 6,
163 'step' => 1,
164 'unit' => '',
165 'default' => 3,
166 'condition' => array( 'review_images_carousel', '==', '1' ),
167 ),
168
169 // Carousel Title.
170 array(
171 'id' => 'carousel_title',
172 'type' => 'text',
173 'title' => __( 'Carousel Title', 'merchant' ),
174 'default' => __( 'Reviews with Photos', 'merchant' ),
175 ),
176
177 // Hook Order.
178 array(
179 'id' => 'hook_order',
180 'type' => 'range',
181 'title' => __( 'Hook order', 'merchant' ),
182 'desc' => __( 'Controls the display position for the entire advanced reviews section. Lower values will move the section towards the top, while higher values will move the section towards the bottom.',
183 'merchant' ),
184 'min' => 1,
185 'max' => 100,
186 'step' => 1,
187 'unit' => '',
188 'default' => 10,
189 ),
190
191 /**
192 * Styles
193 *
194 */
195
196 // Title color.
197 array(
198 'id' => 'title_color',
199 'type' => 'color',
200 'title' => __( 'Title color', 'merchant' ),
201 'default' => '#212121',
202 ),
203
204 // Description color.
205 array(
206 'id' => 'description_color',
207 'type' => 'color',
208 'title' => __( 'Description color', 'merchant' ),
209 'default' => '#777',
210 ),
211
212 // Stars color.
213 array(
214 'id' => 'stars_color',
215 'type' => 'color',
216 'title' => __( 'Stars color', 'merchant' ),
217 'default' => '#FFA441',
218 ),
219
220 // Stars background color.
221 array(
222 'id' => 'stars_background_color',
223 'type' => 'color',
224 'title' => __( 'Stars background color', 'merchant' ),
225 'default' => '#757575',
226 ),
227
228 // Progress bar color.
229 array(
230 'id' => 'progress_bar_color',
231 'type' => 'color',
232 'title' => __( 'Progress bar color', 'merchant' ),
233 'default' => '#212121',
234 ),
235
236 // Progress bar background color.
237 array(
238 'id' => 'progress_bar_bg_color',
239 'type' => 'color',
240 'title' => __( 'Progress bar background color', 'merchant' ),
241 'default' => '#F5F5F5',
242 ),
243
244 // Dividers color.
245 array(
246 'id' => 'dividers_color',
247 'type' => 'color',
248 'title' => __( 'Dividers color', 'merchant' ),
249 'default' => '#e9e9e9',
250 ),
251
252 // Button color.
253 array(
254 'id' => 'button_color',
255 'type' => 'color',
256 'title' => __( 'Button color', 'merchant' ),
257 'default' => '#FFF',
258 ),
259
260 // Button color (hover).
261 array(
262 'id' => 'button_color_hover',
263 'type' => 'color',
264 'title' => __( 'Button color (hover)', 'merchant' ),
265 'default' => '#FFF',
266 ),
267
268 // Button background color.
269 array(
270 'id' => 'button_bg_color',
271 'type' => 'color',
272 'title' => __( 'Button background color', 'merchant' ),
273 'default' => '#212121',
274 ),
275
276 // Button background color (hover).
277 array(
278 'id' => 'button_bg_color_hover',
279 'type' => 'color',
280 'title' => __( 'Button background color (hover)', 'merchant' ),
281 'default' => '#757575',
282 ),
283
284 ),
285 )
286 );
287
288
289 Merchant_Admin_Options::create(
290 array(
291 'title' => __( 'Collect Reviews', 'merchant' ),
292 'module' => Merchant_Advanced_Reviews::MODULE_ID,
293 'fields' => array(
294 array(
295 'id' => 'auto_emails_toggle',
296 'type' => 'checkbox',
297 'label' => esc_html__( 'Send automated emails for review requests', 'merchant' ),
298 'default' => false,
299 ),
300 array(
301 'id' => 'days_after_order_complete',
302 'type' => 'number',
303 'title' => esc_html__( 'After the order is completed, send the review request after the following number of days', 'merchant' ),
304 'desc' => esc_html__( 'The emails will be sent for orders that have been completed.', 'merchant' ),
305 'default' => 7,
306 ),
307 array(
308 'id' => 'discount_toggle',
309 'type' => 'switcher',
310 'title' => __( 'Discount for reviews', 'merchant' ),
311 'desc' => __( 'After a customer leaves a review on the store, an email containing a discount coupon will be sent to the email address associated with their order.', 'merchant' ),
312 'default' => 0,
313 ),
314 array(
315 'id' => 'require_photo_for_discount',
316 'type' => 'checkbox',
317 'label' => esc_html__( 'Offer a discount specifically for leaving a photo review.', 'merchant' ),
318 'default' => false,
319 'conditions' => array(
320 'terms' => array(
321 array(
322 'field' => 'discount_toggle', // field ID
323 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
324 'value' => true, // can be a single value or an array of string/number/int
325 ),
326 ),
327 ),
328 ),
329 array(
330 'id' => 'discount_generation_method',
331 'type' => 'radio',
332 'title' => esc_html__( 'Discount generation method', 'merchant' ),
333 'options' => array(
334 'auto' => esc_html__( 'Auto-generated code (different each time)', 'merchant' ),
335 'manual' => esc_html__( 'Single discount code', 'merchant' ),
336 ),
337 'default' => 'auto',
338 'conditions' => array(
339 'terms' => array(
340 array(
341 'field' => 'discount_toggle', // 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 ),
346 ),
347 ),
348 array(
349 'id' => 'discount_info',
350 'type' => 'info',
351 'content' => esc_html__( 'A unique, single-use coupon code will be generated for each customer who leaves a review. This code can only be redeemed by the customer associated with the review.',
352 'merchant' ),
353 'conditions' => array(
354 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
355 'terms' => array(
356 array(
357 'field' => 'discount_toggle', // field ID
358 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
359 'value' => true, // can be a single value or an array of string/number/int
360 ),
361 array(
362 'field' => 'discount_generation_method', // field ID
363 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
364 'value' => 'auto', // can be a single value or an array of string/number/int
365 ),
366 ),
367 ),
368 ),
369 array(
370 'id' => 'discount_type',
371 'type' => 'radio',
372 'title' => esc_html__( 'Discount', 'merchant' ),
373 'options' => array(
374 'percent' => esc_html__( 'Percentage', 'merchant' ),
375 'fixed_cart' => esc_html__( 'Fixed', 'merchant' ),
376 ),
377 'default' => 'percent',
378 'conditions' => array(
379 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
380 'terms' => array(
381 array(
382 'field' => 'discount_toggle', // field ID
383 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
384 'value' => true, // can be a single value or an array of string/number/int
385 ),
386 array(
387 'field' => 'discount_generation_method', // field ID
388 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
389 'value' => 'auto', // can be a single value or an array of string/number/int
390 ),
391 ),
392 ),
393 ),
394 array(
395 'id' => 'discount_amount',
396 'type' => 'number',
397 'step' => 0.01,
398 'default' => 10,
399 'conditions' => array(
400 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
401 'terms' => array(
402 array(
403 'field' => 'discount_toggle', // 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' => 'discount_generation_method', // field ID
409 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
410 'value' => 'auto', // can be a single value or an array of string/number/int
411 ),
412 ),
413 ),
414 ),
415 array(
416 'id' => 'discount_expire_after',
417 'type' => 'select',
418 'title' => esc_html__( 'Discount expires after', 'merchant' ),
419 'options' => array(
420 'never' => esc_html__( 'Never', 'merchant' ),
421 '7' => esc_html__( '7 days', 'merchant' ),
422 '14' => esc_html__( '14 days', 'merchant' ),
423 '21' => esc_html__( '21 days', 'merchant' ),
424 '30' => esc_html__( '30 days', 'merchant' ),
425 '60' => esc_html__( '60 days', 'merchant' ),
426 '90' => esc_html__( '90 days', 'merchant' ),
427 '180' => esc_html__( '180 days', 'merchant' ),
428 '365' => esc_html__( '365 days', 'merchant' ),
429 ),
430 'conditions' => array(
431 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
432 'terms' => array(
433 array(
434 'field' => 'discount_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' => 'discount_generation_method', // field ID
440 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
441 'value' => 'auto', // can be a single value or an array of string/number/int
442 ),
443 ),
444 ),
445 ),
446 array(
447 'id' => 'coupon_campaign_info',
448 'type' => 'info_block',
449 'description' => esc_html__( 'You need to create the discount code in WooCommerce by navigating to Marketing > Coupons. The same discount code will be sent to all customers.',
450 'merchant' ),
451 'button_text' => esc_html__( 'Create discount code', 'merchant' ),
452 'button_link' => admin_url( 'edit.php?post_type=shop_coupon' ),
453 'conditions' => array(
454 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
455 'terms' => array(
456 array(
457 'field' => 'discount_toggle', // field ID
458 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
459 'value' => true, // can be a single value or an array of string/number/int
460 ),
461 array(
462 'field' => 'discount_generation_method', // field ID
463 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
464 'value' => 'manual', // can be a single value or an array of string/number/int
465 ),
466 ),
467 ),
468 ),
469 array(
470 'id' => 'manual_coupon_code',
471 'type' => 'wc_coupons',
472 'title' => esc_html__( 'Select manually created discount code', 'merchant' ),
473 //'desc' => esc_html__( 'The discount code must be created in WooCommerce to work and add here to validate.', 'merchant' ),
474 'conditions' => array(
475 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
476 'terms' => array(
477 array(
478 'field' => 'discount_toggle', // 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 array(
483 'field' => 'discount_generation_method', // field ID
484 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
485 'value' => 'manual', // can be a single value or an array of string/number/int
486 ),
487 ),
488 ),
489 ),
490 ),
491 )
492 );
493
494 Merchant_Admin_Options::create(
495 array(
496 'title' => __( 'Collect Reviews', 'merchant' ),
497 'module' => Merchant_Advanced_Reviews::MODULE_ID,
498 'fields' => array(
499 array(
500 'id' => 'review_request_email',
501 'type' => 'fields_group',
502 'title' => esc_html__( 'Review request', 'merchant' ),
503 'sub-desc' => esc_html__( 'Encourage your customers to leave a review with automated emails.', 'merchant' ),
504 'state' => 'open',
505 'default' => 'inactive',
506 'accordion' => true,
507 'display_status' => true,
508 'fields' => array(
509 array(
510 'id' => 'subject',
511 'type' => 'text',
512 'title' => __( 'Subject', 'merchant' ),
513 'default' => __( 'How did we do?', 'merchant' ),
514 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
515 'hidden_desc' => sprintf(
516 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
517 __(
518 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays the customer’s order id<br><strong>%4$s</strong> and <strong>%5$s:</strong> These tags are used together to create a clickable link that directs the customer to their order page, where they can submit a review.<br><br><strong>Example usage:</strong><br>Please click {order_url_open}here{order_url_close} to leave a review for your recent order.',
519 'merchant'
520 ),
521 '{first_name}',
522 '{last_name}',
523 '{order_id}',
524 '{order_url_open}',
525 '{order_url_close}'
526 ),
527 ),
528 array(
529 'id' => 'body',
530 'type' => 'textarea_multiline',
531 'title' => __( 'Body', 'merchant' ),
532 'default' => __( 'Hello {first_name},
533
534 We hope you’re enjoying your recent purchase from us.
535
536 We would be grateful if you could take a moment to share your experience by leaving a review.
537
538 Your feedback helps us improve and provides valuable insights for other customers. Please click {order_url_open}here{order_url_close} to submit your review.
539
540 Best regards,', 'merchant' ),
541 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
542 'hidden_desc' => sprintf(
543 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
544 __(
545 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays the customer’s order id<br><strong>%4$s</strong> and <strong>%5$s:</strong> These tags are used together to create a clickable link that directs the customer to their order page, where they can submit a review.<br><br><strong>Example usage:</strong><br>Please click {order_url_open}here{order_url_close} to leave a review for your recent order.',
546 'merchant'
547 ),
548 '{first_name}',
549 '{last_name}',
550 '{order_id}',
551 '{order_url_open}',
552 '{order_url_close}'
553 ),
554 ),
555 // array(
556 // 'id' => 'review_btn_type',
557 // 'type' => 'select',
558 // 'title' => esc_html__( 'Review request button type', 'merchant' ),
559 // 'options' => array(
560 // 'rating_stars' => esc_html__( 'Rating stars', 'merchant' ),
561 // 'custom_button' => esc_html__( 'Custom Button', 'merchant' ),
562 // ),
563 // 'default' => 'custom_button',
564 // ),
565 // array(
566 // 'id' => 'review_btn_text',
567 // 'type' => 'text',
568 // 'title' => __( 'Button text', 'merchant' ),
569 // 'default' => __( 'Write a review', 'merchant' ),
570 // 'conditions' => array(
571 // 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
572 // 'terms' => array(
573 // array(
574 // 'field' => 'review_btn_type', // field ID
575 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
576 // 'value' => 'custom_button', // can be a single value or an array of string/number/int
577 // ),
578 // ),
579 // ),
580 // ),
581 array(
582 'id' => 'preview-info',
583 'type' => 'info',
584 'content' => sprintf(
585 /* Translators: 1. docs link */
586 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
587 esc_url(
588 add_query_arg(
589 array(
590 'action' => 'merchant_pro_preview_request_review_email',
591 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
592 ),
593 admin_url( 'admin-post.php' )
594 )
595 )
596 ),
597 ),
598
599 ),
600 ),
601 array(
602 'id' => 'review_request_reminder_email',
603 'type' => 'fields_group',
604 'title' => esc_html__( 'Review request reminder', 'merchant' ),
605 'sub-desc' => esc_html__( 'Send a second review request to customers who did not submit a review yet.', 'merchant' ),
606 'state' => 'closed',
607 'default' => 'inactive',
608 'accordion' => true,
609 'display_status' => true,
610 'fields' => array(
611 array(
612 'id' => 'days_after_first_email',
613 'type' => 'number',
614 'title' => esc_html__( 'After the first email, send the review request reminder after the following number of days', 'merchant' ),
615 'default' => 7,
616 ),
617 array(
618 'id' => 'subject',
619 'type' => 'text',
620 'title' => __( 'Subject', 'merchant' ),
621 'default' => __( 'We value your feedback', 'merchant' ),
622 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
623 'hidden_desc' => sprintf(
624 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
625 __(
626 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays the customer’s order id<br><strong>%4$s</strong> and <strong>%5$s:</strong> These tags are used together to create a clickable link that directs the customer to their order page, where they can submit a review.<br><br><strong>Example usage:</strong><br>Please click {order_url_open}here{order_url_close} to leave a review for your recent order.',
627 'merchant'
628 ),
629 '{first_name}',
630 '{last_name}',
631 '{order_id}',
632 '{order_url_open}',
633 '{order_url_close}'
634 ),
635 ),
636 array(
637 'id' => 'body',
638 'type' => 'textarea_multiline',
639 'title' => __( 'Body', 'merchant' ),
640 'default' => __( 'Hello {first_name},
641
642 We hope you’re enjoying your recent purchase from us.
643
644 We would be grateful if you could take a moment to share your experience by leaving a review.
645
646 Your feedback helps us improve and provides valuable insights for other customers. Please click {order_url_open}here{order_url_close} to submit your review.
647
648 Best regards,', 'merchant' ),
649 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
650 'hidden_desc' => sprintf(
651 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
652 __(
653 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays the customer’s order id<br><strong>%4$s</strong> and <strong>%5$s:</strong> These tags are used together to create a clickable link that directs the customer to their order page, where they can submit a review.<br><br><strong>Example usage:</strong><br>Please click {order_url_open}here{order_url_close} to leave a review for your recent order.',
654 'merchant'
655 ),
656 '{first_name}',
657 '{last_name}',
658 '{order_id}',
659 '{order_url_open}',
660 '{order_url_close}'
661 ),
662 ),
663 // array(
664 // 'id' => 'review_btn_type',
665 // 'type' => 'select',
666 // 'title' => esc_html__( 'Review request button type', 'merchant' ),
667 // 'options' => array(
668 // 'rating_stars' => esc_html__( 'Rating stars', 'merchant' ),
669 // 'custom_button' => esc_html__( 'Custom Button', 'merchant' ),
670 // ),
671 // 'default' => 'custom_button',
672 // ),
673 // array(
674 // 'id' => 'review_btn_text',
675 // 'type' => 'text',
676 // 'title' => __( 'Button text', 'merchant' ),
677 // 'default' => __( 'Write a review', 'merchant' ),
678 // 'conditions' => array(
679 // 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
680 // 'terms' => array(
681 // array(
682 // 'field' => 'review_btn_type', // field ID
683 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
684 // 'value' => 'custom_button', // can be a single value or an array of string/number/int
685 // ),
686 // ),
687 // ),
688 // ),
689 array(
690 'id' => 'preview-info',
691 'type' => 'info',
692 'content' => sprintf(
693 /* Translators: 1. docs link */
694 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
695 esc_url(
696 add_query_arg(
697 array(
698 'action' => 'merchant_pro_preview_request_review_reminder_email',
699 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
700 ),
701 admin_url( 'admin-post.php' )
702 )
703 )
704 ),
705 ),
706
707 ),
708 ),
709 array(
710 'id' => 'discount_for_review_email',
711 'type' => 'fields_group',
712 'title' => esc_html__( 'Discount for review', 'merchant' ),
713 'sub-desc' => esc_html__( 'Send customers a next-purchase code after submitting a review.', 'merchant' ),
714 'state' => 'closed',
715 'default' => 'inactive',
716 'accordion' => true,
717 'display_status' => true,
718 'fields' => array(
719 array(
720 'id' => 'subject',
721 'type' => 'text',
722 'title' => __( 'Subject', 'merchant' ),
723 'default' => __( 'Your discount code is inside', 'merchant' ),
724 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
725 'hidden_desc' => sprintf(
726 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
727 __(
728 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays discount code',
729 'merchant'
730 ),
731 '{first_name}',
732 '{last_name}',
733 '{discount_code}'
734 ),
735 ),
736 array(
737 'id' => 'body',
738 'type' => 'textarea_multiline',
739 'title' => __( 'Body', 'merchant' ),
740 'default' => __( 'Hello {first_name}, We would like to let you know that you are eligible to receive a discount on your next purchase. Here is your discount code: {discount_code}.', 'merchant' ),
741 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
742 'hidden_desc' => sprintf(
743 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
744 __(
745 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays discount code',
746 'merchant'
747 ),
748 '{first_name}',
749 '{last_name}',
750 '{discount_code}'
751 ),
752 ),
753 array(
754 'id' => 'preview-info',
755 'type' => 'info',
756 'content' => sprintf(
757 /* Translators: 1. docs link */
758 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
759 esc_url(
760 add_query_arg(
761 array(
762 'action' => 'merchant_pro_preview_discount_for_review_email',
763 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
764 ),
765 admin_url( 'admin-post.php' )
766 )
767 )
768 ),
769 ),
770
771 ),
772 ),
773 array(
774 'id' => 'discount_for_review_reminder_email',
775 'type' => 'fields_group',
776 'title' => esc_html__( 'Review discount reminder', 'merchant' ),
777 'sub-desc' => esc_html__( 'Remind your customers to use their next-purchase discount if they haven\'t used it yet.', 'merchant' ),
778 'state' => 'closed',
779 'default' => 'inactive',
780 'accordion' => true,
781 'display_status' => true,
782 'fields' => array(
783 array(
784 'id' => 'days_after_first_email',
785 'type' => 'number',
786 'title' => esc_html__( 'After the first email, send the discount reminder after the following number of days', 'merchant' ),
787 'default' => 7,
788 ),
789 array(
790 'id' => 'subject',
791 'type' => 'text',
792 'title' => __( 'Subject', 'merchant' ),
793 'default' => __( 'A reminder to to use your discount', 'merchant' ),
794 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
795 'hidden_desc' => sprintf(
796 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
797 __(
798 '<strong>%1$s:</strong> displays the customer’s first name<br><strong>%2$s:</strong> displays the customer’s last name<br><strong>%3$s:</strong> displays discount code',
799 'merchant'
800 ),
801 '{first_name}',
802 '{last_name}',
803 '{discount_code}'
804 ),
805 ),
806 array(
807 'id' => 'body',
808 'type' => 'textarea_multiline',
809 'title' => __( 'Body', 'merchant' ),
810 'default' => __( 'Hello {first_name},
811 This is a reminder to let you know that you are eligible to receive a discount on your next purchase. Here is your discount code: {discount_code}', 'merchant' ),
812 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
813 'hidden_desc' => sprintf(
814 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
815 __(
816 '<strong>%1$s:</strong> to show customer first name<br><strong>%2$s:</strong> to show customer last name<br><strong>%3$s:</strong> to show the discount code',
817 'merchant'
818 ),
819 '{first_name}',
820 '{last_name}',
821 '{discount_code}'
822 ),
823 ),
824 array(
825 'id' => 'preview-info',
826 'type' => 'info',
827 'content' => sprintf(
828 /* Translators: 1. docs link */
829 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
830 esc_url(
831 add_query_arg(
832 array(
833 'action' => 'merchant_pro_preview_discount_for_review_reminder_email',
834 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
835 ),
836 admin_url( 'admin-post.php' )
837 )
838 )
839 ),
840 ),
841
842 ),
843 ),
844 array(
845 'id' => 'sender_name',
846 'type' => 'text',
847 'title' => esc_html__( 'Sender name', 'merchant' ),
848 'desc' => esc_html__( 'Will be displayed in the inbox, in the "From" field.', 'merchant' ),
849 'placeholder' => get_bloginfo( 'name' ),
850 'default' => get_bloginfo( 'name' ),
851 ),
852 array(
853 'id' => 'sender_email',
854 'type' => 'text',
855 'title' => esc_html__( 'Sender email', 'merchant' ),
856 'desc' => esc_html__( 'We recommend using your customer support email so replies from customers are sent to that address.', 'merchant' ),
857 'placeholder' => get_bloginfo( 'admin_email' ),
858 'default' => get_bloginfo( 'admin_email' ),
859 ),
860 ),
861 )
862 );
863
864 // Modal Settings
865 Merchant_Admin_Options::create(
866 array(
867 'title' => __( 'Modal Settings', 'merchant' ),
868 'module' => Merchant_Advanced_Reviews::MODULE_ID,
869 'fields' => array(
870
871 /**
872 * Styles
873 *
874 */
875
876 // Modal Close icon color.
877 array(
878 'id' => 'modal_close_icon_color',
879 'type' => 'color',
880 'title' => __( 'Close icon color', 'merchant' ),
881 'default' => '#757575',
882 ),
883
884 // Modal Close icon color (hover).
885 array(
886 'id' => 'modal_close_icon_color_hover',
887 'type' => 'color',
888 'title' => __( 'Close icon color (hover)', 'merchant' ),
889 'default' => '#212121',
890 ),
891
892 // Modal Title color.
893 array(
894 'id' => 'modal_title_color',
895 'type' => 'color',
896 'title' => __( 'Title color', 'merchant' ),
897 'default' => '#212121',
898 ),
899
900 // Modal Description color.
901 array(
902 'id' => 'modal_description_color',
903 'type' => 'color',
904 'title' => __( 'Description color', 'merchant' ),
905 'default' => '#777',
906 ),
907
908 // Modal Textarea color.
909 array(
910 'id' => 'modal_textarea_color',
911 'type' => 'color',
912 'title' => __( 'Textarea color', 'merchant' ),
913 'default' => '#777',
914 ),
915
916 // Modal Textarea background color.
917 array(
918 'id' => 'modal_textarea_background_color',
919 'type' => 'color',
920 'title' => __( 'Textarea background color', 'merchant' ),
921 'default' => '#FFF',
922 ),
923
924 // Modal background color.
925 array(
926 'id' => 'modal_background_color',
927 'type' => 'color',
928 'title' => __( 'Modal background color', 'merchant' ),
929 'default' => '#F5F5F5',
930 ),
931
932 ),
933 )
934 );
935
936 // Shortcode
937 $merchant_module_id = Merchant_Advanced_Reviews::MODULE_ID;
938 Merchant_Admin_Options::create(
939 array(
940 'module' => $merchant_module_id,
941 'title' => esc_html__( 'Use shortcode', 'merchant' ),
942 'fields' => array(
943 array(
944 'id' => 'use_shortcode',
945 'type' => 'switcher',
946 'title' => __( 'Use shortcode', 'merchant' ),
947 'default' => 0,
948 ),
949 array(
950 'type' => 'info',
951 'id' => 'shortcode_info',
952 '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.',
953 'merchant' ),
954 ),
955 array(
956 'id' => 'shortcode_text',
957 'type' => 'text_readonly',
958 'title' => esc_html__( 'Shortcode text', 'merchant' ),
959 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
960 'condition' => array( 'use_shortcode', '==', '1' ),
961 ),
962 ),
963 )
964 );
965