PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.3.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.3.2
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 2.3.2, at inc/modules/advanced-reviews/admin/options.php

1,235 lines 46.3 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 — Option group definitions.
5 *
6 * Pure data file. Returns the option groups array
7 * consumed by init_option_groups().
8 *
9 * @package Merchant
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 /**
17 * Hook functionality before including modules options.
18 *
19 * @since 1.9.8
20 */
21
22 $aggregate_polylang_reviews = function_exists( 'pll_get_post_translations' ) ? array(
23 'id' => 'aggregate_reviews_translations',
24 'type' => 'switcher',
25 'title' => __( 'Aggregate Reviews Across Translations', 'merchant' ),
26 'desc' => __( 'Enable to include reviews from all Polylang-translated versions of a product, instead of only the selected product language.', 'merchant' ),
27 'default' => 0,
28 ) : null;
29
30 // Settings
31
32 return array(
33 array(
34 'title' => __( 'Content', 'merchant' ),
35 'module' => Merchant_Advanced_Reviews::MODULE_ID,
36 'fields' => array(
37
38 // Review options.
39 array(
40 'id' => 'review_options',
41 'type' => 'radio',
42 'title' => __( 'Review options', 'merchant' ),
43 'options' => array(
44 'image_and_text' => __( 'Image and text', 'merchant' ),
45 'image' => __( 'Image only', 'merchant' ),
46 'text' => __( 'Text only', 'merchant' ),
47 ),
48 'default' => 'image_and_text',
49 ),
50
51 // Photos Upload limit.
52 array(
53 'id' => 'photos_limit',
54 'type' => 'range',
55 'title' => __( 'Photos upload limit', 'merchant' ),
56 'desc' => __( 'Controls the photos upload limit for a review.', 'merchant' ),
57 'min' => 1,
58 'max' => '',
59 'step' => 1,
60 'unit' => '',
61 'default' => 6,
62 'condition' => array( 'review_options', 'any', 'image_and_text|image' ),
63 ),
64
65 // Default Reviews Sorting.
66 array(
67 'id' => 'default_sorting',
68 'type' => 'select',
69 'title' => __( 'Default reviews sorting', 'merchant' ),
70 'options' => array(
71 'newest' => __( 'Newest', 'merchant' ),
72 'oldest' => __( 'Oldest', 'merchant' ),
73 'top-rated' => __( 'Top rated', 'merchant' ),
74 'low-rated' => __( 'Low rated', 'merchant' ),
75 'photo-first' => __( 'Photo first', 'merchant' ),
76 ),
77 'default' => 'newest',
78 ),
79
80 // Pagination Type.
81 array(
82 'id' => 'pagination_type',
83 'type' => 'select',
84 'title' => __( 'Pagination type', 'merchant' ),
85 'desc' => sprintf(
86 /* Translators: 1. Defualt WordPress discussion settings page. */
87 __( '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>',
88 'merchant' ),
89 admin_url( 'options-discussion.php' )
90 ),
91 'options' => array(
92 'default' => __( 'Default', 'merchant' ),
93 'load-more' => __( 'Load more button', 'merchant' ),
94 ),
95 'default' => 'load-more',
96 ),
97
98 // Title.
99 array(
100 'id' => 'title',
101 'type' => 'text',
102 'title' => __( 'Title', 'merchant' ),
103 'default' => __( 'What our customers are saying', 'merchant' ),
104 ),
105
106 // Title HTML Tag.
107 array(
108 'id' => 'title_tag',
109 'type' => 'select',
110 'title' => __( 'Title HTML tag', 'merchant' ),
111 'options' => array(
112 'h1' => __( 'H1', 'merchant' ),
113 'h2' => __( 'H2', 'merchant' ),
114 'h3' => __( 'H3', 'merchant' ),
115 'h4' => __( 'H4', 'merchant' ),
116 'h5' => __( 'H5', 'merchant' ),
117 'h6' => __( 'H6', 'merchant' ),
118 'div' => __( 'div', 'merchant' ),
119 ),
120 'default' => 'h2',
121 ),
122
123 // Hide Title.
124 array(
125 'id' => 'hide_title',
126 'type' => 'switcher',
127 'title' => __( 'Hide title', 'merchant' ),
128 'default' => 0,
129 ),
130
131 // Description.
132 array(
133 'id' => 'description',
134 'type' => 'textarea',
135 'title' => __( 'Description', 'merchant' ),
136 'default' => '',
137 ),
138
139 // Title and Description Alignment.
140 array(
141 'id' => 'title_desc_align',
142 'type' => 'radio',
143 'title' => __( 'Title and description alignment', 'merchant' ),
144 'options' => array(
145 'left' => __( 'Left', 'merchant' ),
146 'center' => __( 'Center', 'merchant' ),
147 'right' => __( 'Right', 'merchant' ),
148 ),
149 'default' => 'left',
150 ),
151
152 // Review images carousel.
153 array(
154 'id' => 'review_images_carousel',
155 'type' => 'switcher',
156 'title' => __( 'Review images carousel', 'merchant' ),
157 'desc' => __( 'Display the first image from each review in a carousel to engage shoppers and help their decision-making process.', 'merchant' ),
158 'default' => 0,
159 ),
160
161 // Number of Images per page.
162 array(
163 'id' => 'review_images_carousel_total',
164 'type' => 'range',
165 'title' => __( 'Total images', 'merchant' ),
166 'desc' => __( 'Controls the total number of images to be displayed in the slider.', 'merchant' ),
167 'min' => 1,
168 'step' => 1,
169 'unit' => '',
170 'default' => 12,
171 'condition' => array( 'review_images_carousel', '==', '1' ),
172 ),
173
174 // Number of Columns.
175 array(
176 'id' => 'review_images_carousel_per_page',
177 'type' => 'range',
178 'title' => __( 'Columns', 'merchant' ),
179 'desc' => __( 'Controls the number of images to be displayed per slide.', 'merchant' ),
180 'min' => 1,
181 'max' => 6,
182 'step' => 1,
183 'unit' => '',
184 'default' => 3,
185 'condition' => array( 'review_images_carousel', '==', '1' ),
186 ),
187
188 // Carousel Title.
189 array(
190 'id' => 'carousel_title',
191 'type' => 'text',
192 'title' => __( 'Carousel title', 'merchant' ),
193 'default' => __( 'Reviews with Photos', 'merchant' ),
194 ),
195
196 // Hook Order.
197 array(
198 'id' => 'hook_order',
199 'type' => 'range',
200 'title' => __( 'Hook order', 'merchant' ),
201 '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.',
202 'merchant' ),
203 'min' => 1,
204 'max' => 100,
205 'step' => 1,
206 'unit' => '',
207 'default' => 10,
208 ),
209
210 $aggregate_polylang_reviews,
211 ),
212 ),
213 array(
214 'title' => __( 'Collect Reviews', 'merchant' ),
215 'module' => Merchant_Advanced_Reviews::MODULE_ID,
216 'fields' => array(
217 array(
218 'id' => 'auto_emails_toggle',
219 'type' => 'checkbox',
220 'label' => esc_html__( 'Send automated emails for review requests', 'merchant' ),
221 'default' => false,
222 ),
223 array(
224 'id' => 'days_after_order_complete',
225 'type' => 'number',
226 'title' => esc_html__( 'After the order is completed, send the review request after the following number of days', 'merchant' ),
227 'desc' => esc_html__( 'The emails will be sent for orders that have been completed.', 'merchant' ),
228 'default' => 7,
229 ),
230 array(
231 'id' => 'discount_toggle',
232 'type' => 'switcher',
233 'title' => __( 'Discount for reviews', 'merchant' ),
234 '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.',
235 'merchant' ),
236 'default' => 0,
237 'ai_meta' => array(
238 'toggle_for' => 'discount_generation_method',
239 'semantic_group' => 'offer_configuration',
240 'usage_hint' => 'Enable to send a discount coupon email after a customer submits a review. Must be enabled before setting discount_generation_method, discount_type, discount_amount, or discount_expire_after.',
241 ),
242 ),
243 array(
244 'id' => 'require_photo_for_discount',
245 'type' => 'checkbox',
246 'label' => esc_html__( 'Offer a discount specifically for leaving a photo review.', 'merchant' ),
247 'default' => false,
248 'conditions' => array(
249 'terms' => array(
250 array(
251 'field' => 'discount_toggle', // field ID
252 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
253 'value' => true, // can be a single value or an array of string/number/int
254 ),
255 ),
256 ),
257 ),
258 array(
259 'id' => 'discount_generation_method',
260 'type' => 'radio',
261 'title' => esc_html__( 'Discount generation method', 'merchant' ),
262 'options' => array(
263 'auto' => esc_html__( 'Auto-generated code (different each time)', 'merchant' ),
264 'manual' => esc_html__( 'Single discount code', 'merchant' ),
265 ),
266 'default' => 'auto',
267 'conditions' => array(
268 'terms' => array(
269 array(
270 'field' => 'discount_toggle', // field ID
271 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
272 'value' => true, // can be a single value or an array of string/number/int
273 ),
274 ),
275 ),
276 'ai_meta' => array(
277 'semantic_group' => 'offer_configuration',
278 'usage_hint' => 'Controls how discount codes are generated. Use auto for unique per-customer codes, manual for a single reusable code. Requires discount_toggle=true.',
279 ),
280 ),
281 array(
282 'id' => 'discount_info',
283 'type' => 'info',
284 '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.',
285 'merchant' ),
286 'conditions' => array(
287 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
288 'terms' => array(
289 array(
290 'field' => 'discount_toggle', // field ID
291 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
292 'value' => true, // can be a single value or an array of string/number/int
293 ),
294 array(
295 'field' => 'discount_generation_method', // field ID
296 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
297 'value' => 'auto', // can be a single value or an array of string/number/int
298 ),
299 ),
300 ),
301 ),
302 array(
303 'id' => 'discount_type',
304 'type' => 'radio',
305 'title' => esc_html__( 'Discount', 'merchant' ),
306 'options' => array(
307 'percent' => esc_html__( 'Percentage', 'merchant' ),
308 'fixed_cart' => esc_html__( 'Fixed', 'merchant' ),
309 ),
310 'default' => 'percent',
311 'conditions' => array(
312 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
313 'terms' => array(
314 array(
315 'field' => 'discount_toggle', // field ID
316 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
317 'value' => true, // can be a single value or an array of string/number/int
318 ),
319 array(
320 'field' => 'discount_generation_method', // field ID
321 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
322 'value' => 'auto', // can be a single value or an array of string/number/int
323 ),
324 ),
325 ),
326 'ai_meta' => array(
327 'semantic_group' => 'offer_configuration',
328 'usage_hint' => 'Sets whether the discount is a percentage or a fixed amount. Requires discount_toggle=true and discount_generation_method=auto.',
329 ),
330 ),
331 array(
332 'id' => 'discount_amount',
333 'type' => 'number',
334 'step' => 0.01,
335 'default' => 10,
336 'conditions' => array(
337 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
338 'terms' => array(
339 array(
340 'field' => 'discount_toggle', // field ID
341 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
342 'value' => true, // can be a single value or an array of string/number/int
343 ),
344 array(
345 'field' => 'discount_generation_method', // field ID
346 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
347 'value' => 'auto', // can be a single value or an array of string/number/int
348 ),
349 ),
350 ),
351 'ai_meta' => array(
352 'semantic_group' => 'offer_configuration',
353 'usage_hint' => 'The numeric discount value. Interpreted as a percentage when discount_type=percent, or as a fixed currency amount when discount_type=fixed_cart. Requires discount_toggle=true and discount_generation_method=auto.',
354 ),
355 ),
356 array(
357 'id' => 'discount_expire_after',
358 'type' => 'select',
359 'title' => esc_html__( 'Discount expires after', 'merchant' ),
360 'options' => array(
361 'never' => esc_html__( 'Never', 'merchant' ),
362 '7' => esc_html__( '7 days', 'merchant' ),
363 '14' => esc_html__( '14 days', 'merchant' ),
364 '21' => esc_html__( '21 days', 'merchant' ),
365 '30' => esc_html__( '30 days', 'merchant' ),
366 '60' => esc_html__( '60 days', 'merchant' ),
367 '90' => esc_html__( '90 days', 'merchant' ),
368 '180' => esc_html__( '180 days', 'merchant' ),
369 '365' => esc_html__( '365 days', 'merchant' ),
370 ),
371 'conditions' => array(
372 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
373 'terms' => array(
374 array(
375 'field' => 'discount_toggle', // field ID
376 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
377 'value' => true, // can be a single value or an array of string/number/int
378 ),
379 array(
380 'field' => 'discount_generation_method', // field ID
381 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
382 'value' => 'auto', // can be a single value or an array of string/number/int
383 ),
384 ),
385 ),
386 'ai_meta' => array(
387 'semantic_group' => 'offer_configuration',
388 'usage_hint' => 'How many days after issuing before the coupon expires. Use never for no expiry. Requires discount_toggle=true and discount_generation_method=auto.',
389 ),
390 ),
391 array(
392 'id' => 'coupon_campaign_info',
393 'type' => 'info_block',
394 '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.',
395 'merchant' ),
396 'button_text' => esc_html__( 'Create discount code', 'merchant' ),
397 'button_link' => admin_url( 'edit.php?post_type=shop_coupon' ),
398 'conditions' => array(
399 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
400 'terms' => array(
401 array(
402 'field' => 'discount_toggle', // field ID
403 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
404 'value' => true, // can be a single value or an array of string/number/int
405 ),
406 array(
407 'field' => 'discount_generation_method', // field ID
408 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
409 'value' => 'manual', // can be a single value or an array of string/number/int
410 ),
411 ),
412 ),
413 ),
414 array(
415 'id' => 'manual_coupon_code',
416 'type' => 'wc_coupons',
417 'title' => esc_html__( 'Select manually created discount code', 'merchant' ),
418 //'desc' => esc_html__( 'The discount code must be created in WooCommerce to work and add here to validate.', 'merchant' ),
419 'conditions' => array(
420 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
421 'terms' => array(
422 array(
423 'field' => 'discount_toggle', // field ID
424 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
425 'value' => true, // can be a single value or an array of string/number/int
426 ),
427 array(
428 'field' => 'discount_generation_method', // field ID
429 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
430 'value' => 'manual', // can be a single value or an array of string/number/int
431 ),
432 ),
433 ),
434 ),
435 ),
436 ),
437 array(
438 'title' => __( 'Emails', 'merchant' ),
439 'module' => Merchant_Advanced_Reviews::MODULE_ID,
440 'fields' => array(
441 array(
442 'id' => 'review_request_email',
443 'type' => 'fields_group',
444 'title' => esc_html__( 'Review request', 'merchant' ),
445 'sub-desc' => esc_html__( 'Encourage your customers to leave a review with automated emails.', 'merchant' ),
446 'state' => 'open',
447 'default' => 'inactive',
448 'accordion' => true,
449 'display_status' => true,
450 'fields' => array(
451 array(
452 'id' => 'subject',
453 'type' => 'text',
454 'title' => __( 'Subject', 'merchant' ),
455 'default' => __( 'How did we do?', 'merchant' ),
456 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
457 'hidden_desc' => sprintf(
458 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
459 __(
460 '<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.',
461 'merchant'
462 ),
463 '{first_name}',
464 '{last_name}',
465 '{order_id}',
466 '{order_url_open}',
467 '{order_url_close}'
468 ),
469 ),
470 array(
471 'id' => 'body',
472 'type' => 'textarea_multiline',
473 'title' => __( 'Body', 'merchant' ),
474 'default' => __( 'Hello {first_name},
475
476 We hope you’re enjoying your recent purchase from us.
477
478 We would be grateful if you could take a moment to share your experience by leaving a review.
479
480 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.
481
482 Best regards,', 'merchant' ),
483 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
484 'hidden_desc' => sprintf(
485 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
486 __(
487 '<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.',
488 'merchant'
489 ),
490 '{first_name}',
491 '{last_name}',
492 '{order_id}',
493 '{order_url_open}',
494 '{order_url_close}'
495 ),
496 ),
497 // array(
498 // 'id' => 'review_btn_type',
499 // 'type' => 'select',
500 // 'title' => esc_html__( 'Review request button type', 'merchant' ),
501 // 'options' => array(
502 // 'rating_stars' => esc_html__( 'Rating stars', 'merchant' ),
503 // 'custom_button' => esc_html__( 'Custom Button', 'merchant' ),
504 // ),
505 // 'default' => 'custom_button',
506 // ),
507 // array(
508 // 'id' => 'review_btn_text',
509 // 'type' => 'text',
510 // 'title' => __( 'Button text', 'merchant' ),
511 // 'default' => __( 'Write a review', 'merchant' ),
512 // 'conditions' => array(
513 // 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
514 // 'terms' => array(
515 // array(
516 // 'field' => 'review_btn_type', // field ID
517 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
518 // 'value' => 'custom_button', // can be a single value or an array of string/number/int
519 // ),
520 // ),
521 // ),
522 // ),
523 array(
524 'id' => 'preview-info',
525 'type' => 'info',
526 'content' => sprintf(
527 /* Translators: 1. docs link */
528 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
529 esc_url(
530 add_query_arg(
531 array(
532 'action' => 'merchant_pro_preview_request_review_email',
533 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
534 ),
535 admin_url( 'admin-post.php' )
536 )
537 )
538 ),
539 ),
540 array(
541 'id' => 'email-template-info-1',
542 'type' => 'info',
543 'content' => sprintf(
544 /* Translators: 1. settings link */
545 __( 'To customize the content of the email template, please go to Email Sender Options under WooCommerce > Settings > Emails or click <a href="%1$s" target="_blank">here</a> to open the option directly.', 'merchant' ),
546 esc_url(
547 add_query_arg(
548 array(
549 'page' => 'wc-settings',
550 'tab' => 'email#email_options-description',
551 ),
552 admin_url( 'admin.php' )
553 )
554 )
555 ),
556 ),
557 ),
558 ),
559 array(
560 'id' => 'review_request_reminder_email',
561 'type' => 'fields_group',
562 'title' => esc_html__( 'Review request reminder', 'merchant' ),
563 'sub-desc' => esc_html__( 'Send a second review request to customers who did not submit a review yet.', 'merchant' ),
564 'state' => 'closed',
565 'default' => 'inactive',
566 'accordion' => true,
567 'display_status' => true,
568 'fields' => array(
569 array(
570 'id' => 'days_after_first_email',
571 'type' => 'number',
572 'title' => esc_html__( 'After the first email, send the review request reminder after the following number of days', 'merchant' ),
573 'default' => 7,
574 ),
575 array(
576 'id' => 'subject',
577 'type' => 'text',
578 'title' => __( 'Subject', 'merchant' ),
579 'default' => __( 'We value your feedback', 'merchant' ),
580 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
581 'hidden_desc' => sprintf(
582 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
583 __(
584 '<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.',
585 'merchant'
586 ),
587 '{first_name}',
588 '{last_name}',
589 '{order_id}',
590 '{order_url_open}',
591 '{order_url_close}'
592 ),
593 ),
594 array(
595 'id' => 'body',
596 'type' => 'textarea_multiline',
597 'title' => __( 'Body', 'merchant' ),
598 'default' => __( 'Hello {first_name},
599
600 We hope you’re enjoying your recent purchase from us.
601
602 We would be grateful if you could take a moment to share your experience by leaving a review.
603
604 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.
605
606 Best regards,', 'merchant' ),
607 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
608 'hidden_desc' => sprintf(
609 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
610 __(
611 '<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.',
612 'merchant'
613 ),
614 '{first_name}',
615 '{last_name}',
616 '{order_id}',
617 '{order_url_open}',
618 '{order_url_close}'
619 ),
620 ),
621 // array(
622 // 'id' => 'review_btn_type',
623 // 'type' => 'select',
624 // 'title' => esc_html__( 'Review request button type', 'merchant' ),
625 // 'options' => array(
626 // 'rating_stars' => esc_html__( 'Rating stars', 'merchant' ),
627 // 'custom_button' => esc_html__( 'Custom Button', 'merchant' ),
628 // ),
629 // 'default' => 'custom_button',
630 // ),
631 // array(
632 // 'id' => 'review_btn_text',
633 // 'type' => 'text',
634 // 'title' => __( 'Button text', 'merchant' ),
635 // 'default' => __( 'Write a review', 'merchant' ),
636 // 'conditions' => array(
637 // 'relation' => 'AND', // AND/OR, If not provided, only first term will be considered
638 // 'terms' => array(
639 // array(
640 // 'field' => 'review_btn_type', // field ID
641 // 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
642 // 'value' => 'custom_button', // can be a single value or an array of string/number/int
643 // ),
644 // ),
645 // ),
646 // ),
647 array(
648 'id' => 'preview-info',
649 'type' => 'info',
650 'content' => sprintf(
651 /* Translators: 1. docs link */
652 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
653 esc_url(
654 add_query_arg(
655 array(
656 'action' => 'merchant_pro_preview_request_review_reminder_email',
657 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
658 ),
659 admin_url( 'admin-post.php' )
660 )
661 )
662 ),
663 ),
664 array(
665 'id' => 'email-template-info-2',
666 'type' => 'info',
667 'content' => sprintf(
668 /* Translators: 1. settings link */
669 __( 'To customize the content of the email template, please go to Email Sender Options under WooCommerce > Settings > Emails or click <a href="%1$s" target="_blank">here</a> to open the option directly.', 'merchant' ),
670 esc_url(
671 add_query_arg(
672 array(
673 'page' => 'wc-settings',
674 'tab' => 'email#email_options-description',
675 ),
676 admin_url( 'admin.php' )
677 )
678 )
679 ),
680 ),
681 ),
682 ),
683 array(
684 'id' => 'discount_for_review_email',
685 'type' => 'fields_group',
686 'title' => esc_html__( 'Discount for review', 'merchant' ),
687 'sub-desc' => esc_html__( 'Send customers a next-purchase code after submitting a review.', 'merchant' ),
688 'state' => 'closed',
689 'default' => 'inactive',
690 'accordion' => true,
691 'display_status' => true,
692 'fields' => array(
693 array(
694 'id' => 'subject',
695 'type' => 'text',
696 'title' => __( 'Subject', 'merchant' ),
697 'default' => __( 'Your discount code is inside', 'merchant' ),
698 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
699 'hidden_desc' => sprintf(
700 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
701 __(
702 '<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',
703 'merchant'
704 ),
705 '{first_name}',
706 '{last_name}',
707 '{discount_code}'
708 ),
709 ),
710 array(
711 'id' => 'body',
712 'type' => 'textarea_multiline',
713 'title' => __( 'Body', 'merchant' ),
714 '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}.',
715 'merchant' ),
716 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
717 'hidden_desc' => sprintf(
718 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
719 __(
720 '<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',
721 'merchant'
722 ),
723 '{first_name}',
724 '{last_name}',
725 '{discount_code}'
726 ),
727 ),
728 array(
729 'id' => 'preview-info',
730 'type' => 'info',
731 'content' => sprintf(
732 /* Translators: 1. docs link */
733 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
734 esc_url(
735 add_query_arg(
736 array(
737 'action' => 'merchant_pro_preview_discount_for_review_email',
738 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
739 ),
740 admin_url( 'admin-post.php' )
741 )
742 )
743 ),
744 ),
745 array(
746 'id' => 'email-template-info-3',
747 'type' => 'info',
748 'content' => sprintf(
749 /* Translators: 1. settings link */
750 __( 'To customize the content of the email template, please go to Email Sender Options under WooCommerce > Settings > Emails or click <a href="%1$s" target="_blank">here</a> to open the option directly.', 'merchant' ),
751 esc_url(
752 add_query_arg(
753 array(
754 'page' => 'wc-settings',
755 'tab' => 'email#email_options-description',
756 ),
757 admin_url( 'admin.php' )
758 )
759 )
760 ),
761 ),
762 ),
763 ),
764 array(
765 'id' => 'discount_for_review_reminder_email',
766 'type' => 'fields_group',
767 'title' => esc_html__( 'Review discount reminder', 'merchant' ),
768 'sub-desc' => esc_html__( 'Remind your customers to use their next-purchase discount if they haven\'t used it yet.', 'merchant' ),
769 'state' => 'closed',
770 'default' => 'inactive',
771 'accordion' => true,
772 'display_status' => true,
773 'fields' => array(
774 array(
775 'id' => 'days_after_first_email',
776 'type' => 'number',
777 'title' => esc_html__( 'After the first email, send the discount reminder after the following number of days', 'merchant' ),
778 'default' => 7,
779 ),
780 array(
781 'id' => 'subject',
782 'type' => 'text',
783 'title' => __( 'Subject', 'merchant' ),
784 'default' => __( 'A reminder to to use your discount', 'merchant' ),
785 'desc' => __( 'Be concise, avoid CAPS and !s, and use emojis sparingly.', 'merchant' ),
786 'hidden_desc' => sprintf(
787 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
788 __(
789 '<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',
790 'merchant'
791 ),
792 '{first_name}',
793 '{last_name}',
794 '{discount_code}'
795 ),
796 ),
797 array(
798 'id' => 'body',
799 'type' => 'textarea_multiline',
800 'title' => __( 'Body', 'merchant' ),
801 'default' => __( 'Hello {first_name},
802 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' ),
803 'desc' => __( 'You can use these codes in the content.', 'merchant' ),
804 'hidden_desc' => sprintf(
805 /* Translators: %1$s: Discount percentage, %2$s: Discount amount, %3$s: In Stock, %4$s: Total quantity */
806 __(
807 '<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',
808 'merchant'
809 ),
810 '{first_name}',
811 '{last_name}',
812 '{discount_code}'
813 ),
814 ),
815 array(
816 'id' => 'preview-info',
817 'type' => 'info',
818 'content' => sprintf(
819 /* Translators: 1. docs link */
820 __( 'Click <a href="%1$s" target="_blank">here</a> to preview the email and see how it will look.', 'merchant' ),
821 esc_url(
822 add_query_arg(
823 array(
824 'action' => 'merchant_pro_preview_discount_for_review_reminder_email',
825 'nonce' => wp_create_nonce( 'merchant_pro_advanced_reviews_mailer_preview' ),
826 ),
827 admin_url( 'admin-post.php' )
828 )
829 )
830 ),
831 ),
832 array(
833 'id' => 'email-template-info-4',
834 'type' => 'info',
835 'content' => sprintf(
836 /* Translators: 1. settings link */
837 __( 'To customize the content of the email template, please go to Email Sender Options under WooCommerce > Settings > Emails or click <a href="%1$s" target="_blank">here</a> to open the option directly.', 'merchant' ),
838 esc_url(
839 add_query_arg(
840 array(
841 'page' => 'wc-settings',
842 'tab' => 'email#email_options-description',
843 ),
844 admin_url( 'admin.php' )
845 )
846 )
847 ),
848 ),
849 ),
850 ),
851 array(
852 'id' => 'sender_name',
853 'type' => 'text',
854 'title' => esc_html__( 'Sender name', 'merchant' ),
855 'desc' => esc_html__( 'Will be displayed in the inbox, in the "From" field.', 'merchant' ),
856 'placeholder' => get_bloginfo( 'name' ),
857 'default' => get_bloginfo( 'name' ),
858 ),
859 array(
860 'id' => 'sender_email',
861 'type' => 'text',
862 'title' => esc_html__( 'Sender email', 'merchant' ),
863 'desc' => esc_html__( 'We recommend using your customer support email so replies from customers are sent to that address.', 'merchant' ),
864 'placeholder' => get_bloginfo( 'admin_email' ),
865 'default' => get_bloginfo( 'admin_email' ),
866 ),
867 ),
868 ),
869 array(
870 'module' => Merchant_Advanced_Reviews::MODULE_ID,
871 'title' => esc_html__( 'Review Carousels', 'merchant' ),
872 'fields' => array(
873 array(
874 'id' => 'carousel_toggle',
875 'type' => 'switcher',
876 'title' => esc_html__( 'Use reviews carousel', 'merchant' ),
877 'default' => 0,
878 ),
879 array(
880 'id' => 'carousels',
881 'type' => 'flexible_content',
882 'sorting' => true,
883 'accordion' => true,
884 'duplicate' => true,
885 'style' => Merchant_Advanced_Reviews::MODULE_ID . '-style default',
886 'button_label' => esc_html__( 'Add New Carousel', 'merchant' ),
887 'conditions' => array(
888 'terms' => array(
889 array(
890 'field' => 'carousel_toggle', // field ID
891 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
892 'value' => true, // can be a single value or an array of string/number/int
893 ),
894 ),
895 ),
896 'layouts' => array(
897 'carousels' => array(
898 'title' => esc_html__( 'Reviews', 'merchant' ),
899 'fields' => array(
900 array(
901 'id' => 'enable',
902 'type' => 'switcher',
903 'title' => esc_html__( 'Show/hide carousel', 'merchant' ),
904 'default' => 1,
905 ),
906 array(
907 'id' => 'carousel_title',
908 'type' => 'text',
909 'title' => __( 'Testimonial title', 'merchant' ),
910 'desc' => __( 'This title will be displayed above the carousel.', 'merchant' ),
911 'default' => __( 'Happy Customers', 'merchant' ),
912 ),
913 array(
914 'id' => 'carousel_description',
915 'type' => 'text',
916 'title' => __( 'Description', 'merchant' ),
917 'desc' => __( 'This description will be displayed below the carousel title.', 'merchant' ),
918 'default' => __( 'Customers from all over the world love our products!', 'merchant' ),
919 ),
920 array(
921 'id' => 'reviews',
922 'type' => 'reviews_selector',
923 'title' => __( 'Reviews', 'merchant' ),
924 ),
925 array(
926 'id' => 'visible_slides_at_once',
927 'type' => 'radio',
928 'title' => esc_html__( 'Number of reviews at once', 'merchant' ),
929 'options' => array(
930 // The numbers only are not working as expected, added a string to make it work and will be replaced inside the template.
931 'slide_1' => esc_html__( '1', 'merchant' ),
932 'slide_2' => esc_html__( '2', 'merchant' ),
933 'slide_3' => esc_html__( '3', 'merchant' ),
934 ),
935 'default' => 'slide_3',
936 'desc' => esc_html__( 'Controls the number of reviews to be displayed in a single view', 'merchant' ),
937 ),
938 array(
939 'id' => 'centred_content',
940 'type' => 'checkbox',
941 'label' => esc_html__( 'Centered review alignment', 'merchant' ),
942 'default' => true,
943 ),
944 array(
945 'id' => 'show_as_boxed',
946 'type' => 'checkbox',
947 'label' => esc_html__( 'Show as boxed', 'merchant' ),
948 'default' => 0,
949 ),
950 array(
951 'id' => 'border_width',
952 'type' => 'range',
953 'title' => esc_html__( 'Border size', 'merchant' ),
954 'min' => 0,
955 'max' => 20,
956 'step' => 1,
957 'unit' => 'px',
958 'default' => 1,
959 'condition' => array( 'show_as_boxed', '==', '1' ),
960 ),
961 array(
962 'id' => 'border_radius',
963 'type' => 'range',
964 'title' => esc_html__( 'Corner radius', 'merchant' ),
965 'min' => 0,
966 'max' => 200,
967 'step' => 1,
968 'unit' => 'px',
969 'default' => 0,
970 'condition' => array( 'show_as_boxed', '==', '1' ),
971 ),
972 array(
973 'id' => 'border_color',
974 'type' => 'color',
975 'title' => esc_html__( 'Border color', 'merchant' ),
976 'default' => '#000000',
977 'condition' => array( 'show_as_boxed', '==', '1' ),
978 ),
979 array(
980 'id' => 'show_product_image',
981 'type' => 'switcher',
982 'title' => esc_html__( 'Show product image', 'merchant' ),
983 'default' => 0,
984 ),
985 array(
986 'id' => 'show_on',
987 'type' => 'radio',
988 'title' => esc_html__( 'Show on', 'merchant' ),
989 'options' => array(
990 'shop_page' => esc_html__( 'Shop page', 'merchant' ),
991 'shortcode' => esc_html__( 'Shortcode', 'merchant' ),
992 ),
993 'default' => 'shortcode',
994 ),
995 array(
996 'id' => 'placement',
997 'type' => 'select',
998 'title' => esc_html__( 'Placement', 'merchant' ),
999 'options' => array(
1000 'woocommerce_before_main_content' => esc_html__( 'Before Main Content', 'merchant' ),
1001 'woocommerce_after_shop_loop' => esc_html__( 'After Main Content', 'merchant' ),
1002 ),
1003 'default' => 'woocommerce_before_main_content',
1004 'conditions' => array(
1005 'terms' => array(
1006 array(
1007 'field' => 'show_on', // field ID
1008 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
1009 'value' => 'shop_page', // can be a single value or an array of string/number/int
1010 ),
1011 ),
1012 ),
1013 ),
1014 array(
1015 'id' => 'shortcode_info',
1016 'type' => 'info',
1017 'content' => sprintf(
1018 /* Translators: 1. Link open tag 2. Link close tag */
1019 __(
1020 'Use this shortcode %s to showcase the reviews carousel, and include the instance number in the shortcode ID.',
1021 'merchant'
1022 ),
1023 '<strong>[merchant_reviews_carousel id="1"]</strong>'
1024 ),
1025 'conditions' => array(
1026 'terms' => array(
1027 array(
1028 'field' => 'show_on', // field ID
1029 'operator' => '===', // Available operators: ===, !==, >, <, >=, <=, in, !in, contains, !contains
1030 'value' => 'shortcode', // can be a single value or an array of string/number/int
1031 ),
1032 ),
1033 ),
1034 ),
1035 ),
1036 ),
1037 ),
1038 'default' => array(
1039 array(
1040 'layout' => 'carousels',
1041 'label' => esc_html__( 'Reviews carousels', 'merchant' ),
1042 ),
1043 ),
1044 ),
1045
1046 ),
1047 ),
1048 array(
1049 'title' => __( 'Look and Feel', 'merchant' ),
1050 'module' => Merchant_Advanced_Reviews::MODULE_ID,
1051 'fields' => array(
1052
1053 /**
1054 * Styles
1055 *
1056 */
1057
1058 // Title color.
1059 array(
1060 'id' => 'title_color',
1061 'type' => 'color',
1062 'title' => __( 'Title color', 'merchant' ),
1063 'default' => '#212121',
1064 ),
1065
1066 // Description color.
1067 array(
1068 'id' => 'description_color',
1069 'type' => 'color',
1070 'title' => __( 'Description color', 'merchant' ),
1071 'default' => '#777',
1072 ),
1073
1074 // Stars color.
1075 array(
1076 'id' => 'stars_color',
1077 'type' => 'color',
1078 'title' => __( 'Stars color', 'merchant' ),
1079 'default' => '#FFA441',
1080 ),
1081
1082 // Stars background color.
1083 array(
1084 'id' => 'stars_background_color',
1085 'type' => 'color',
1086 'title' => __( 'Stars background color', 'merchant' ),
1087 'default' => '#757575',
1088 ),
1089
1090 // Progress bar color.
1091 array(
1092 'id' => 'progress_bar_color',
1093 'type' => 'color',
1094 'title' => __( 'Progress bar color', 'merchant' ),
1095 'default' => '#212121',
1096 ),
1097
1098 // Progress bar background color.
1099 array(
1100 'id' => 'progress_bar_bg_color',
1101 'type' => 'color',
1102 'title' => __( 'Progress bar background color', 'merchant' ),
1103 'default' => '#F5F5F5',
1104 ),
1105
1106 // Dividers color.
1107 array(
1108 'id' => 'dividers_color',
1109 'type' => 'color',
1110 'title' => __( 'Dividers color', 'merchant' ),
1111 'default' => '#e9e9e9',
1112 ),
1113
1114 // Button color.
1115 array(
1116 'id' => 'button_color',
1117 'type' => 'color',
1118 'title' => __( 'Button color', 'merchant' ),
1119 'default' => '#FFF',
1120 ),
1121
1122 // Button color (hover).
1123 array(
1124 'id' => 'button_color_hover',
1125 'type' => 'color',
1126 'title' => __( 'Button color (hover)', 'merchant' ),
1127 'default' => '#FFF',
1128 ),
1129
1130 // Button background color.
1131 array(
1132 'id' => 'button_bg_color',
1133 'type' => 'color',
1134 'title' => __( 'Button background color', 'merchant' ),
1135 'default' => '#212121',
1136 ),
1137
1138 // Button background color (hover).
1139 array(
1140 'id' => 'button_bg_color_hover',
1141 'type' => 'color',
1142 'title' => __( 'Button background color (hover)', 'merchant' ),
1143 'default' => '#757575',
1144 ),
1145
1146
1147
1148 /**
1149 * Styles
1150 *
1151 */
1152 // Modal Close icon color.
1153 array(
1154 'id' => 'modal_close_icon_color',
1155 'type' => 'color',
1156 'title' => __( 'Modal close icon color', 'merchant' ),
1157 'default' => '#757575',
1158 ),
1159
1160 // Modal Close icon color (hover).
1161 array(
1162 'id' => 'modal_close_icon_color_hover',
1163 'type' => 'color',
1164 'title' => __( 'Modal close icon color (hover)', 'merchant' ),
1165 'default' => '#212121',
1166 ),
1167
1168 // Modal Title color.
1169 array(
1170 'id' => 'modal_title_color',
1171 'type' => 'color',
1172 'title' => __( 'Modal title color', 'merchant' ),
1173 'default' => '#212121',
1174 ),
1175
1176 // Modal Description color.
1177 array(
1178 'id' => 'modal_description_color',
1179 'type' => 'color',
1180 'title' => __( 'Modal description color', 'merchant' ),
1181 'default' => '#777',
1182 ),
1183
1184 // Modal Textarea color.
1185 array(
1186 'id' => 'modal_textarea_color',
1187 'type' => 'color',
1188 'title' => __( 'Modal textarea color', 'merchant' ),
1189 'default' => '#777',
1190 ),
1191
1192 // Modal Textarea background color.
1193 array(
1194 'id' => 'modal_textarea_background_color',
1195 'type' => 'color',
1196 'title' => __( 'Modal textarea background color', 'merchant' ),
1197 'default' => '#FFF',
1198 ),
1199
1200 // Modal background color.
1201 array(
1202 'id' => 'modal_background_color',
1203 'type' => 'color',
1204 'title' => __( 'Modal background color', 'merchant' ),
1205 'default' => '#F5F5F5',
1206 ),
1207 ),
1208 ),
1209 array(
1210 'module' => Merchant_Advanced_Reviews::MODULE_ID,
1211 'title' => esc_html__( 'Use shortcode', 'merchant' ),
1212 'fields' => array(
1213 array(
1214 'id' => 'use_shortcode',
1215 'type' => 'switcher',
1216 'title' => __( 'Use shortcode', 'merchant' ),
1217 'default' => 0,
1218 ),
1219 array(
1220 'type' => 'info',
1221 'id' => 'shortcode_info',
1222 '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.',
1223 'merchant' ),
1224 ),
1225 array(
1226 'id' => 'shortcode_text',
1227 'type' => 'text_readonly',
1228 'title' => esc_html__( 'Shortcode text', 'merchant' ),
1229 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Advanced_Reviews::MODULE_ID ) . ']',
1230 'condition' => array( 'use_shortcode', '==', '1' ),
1231 ),
1232 ),
1233 ),
1234 );
1235