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 / quick-view / 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/quick-view/admin/options.php

549 lines 15.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Quick View
4 *
5 * @package Merchant
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly
10 }
11
12 /**
13 * Settings.
14 *
15 */
16
17 return array(
18 array(
19 'title' => esc_html__( 'Settings', 'merchant' ),
20 'module' => 'quick-view',
21 'fields' => array(
22
23 array(
24 'id' => 'button_type',
25 'type' => 'select',
26 'title' => esc_html__( 'Button type', 'merchant' ),
27 'options' => array(
28 'text' => esc_html__( 'Text', 'merchant' ),
29 'icon' => esc_html__( 'Icon', 'merchant' ),
30 'icon-text' => esc_html__( 'Icon + text', 'merchant' ),
31 ),
32 'default' => 'text',
33 'ai_meta' => array(
34 'usage_hint' => 'Controls the quick view button appearance. Set to text, icon, or icon-text. This value gates button_text (text|icon-text) and button_icon (icon|icon-text) fields.',
35 ),
36 ),
37
38 array(
39 'id' => 'button_text',
40 'type' => 'text',
41 'title' => esc_html__( 'Button text', 'merchant' ),
42 'default' => esc_html__( 'Quick view', 'merchant' ),
43 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
44 ),
45
46 array(
47 'id' => 'button_icon',
48 'type' => 'choices',
49 'title' => esc_html__( 'Select an icon', 'merchant' ),
50 'options' => array(
51 'eye' => '%s/eye.svg',
52 'cart' => '%s/cart.svg',
53 ),
54 'default' => 'eye',
55 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
56 ),
57
58 array(
59 'id' => 'button_position',
60 'type' => 'select',
61 'title' => esc_html__( 'Button position', 'merchant' ),
62 'options' => array(
63 'before' => esc_html__( 'Before - Add to cart', 'merchant' ),
64 'after' => esc_html__( 'After - Add to cart', 'merchant' ),
65 'overlay' => esc_html__( 'Overlay', 'merchant' ),
66 ),
67 'default' => 'overlay',
68 'ai_meta' => array(
69 'usage_hint' => 'Where the quick view button appears on the product card. Set to overlay to float over the image (enables position-top/left controls and mobile_position). Before/after place it relative to the add-to-cart button.',
70 ),
71 ),
72
73 array(
74 'id' => 'button-position-top',
75 'type' => 'range',
76 'title' => esc_html__( 'Button position top', 'merchant' ),
77 'min' => 0,
78 'max' => 100,
79 'step' => 1,
80 'default' => 50,
81 'unit' => '%',
82 'condition' => array( 'button_position', '==', 'overlay' ),
83 ),
84
85 array(
86 'id' => 'button-position-left',
87 'type' => 'range',
88 'title' => esc_html__( 'Button position left', 'merchant' ),
89 'min' => 0,
90 'max' => 100,
91 'step' => 1,
92 'default' => 50,
93 'unit' => '%',
94 'condition' => array( 'button_position', '==', 'overlay' ),
95 ),
96
97 array(
98 'id' => 'mobile_position',
99 'type' => 'checkbox',
100 'label' => esc_html__( 'Mobile position', 'merchant' ),
101 'default' => 0,
102 'condition' => array( 'button_position', '==', 'overlay' ),
103 'ai_meta' => array(
104 'toggle_for' => 'button-position-top-mobile',
105 'usage_hint' => 'Enable to set a separate overlay position for mobile. Gates button-position-top-mobile and button-position-left-mobile. Only available when button_position=overlay.',
106 ),
107 ),
108
109 array(
110 'id' => 'button-position-top-mobile',
111 'type' => 'range',
112 'title' => esc_html__( 'Button position top', 'merchant' ),
113 'min' => 0,
114 'max' => 100,
115 'step' => 1,
116 'default' => 50,
117 'unit' => '%',
118 'conditions' => array(
119 'relation' => 'AND',
120 'terms' => array(
121 array(
122 'field' => 'button_position',
123 'operator' => '===',
124 'value' => 'overlay',
125 ),
126 array(
127 'field' => 'mobile_position',
128 'operator' => '===',
129 'value' => true,
130 ),
131 ),
132 ),
133 ),
134
135 array(
136 'id' => 'button-position-left-mobile',
137 'type' => 'range',
138 'title' => esc_html__( 'Button position left', 'merchant' ),
139 'min' => 0,
140 'max' => 100,
141 'step' => 1,
142 'default' => 50,
143 'unit' => '%',
144 'conditions' => array(
145 'relation' => 'AND',
146 'terms' => array(
147 array(
148 'field' => 'button_position',
149 'operator' => '===',
150 'value' => 'overlay',
151 ),
152 array(
153 'field' => 'mobile_position',
154 'operator' => '===',
155 'value' => true,
156 ),
157 ),
158 ),
159 ),
160
161 array(
162 'id' => 'icon-color',
163 'type' => 'color',
164 'title' => esc_html__( 'Icon color', 'merchant' ),
165 'default' => '#ffffff',
166 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
167 ),
168
169 array(
170 'id' => 'icon-hover-color',
171 'type' => 'color',
172 'title' => esc_html__( 'Icon color hover', 'merchant' ),
173 'default' => '#ffffff',
174 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
175 ),
176
177 array(
178 'id' => 'text-color',
179 'type' => 'color',
180 'title' => esc_html__( 'Button text color', 'merchant' ),
181 'default' => '#ffffff',
182 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
183 ),
184
185 array(
186 'id' => 'text-hover-color',
187 'type' => 'color',
188 'title' => esc_html__( 'Button text color hover', 'merchant' ),
189 'default' => '#ffffff',
190 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
191 ),
192
193 array(
194 'id' => 'border-color',
195 'type' => 'color',
196 'title' => esc_html__( 'Button border color', 'merchant' ),
197 'default' => '#212121',
198 ),
199
200 array(
201 'id' => 'border-hover-color',
202 'type' => 'color',
203 'title' => esc_html__( 'Button border color hover', 'merchant' ),
204 'default' => '#414141',
205 ),
206
207 array(
208 'id' => 'background-color',
209 'type' => 'color',
210 'title' => esc_html__( 'Button background color', 'merchant' ),
211 'default' => '#212121',
212 ),
213
214 array(
215 'id' => 'background-hover-color',
216 'type' => 'color',
217 'title' => esc_html__( 'Button background color hover', 'merchant' ),
218 'default' => '#414141',
219 ),
220
221 ),
222 ),
223 array(
224 'title' => esc_html__( 'Modal', 'merchant' ),
225 'module' => 'quick-view',
226 'fields' => array(
227 array(
228 'id' => 'modal_layout',
229 'type' => 'radio',
230 'title' => esc_html__( 'Modal layout', 'merchant' ),
231 'options' => array(
232 'modal' => esc_html__( 'Centered modal', 'merchant' ),
233 'side-panel' => esc_html__( 'Side panel', 'merchant' ),
234 ),
235 'default' => 'modal',
236 ),
237
238 array(
239 'id' => 'show_navigation_arrows',
240 'type' => 'switcher',
241 'title' => esc_html__( 'Show next/previous navigation arrows', 'merchant' ),
242 'default' => 0,
243 ),
244
245 array(
246 'id' => 'sync_url_hash',
247 'type' => 'switcher',
248 'title' => esc_html__( 'Update browser URL when quick view opens', 'merchant' ),
249 'default' => 0,
250 ),
251
252 array(
253 'id' => 'modal_width',
254 'type' => 'range',
255 'title' => esc_html__( 'Modal width', 'merchant' ),
256 'desc' => esc_html__( 'Default: 1000 pixels', 'merchant' ),
257 'min' => 1,
258 'max' => 2000,
259 'step' => 1,
260 'default' => 1000,
261 'unit' => 'px',
262 'conditions' => array(
263 'terms' => array(
264 array(
265 'field' => 'modal_layout',
266 'operator' => '===',
267 'value' => 'modal',
268 ),
269 ),
270 ),
271 ),
272
273 array(
274 'id' => 'modal_height',
275 'type' => 'range',
276 'title' => esc_html__( 'Modal height', 'merchant' ),
277 'min' => 1,
278 'max' => 2000,
279 'step' => 1,
280 'default' => 500,
281 'unit' => 'px',
282 'conditions' => array(
283 'terms' => array(
284 array(
285 'field' => 'modal_layout',
286 'operator' => '===',
287 'value' => 'modal',
288 ),
289 ),
290 ),
291 ),
292
293 array(
294 'id' => 'side_panel_width',
295 'type' => 'range',
296 'title' => esc_html__( 'Side panel width', 'merchant' ),
297 'desc' => esc_html__( 'Default: 420 pixels', 'merchant' ),
298 'min' => 280,
299 'max' => 800,
300 'step' => 1,
301 'default' => 420,
302 'unit' => 'px',
303 'conditions' => array(
304 'terms' => array(
305 array(
306 'field' => 'modal_layout',
307 'operator' => '===',
308 'value' => 'side-panel',
309 ),
310 ),
311 ),
312 ),
313
314 array(
315 'id' => 'place_product_image',
316 'type' => 'radio',
317 'title' => esc_html__( 'Product gallery image placement', 'merchant' ),
318 'options' => array(
319 'thumbs-at-left' => esc_html__( 'Thumbs at left', 'merchant' ),
320 'thumbs-at-right' => esc_html__( 'Thumbs at right', 'merchant' ),
321 'thumbs-at-bottom' => esc_html__( 'Thumbs at bottom', 'merchant' ),
322 ),
323 'default' => 'thumbs-at-left',
324 ),
325
326 array(
327 'id' => 'zoom_effect',
328 'type' => 'switcher',
329 'title' => esc_html__( 'Zoom effect on image', 'merchant' ),
330 'default' => 1,
331 ),
332
333 array(
334 'id' => 'place_product_description',
335 'type' => 'radio',
336 'title' => esc_html__( 'Product description placement', 'merchant' ),
337 'options' => array(
338 'top' => esc_html__( 'Top', 'merchant' ),
339 'bottom' => esc_html__( 'Bottom', 'merchant' ),
340 ),
341 'default' => 'top',
342 ),
343
344 array(
345 'id' => 'description_style',
346 'type' => 'radio',
347 'title' => esc_html__( 'Description style', 'merchant' ),
348 'options' => array(
349 'full' => esc_html__( 'Full description', 'merchant' ),
350 'short' => esc_html__( 'Short description', 'merchant' ),
351 ),
352 'default' => 'full',
353 ),
354
355 array(
356 'id' => 'show_quantity',
357 'type' => 'switcher',
358 'title' => esc_html__( 'Show quantity selector', 'merchant' ),
359 'default' => 1,
360 ),
361
362 array(
363 'id' => 'show_buy_now_button',
364 'type' => 'switcher',
365 'title' => esc_html__( 'Show buy now button', 'merchant' ),
366 'default' => 0,
367 ),
368
369 array(
370 'id' => 'show_buy_now_button_instructions',
371 'type' => 'info_block',
372 'description' => esc_html__( 'You can display a Buy Now button by using Merchant’s Buy Now module.', 'merchant' ),
373 'button_text' => esc_html__( 'View Buy Now', 'merchant' ),
374 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=buy-now' ) ),
375 'condition' => array( 'show_buy_now_button', '==', '1' ),
376 ),
377 array(
378 'id' => 'ajax_add_to_cart',
379 'type' => 'switcher',
380 'title' => esc_html__( 'Ajax add to cart', 'merchant' ),
381 'default' => 0,
382 ),
383 array(
384 'id' => 'show_suggested_products',
385 'pro' => true, // Merchant Pro dependent
386 'type' => 'switcher',
387 'title' => esc_html__( 'Show suggested products', 'merchant' ),
388 'default' => 1,
389 'ai_meta' => array(
390 'toggle_for' => 'suggested_products_module',
391 'usage_hint' => 'Enable to display upsell/cross-sell products inside the quick view modal. Gates suggested_products_module and suggested_products_placement fields. Requires Merchant Pro.',
392 ),
393 ),
394 array(
395 'id' => 'suggested_products_module',
396 'pro' => true,
397 'type' => 'select',
398 'options' => array(
399 'bulk_discounts' => esc_html__( 'Bulk Discounts', 'merchant' ),
400 'buy_x_get_y' => esc_html__( 'Buy X Get Y', 'merchant' ),
401 'frequently_bought_together' => esc_html__( 'Frequently Bought Together', 'merchant' ),
402 ),
403 'default' => 'bulk_discounts',
404 'conditions' => array(
405 'terms' => array(
406 array(
407 'field' => 'show_suggested_products',
408 'operator' => '===',
409 'value' => true,
410 ),
411 ),
412 ),
413 'ai_meta' => array(
414 'toggled_by' => 'show_suggested_products',
415 'usage_hint' => 'Which Merchant module provides the suggested products shown inside quick view. Requires show_suggested_products=true and the chosen module to be active.',
416 ),
417 ),
418 array(
419 'id' => 'suggested_products_instructions_bulk_discounts',
420 'pro' => true,
421 'type' => 'info_block',
422 'description' => esc_html__( 'You can display suggested products by enabling certain modules (Bulk Discounts, Buy X Get Y or Frequently Bought Together) from Merchant.', 'merchant' ),
423 'button_text' => esc_html__( 'View Bulk Discounts', 'merchant' ),
424 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=volume-discounts' ) ),
425 'conditions' => array(
426 'relation' => 'AND',
427 'terms' => array(
428 array(
429 'field' => 'show_suggested_products',
430 'operator' => '===',
431 'value' => true,
432 ),
433 array(
434 'field' => 'suggested_products_module',
435 'operator' => '===',
436 'value' => 'bulk_discounts',
437 ),
438 ),
439 ),
440 ),
441 array(
442 'id' => 'suggested_products_instructions_frequently_bought_together',
443 'pro' => true,
444 'type' => 'info_block',
445 'description' => esc_html__( 'You can display suggested products by enabling certain modules (Bulk Discounts, Buy X Get Y or Frequently Bought Together) from Merchant.', 'merchant' ),
446 'button_text' => esc_html__( 'View Frequently Bought Together', 'merchant' ),
447 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=frequently-bought-together' ) ),
448 'conditions' => array(
449 'relation' => 'AND',
450 'terms' => array(
451 array(
452 'field' => 'show_suggested_products',
453 'operator' => '===',
454 'value' => true,
455 ),
456 array(
457 'field' => 'suggested_products_module',
458 'operator' => '===',
459 'value' => 'frequently_bought_together',
460 ),
461 ),
462 ),
463 ),
464 array(
465 'id' => 'suggested_products_instructions_buy_x_get_y',
466 'pro' => true,
467 'type' => 'info_block',
468 'description' => esc_html__( 'You can display suggested products by enabling certain modules (Bulk Discounts, Buy X Get Y or Frequently Bought Together) from Merchant.', 'merchant' ),
469 'button_text' => esc_html__( 'View Buy X Get Y', 'merchant' ),
470 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=buy-x-get-y' ) ),
471 'conditions' => array(
472 'relation' => 'AND',
473 'terms' => array(
474 array(
475 'field' => 'show_suggested_products',
476 'operator' => '===',
477 'value' => true,
478 ),
479 array(
480 'field' => 'suggested_products_module',
481 'operator' => '===',
482 'value' => 'buy_x_get_y',
483 ),
484 ),
485 ),
486 ),
487 array(
488 'id' => 'suggested_products_placement',
489 'pro' => true,
490 'type' => 'radio',
491 'title' => esc_html__( 'Suggested products placement', 'merchant' ),
492 'options' => array(
493 'before_add_to_cart' => esc_html__( 'Before Add to Cart', 'merchant' ),
494 'after_add_to_cart' => esc_html__( 'After Add to Cart', 'merchant' ),
495 ),
496 'default' => 'after_add_to_cart',
497 'conditions' => array(
498 'terms' => array(
499 array(
500 'field' => 'show_suggested_products',
501 'operator' => '===',
502 'value' => true,
503 ),
504 ),
505 ),
506 ),
507
508 array(
509 'id' => 'sale-price-color',
510 'type' => 'color',
511 'title' => esc_html__( 'Sale price color', 'merchant' ),
512 'default' => '#212121',
513 ),
514
515 array(
516 'id' => 'regular-price-color',
517 'type' => 'color',
518 'title' => esc_html__( 'Regular price color', 'merchant' ),
519 'default' => '#999999',
520 ),
521
522 ),
523 ),
524 array(
525 'module' => Merchant_Quick_View::MODULE_ID,
526 'title' => esc_html__( 'Use shortcode', 'merchant' ),
527 'fields' => array(
528 array(
529 'id' => 'use_shortcode',
530 'type' => 'switcher',
531 'title' => esc_html__( 'Use shortcode', 'merchant' ),
532 'default' => 0,
533 ),
534 array(
535 'type' => 'info',
536 'id' => 'shortcode_info',
537 '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.', 'merchant' ),
538 ),
539 array(
540 'id' => 'shortcode_text',
541 'type' => 'text_readonly',
542 'title' => esc_html__( 'Shortcode text', 'merchant' ),
543 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Quick_View::MODULE_ID ) . ']',
544 'condition' => array( 'use_shortcode', '==', '1' ),
545 ),
546 ),
547 ),
548 );
549