PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.2.7
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.2.7
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / inc / modules / wishlist / admin / options.php

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

510 lines 14.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Wishlist Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // General Settings.
14 Merchant_Admin_Options::create( array(
15 'title' => esc_html__( 'General Settings', 'merchant' ),
16 'module' => 'wishlist',
17 'fields' => array(
18
19 // Display on single product pages.
20 array(
21 'id' => 'display_on_shop_archive',
22 'type' => 'switcher',
23 'title' => esc_html__( 'Display on shop archive', 'merchant' ),
24 'desc' => esc_html__( 'Display the wishlist button in the products grid from shop catalog pages.', 'merchant' ),
25 'default' => 1,
26 ),
27
28 // Display on single product pages.
29 array(
30 'id' => 'display_on_single_product',
31 'type' => 'switcher',
32 'title' => esc_html__( 'Display on single product', 'merchant' ),
33 'desc' => esc_html__( 'Display the wishlist button in the single product pages.', 'merchant' ),
34 'default' => 1,
35 ),
36
37 array(
38 'id' => 'display_on_cart_page',
39 'type' => 'switcher',
40 'title' => esc_html__( 'Display on cart page', 'merchant' ),
41 'desc' => esc_html__( 'Display the wishlist products on the cart page.', 'merchant' ),
42 'default' => 0,
43 ),
44
45 array(
46 'id' => 'posts_per_page',
47 'type' => 'range',
48 'title' => esc_html__( 'Products', 'merchant' ),
49 'desc' => esc_html__( 'Controls the number of products to display in the wishlist grid.', 'merchant' ),
50 'min' => 1,
51 'max' => 30,
52 'step' => 1,
53 'unit' => '',
54 'default' => 6,
55 'condition' => array( 'display_on_cart_page', '==', '1' ),
56 ),
57
58 array(
59 'id' => 'cart_page_title',
60 'type' => 'text',
61 'title' => esc_html__( 'Title', 'merchant' ),
62 'default' => esc_html__( 'Your wishlist items', 'merchant' ),
63 'condition' => array( 'display_on_cart_page', '==', '1' ),
64 ),
65
66 array(
67 'id' => 'cart_page_title_tag',
68 'type' => 'select',
69 'title' => esc_html__( 'Title HTML tag', 'merchant' ),
70 'options' => array(
71 'h1' => esc_html__( 'H1', 'merchant' ),
72 'h2' => esc_html__( 'H2', 'merchant' ),
73 'h3' => esc_html__( 'H3', 'merchant' ),
74 'h4' => esc_html__( 'H4', 'merchant' ),
75 'h5' => esc_html__( 'H5', 'merchant' ),
76 'h6' => esc_html__( 'H6', 'merchant' ),
77 'div' => esc_html__( 'div', 'merchant' ),
78 ),
79 'default' => 'h2',
80 'condition' => array( 'display_on_cart_page', '==', '1' ),
81 ),
82
83 array(
84 'id' => 'inclusion',
85 'type' => 'switcher',
86 'title' => esc_html__( 'Product Inclusion', 'merchant' ),
87 'desc' => esc_html__( 'Include only certain products or categories', 'merchant' ),
88 'default' => 0,
89 ),
90
91 array(
92 'id' => 'included_products',
93 'type' => 'products_selector',
94 'title' => esc_html__( 'Include Products', 'merchant' ),
95 'multiple' => true,
96 'conditions' => array(
97 'relation' => 'AND',
98 'terms' => array(
99 array(
100 'field' => 'inclusion',
101 'operator' => '===',
102 'value' => true,
103 ),
104 ),
105 ),
106 ),
107
108 array(
109 'id' => 'included_categories',
110 'type' => 'select_ajax',
111 'title' => esc_html__( 'Include Categories', 'merchant' ),
112 'source' => 'options',
113 'multiple' => true,
114 'options' => Merchant_Admin_Options::get_category_select2_choices(),
115 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
116 'conditions' => array(
117 'relation' => 'AND',
118 'terms' => array(
119 array(
120 'field' => 'inclusion',
121 'operator' => '===',
122 'value' => true,
123 ),
124 ),
125 ),
126 ),
127
128 array(
129 'id' => 'exclusion',
130 'type' => 'switcher',
131 'title' => esc_html__( 'Product Exclusion', 'merchant' ),
132 'desc' => esc_html__( 'Exclude certain products or categories', 'merchant' ),
133 'default' => 0,
134 ),
135
136 array(
137 'id' => 'excluded_products',
138 'type' => 'products_selector',
139 'title' => esc_html__( 'Exclude Products', 'merchant' ),
140 'multiple' => true,
141 'conditions' => array(
142 'relation' => 'AND',
143 'terms' => array(
144 array(
145 'field' => 'exclusion',
146 'operator' => '===',
147 'value' => true,
148 ),
149 ),
150 ),
151 ),
152
153 array(
154 'id' => 'excluded_categories',
155 'type' => 'select_ajax',
156 'title' => esc_html__( 'Exclude Categories', 'merchant' ),
157 'source' => 'options',
158 'multiple' => true,
159 'options' => Merchant_Admin_Options::get_category_select2_choices(),
160 'placeholder' => esc_html__( 'Select categories', 'merchant' ),
161 'conditions' => array(
162 'relation' => 'AND',
163 'terms' => array(
164 array(
165 'field' => 'exclusion',
166 'operator' => '===',
167 'value' => true,
168 ),
169 ),
170 ),
171 ),
172 ),
173 ) );
174
175 // Add To Wishlist Button Settings
176 Merchant_Admin_Options::create( array(
177 'title' => esc_html__( 'Add To Wishlist Button Settings', 'merchant' ),
178 'module' => 'wishlist',
179 'fields' => array(
180
181 // Button icon.
182 array(
183 'id' => 'button_icon',
184 'type' => 'choices',
185 'title' => esc_html__( 'Select an icon', 'merchant' ),
186 'options' => array(
187 'heart1' => MERCHANT_URI . 'inc/modules/wishlist/admin/icons/heart1.svg',
188 'heart2' => MERCHANT_URI . 'inc/modules/wishlist/admin/icons/heart2.svg',
189 ),
190 'default' => 'heart1',
191 ),
192
193 // Button position top.
194 array(
195 'id' => 'button_position_top',
196 'type' => 'range',
197 'title' => esc_html__( 'Button vertical position', 'merchant' ),
198 'min' => 1,
199 'max' => 80,
200 'step' => 1,
201 'default' => 20,
202 'unit' => 'px',
203 ),
204
205 // Button position left.
206 array(
207 'id' => 'button_position_left',
208 'type' => 'range',
209 'title' => esc_html__( 'Button horizontal position', 'merchant' ),
210 'min' => 1,
211 'max' => 80,
212 'step' => 1,
213 'default' => 20,
214 'unit' => 'px',
215 ),
216
217 // Tooltip.
218 array(
219 'id' => 'tooltip',
220 'type' => 'switcher',
221 'title' => esc_html__( 'Display tooltip', 'merchant' ),
222 'default' => 1,
223 ),
224
225 // Tooltip text.
226 array(
227 'id' => 'tooltip_text',
228 'type' => 'text',
229 'title' => esc_html__( 'Tooltip text', 'merchant' ),
230 'default' => esc_html__( 'Add to wishlist', 'merchant' ),
231 'condition' => array( 'tooltip', '==', '1' ),
232 ),
233 array(
234 'id' => 'tooltip_text_after',
235 'type' => 'text',
236 'title' => esc_html__( 'Tooltip text after adding to wishlist', 'merchant' ),
237 'default' => esc_html__( 'Added to wishlist', 'merchant' ),
238 'condition' => array( 'tooltip', '==', '1' ),
239 ),
240
241 // Tooltip border radius.
242 array(
243 'id' => 'tooltip_border_radius',
244 'type' => 'range',
245 'title' => esc_html__( 'Tooltip border radius', 'merchant' ),
246 'min' => 0,
247 'max' => 35,
248 'step' => 1,
249 'default' => 4,
250 'unit' => 'px',
251 'condition' => array( 'tooltip', '==', '1' ),
252 ),
253
254 // Colors.
255
256 // Icon stroke color.
257 array(
258 'id' => 'icon_stroke_color',
259 'type' => 'color',
260 'title' => esc_html__( 'Icon stroke color', 'merchant' ),
261 'default' => '#212121',
262 ),
263
264 // Icon stroke color (hover).
265 array(
266 'id' => 'icon_stroke_color_hover',
267 'type' => 'color',
268 'title' => esc_html__( 'Icon stroke color (hover)', 'merchant' ),
269 'default' => '#212121',
270 ),
271
272 // Icon fill color.
273 array(
274 'id' => 'icon_fill_color',
275 'type' => 'color',
276 'title' => esc_html__( 'Icon fill color', 'merchant' ),
277 'default' => 'transparent',
278 ),
279
280 // Icon fill color (hover).
281 array(
282 'id' => 'icon_fill_color_hover',
283 'type' => 'color',
284 'title' => esc_html__( 'Icon fill color (hover)', 'merchant' ),
285 'default' => '#f04c4c',
286 ),
287
288 // Tooltip text color.
289 array(
290 'id' => 'tooltip_text_color',
291 'type' => 'color',
292 'title' => esc_html__( 'Tooltip text color', 'merchant' ),
293 'default' => '#FFF',
294 ),
295
296 // Tooltip background color.
297 array(
298 'id' => 'tooltip_background_color',
299 'type' => 'color',
300 'title' => esc_html__( 'Tooltip background color', 'merchant' ),
301 'default' => '#212121',
302 ),
303
304 ),
305 ) );
306
307 // Wishlist Page Settings
308 Merchant_Admin_Options::create( array(
309 'module' => 'wishlist',
310 'title' => esc_html__( 'Wishlist Page Settings', 'merchant' ),
311 'fields' => array(
312
313 // Create Wishlist Page.
314 array(
315 'id' => 'create_page',
316 'type' => 'create_page',
317 'title' => esc_html__( 'Wishlist page', 'merchant' ),
318 'page_title' => esc_html__( 'My Wishlist', 'merchant' ),
319 'page_meta_key' => '_wp_page_template',
320 'page_meta_value' => 'modules/wishlist/page-template-wishlist.php',
321 'option_name' => 'merchant_wishlist_page_id',
322 ),
323
324 // Hide page title.
325 array(
326 'id' => 'hide_page_title',
327 'type' => 'switcher',
328 'title' => esc_html__( 'Hide page title', 'merchant' ),
329 'default' => 0,
330 ),
331
332 // Table heading background color.
333 array(
334 'id' => 'table_heading_background_color',
335 'type' => 'color',
336 'title' => esc_html__( 'Table heading background color', 'merchant' ),
337 'default' => '#FFF',
338 ),
339
340 // Table body background color.
341 array(
342 'id' => 'table_body_background_color',
343 'type' => 'color',
344 'title' => esc_html__( 'Table body background color', 'merchant' ),
345 'default' => '#fdfdfd',
346 ),
347
348 // Table text color.
349 array(
350 'id' => 'table_text_color',
351 'type' => 'color',
352 'title' => esc_html__( 'Table text color', 'merchant' ),
353 'default' => '#777',
354 ),
355
356 // Table links color.
357 array(
358 'id' => 'table_links_color',
359 'type' => 'color',
360 'title' => esc_html__( 'Table links color', 'merchant' ),
361 'default' => '#212121',
362 ),
363
364 // Table links color (hover).
365 array(
366 'id' => 'table_links_color_hover',
367 'type' => 'color',
368 'title' => esc_html__( 'Table links color (hover)', 'merchant' ),
369 'default' => '#757575',
370 ),
371
372 // Buttons color.
373 array(
374 'id' => 'buttons_color',
375 'type' => 'color',
376 'title' => esc_html__( 'Buttons color', 'merchant' ),
377 'default' => '#FFF',
378 ),
379
380 // Buttons color (hover).
381 array(
382 'id' => 'buttons_color_hover',
383 'type' => 'color',
384 'title' => esc_html__( 'Buttons color (hover)', 'merchant' ),
385 'default' => '#FFF',
386 ),
387
388 // Buttons background color.
389 array(
390 'id' => 'buttons_background_color',
391 'type' => 'color',
392 'title' => esc_html__( 'Buttons background color', 'merchant' ),
393 'default' => '#212121',
394 ),
395
396 // Buttons color (hover).
397 array(
398 'id' => 'buttons_background_color_hover',
399 'type' => 'color',
400 'title' => esc_html__( 'Buttons background color (hover)', 'merchant' ),
401 'default' => '#757575',
402 ),
403
404 ),
405 ) );
406
407 // Wishlist Sharing Settings
408 Merchant_Admin_Options::create( array(
409 'module' => Merchant_Wishlist::MODULE_ID,
410 'title' => esc_html__( 'Wishlist Sharing Settings', 'merchant' ),
411 'fields' => array(
412
413 // Enable.
414 array(
415 'id' => 'enable_sharing',
416 'type' => 'switcher',
417 'title' => esc_html__( 'Enable', 'merchant' ),
418 'desc' => esc_html__( 'Allow users to share the wishlist.', 'merchant' ),
419 'default' => 1,
420 ),
421
422 // Sharing Links.
423 array(
424 'id' => 'sharing_links',
425 'type' => 'flexible_content',
426 'sorting' => true,
427 'title' => esc_html__( 'Social links', 'merchant' ),
428 'desc' => esc_html__( 'Add the available social links to share the wishlist.', 'merchant' ),
429 'button_label' => esc_html__( 'Add new', 'merchant' ),
430 'layouts' => array(
431 'social' => array(
432 'title' => esc_html__( 'Social link', 'merchant' ),
433 'fields' => array(
434 array(
435 'id' => 'social_network',
436 'title' => esc_html__( 'Social Network', 'merchant' ),
437 'type' => 'select',
438 'options' => array(
439 'facebook' => esc_html__( 'Facebook', 'merchant' ),
440 'twitter' => esc_html__( 'Twitter', 'merchant' ),
441 'linkedin' => esc_html__( 'Linkedin', 'merchant' ),
442 'pinterest' => esc_html__( 'Pinterest', 'merchant' ),
443 'whatsapp' => esc_html__( 'Whatsapp', 'merchant' ),
444 'telegram' => esc_html__( 'Telegram', 'merchant' ),
445 'vk' => esc_html__( 'VK', 'merchant' ),
446 'weibo' => esc_html__( 'Weibo', 'merchant' ),
447 'reddit' => esc_html__( 'Reddit', 'merchant' ),
448 'ok' => esc_html__( 'Ok', 'merchant' ),
449 'xing' => esc_html__( 'Xing', 'merchant' ),
450 'mail' => esc_html__( 'Mail', 'merchant' ),
451 ),
452 'default' => 'facebook',
453 ),
454 ),
455 ),
456 ),
457 'default' => array(
458 array(
459 'layout' => 'social',
460 'social_network' => 'facebook',
461 ),
462 array(
463 'layout' => 'social',
464 'social_network' => 'twitter',
465 ),
466 array(
467 'layout' => 'social',
468 'social_network' => 'linkedin',
469 ),
470 ),
471 ),
472
473 // Dislay Copy To Clipboard.
474 array(
475 'id' => 'display_copy_to_clipboard',
476 'type' => 'switcher',
477 'title' => esc_html__( 'Display copy to clipboard', 'merchant' ),
478 'desc' => esc_html__( 'Displays a copy to clipboard field after the social links.', 'merchant' ),
479 'default' => 1,
480 ),
481 ),
482 ) );
483
484 // Shortcode
485 $merchant_module_id = Merchant_Wishlist::MODULE_ID;
486 Merchant_Admin_Options::create( array(
487 'module' => $merchant_module_id,
488 'title' => esc_html__( 'Use shortcode', 'merchant' ),
489 'fields' => array(
490 array(
491 'id' => 'use_shortcode',
492 'type' => 'switcher',
493 'title' => esc_html__( 'Use shortcode', 'merchant' ),
494 'default' => 0,
495 ),
496 array(
497 'type' => 'info',
498 'id' => 'shortcode_info',
499 '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.', 'merchant' ),
500 ),
501 array(
502 'id' => 'shortcode_text',
503 'type' => 'text_readonly',
504 'title' => esc_html__( 'Shortcode text', 'merchant' ),
505 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
506 'condition' => array( 'use_shortcode', '==', '1' ),
507 ),
508 ),
509 ) );
510