PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.11.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.11.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 1.9.12 All 59 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 1.11.2, at inc/modules/quick-view/admin/options.php

466 lines 12.9 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 Merchant_Admin_Options::create( array(
17 'title' => esc_html__( 'Settings', 'merchant' ),
18 'module' => 'quick-view',
19 'fields' => array(
20
21 array(
22 'id' => 'button_type',
23 'type' => 'select',
24 'title' => esc_html__( 'Button type', 'merchant' ),
25 'options' => array(
26 'text' => esc_html__( 'Text', 'merchant' ),
27 'icon' => esc_html__( 'Icon', 'merchant' ),
28 'icon-text' => esc_html__( 'Icon + text', 'merchant' ),
29 ),
30 'default' => 'text',
31 ),
32
33 array(
34 'id' => 'button_text',
35 'type' => 'text',
36 'title' => esc_html__( 'Button text', 'merchant' ),
37 'default' => esc_html__( 'Quick view', 'merchant' ),
38 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
39 ),
40
41 array(
42 'id' => 'button_icon',
43 'type' => 'choices',
44 'title' => esc_html__( 'Select an icon', 'merchant' ),
45 'options' => array(
46 'eye' => '%s/eye.svg',
47 'cart' => '%s/cart.svg',
48 ),
49 'default' => 'eye',
50 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
51 ),
52
53 array(
54 'id' => 'button_position',
55 'type' => 'select',
56 'title' => esc_html__( 'Button position', 'merchant' ),
57 'options' => array(
58 'before' => esc_html__( 'Before - Add to cart', 'merchant' ),
59 'after' => esc_html__( 'After - Add to cart', 'merchant' ),
60 'overlay' => esc_html__( 'Overlay', 'merchant' ),
61 ),
62 'default' => 'overlay',
63 ),
64
65 array(
66 'id' => 'button-position-top',
67 'type' => 'range',
68 'title' => esc_html__( 'Button position top', 'merchant' ),
69 'min' => 0,
70 'max' => 100,
71 'step' => 1,
72 'default' => 50,
73 'unit' => '%',
74 'condition' => array( 'button_position', '==', 'overlay' ),
75 ),
76
77 array(
78 'id' => 'button-position-left',
79 'type' => 'range',
80 'title' => esc_html__( 'Button position left', 'merchant' ),
81 'min' => 0,
82 'max' => 100,
83 'step' => 1,
84 'default' => 50,
85 'unit' => '%',
86 'condition' => array( 'button_position', '==', 'overlay' ),
87 ),
88
89 array(
90 'id' => 'mobile_position',
91 'type' => 'checkbox',
92 'label' => esc_html__( 'Mobile position', 'merchant' ),
93 'default' => 0,
94 'condition' => array( 'button_position', '==', 'overlay' ),
95 ),
96
97 array(
98 'id' => 'button-position-top-mobile',
99 'type' => 'range',
100 'title' => esc_html__( 'Button position top', 'merchant' ),
101 'min' => 0,
102 'max' => 100,
103 'step' => 1,
104 'default' => 50,
105 'unit' => '%',
106 'conditions' => array(
107 'relation' => 'AND',
108 'terms' => array(
109 array(
110 'field' => 'button_position',
111 'operator' => '===',
112 'value' => 'overlay',
113 ),
114 array(
115 'field' => 'mobile_position',
116 'operator' => '===',
117 'value' => true,
118 ),
119 ),
120 ),
121 ),
122
123 array(
124 'id' => 'button-position-left-mobile',
125 'type' => 'range',
126 'title' => esc_html__( 'Button position left', 'merchant' ),
127 'min' => 0,
128 'max' => 100,
129 'step' => 1,
130 'default' => 50,
131 'unit' => '%',
132 'conditions' => array(
133 'relation' => 'AND',
134 'terms' => array(
135 array(
136 'field' => 'button_position',
137 'operator' => '===',
138 'value' => 'overlay',
139 ),
140 array(
141 'field' => 'mobile_position',
142 'operator' => '===',
143 'value' => true,
144 ),
145 ),
146 ),
147 ),
148
149 array(
150 'id' => 'icon-color',
151 'type' => 'color',
152 'title' => esc_html__( 'Icon color', 'merchant' ),
153 'default' => '#ffffff',
154 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
155 ),
156
157 array(
158 'id' => 'icon-hover-color',
159 'type' => 'color',
160 'title' => esc_html__( 'Icon color hover', 'merchant' ),
161 'default' => '#ffffff',
162 'condition' => array( 'button_type', 'any', 'icon|icon-text' ),
163 ),
164
165 array(
166 'id' => 'text-color',
167 'type' => 'color',
168 'title' => esc_html__( 'Button text color', 'merchant' ),
169 'default' => '#ffffff',
170 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
171 ),
172
173 array(
174 'id' => 'text-hover-color',
175 'type' => 'color',
176 'title' => esc_html__( 'Button text color hover', 'merchant' ),
177 'default' => '#ffffff',
178 'condition' => array( 'button_type', 'any', 'text|icon-text' ),
179 ),
180
181 array(
182 'id' => 'border-color',
183 'type' => 'color',
184 'title' => esc_html__( 'Button border color', 'merchant' ),
185 'default' => '#212121',
186 ),
187
188 array(
189 'id' => 'border-hover-color',
190 'type' => 'color',
191 'title' => esc_html__( 'Button border color hover', 'merchant' ),
192 'default' => '#414141',
193 ),
194
195 array(
196 'id' => 'background-color',
197 'type' => 'color',
198 'title' => esc_html__( 'Button background color', 'merchant' ),
199 'default' => '#212121',
200 ),
201
202 array(
203 'id' => 'background-hover-color',
204 'type' => 'color',
205 'title' => esc_html__( 'Button background color hover', 'merchant' ),
206 'default' => '#414141',
207 ),
208
209 ),
210 ) );
211
212
213 /**
214 * Modal.
215 *
216 */
217 Merchant_Admin_Options::create( array(
218 'title' => esc_html__( 'Modal', 'merchant' ),
219 'module' => 'quick-view',
220 'fields' => array(
221 array(
222 'id' => 'modal_width',
223 'type' => 'range',
224 'title' => esc_html__( 'Modal width', 'merchant' ),
225 'min' => 1,
226 'max' => 2000,
227 'step' => 1,
228 'default' => 1000,
229 'unit' => 'px',
230 ),
231
232 array(
233 'id' => 'modal_height',
234 'type' => 'range',
235 'title' => esc_html__( 'Modal height', 'merchant' ),
236 'min' => 1,
237 'max' => 2000,
238 'step' => 1,
239 'default' => 500,
240 'unit' => 'px',
241 ),
242
243 array(
244 'id' => 'place_product_image',
245 'type' => 'radio',
246 'title' => esc_html__( 'Product gallery image placement', 'merchant' ),
247 'options' => array(
248 'thumbs-at-left' => esc_html__( 'Thumbs at left', 'merchant' ),
249 'thumbs-at-right' => esc_html__( 'Thumbs at right', 'merchant' ),
250 'thumbs-at-bottom' => esc_html__( 'Thumbs at bottom', 'merchant' ),
251 ),
252 'default' => 'thumbs-at-left',
253 ),
254
255 array(
256 'id' => 'zoom_effect',
257 'type' => 'switcher',
258 'title' => esc_html__( 'Zoom effect on image', 'merchant' ),
259 'default' => 1,
260 ),
261
262 array(
263 'id' => 'place_product_description',
264 'type' => 'radio',
265 'title' => esc_html__( 'Product description placement', 'merchant' ),
266 'options' => array(
267 'top' => esc_html__( 'Top', 'merchant' ),
268 'bottom' => esc_html__( 'Bottom', 'merchant' ),
269 ),
270 'default' => 'top',
271 ),
272
273 array(
274 'id' => 'description_style',
275 'type' => 'radio',
276 'title' => esc_html__( 'Description style', 'merchant' ),
277 'options' => array(
278 'full' => esc_html__( 'Full description', 'merchant' ),
279 'short' => esc_html__( 'Short description', 'merchant' ),
280 ),
281 'default' => 'full',
282 ),
283
284 array(
285 'id' => 'show_quantity',
286 'type' => 'switcher',
287 'title' => esc_html__( 'Show quantity selector', 'merchant' ),
288 'default' => 1,
289 ),
290
291 array(
292 'id' => 'show_buy_now_button',
293 'type' => 'switcher',
294 'title' => esc_html__( 'Show buy now button', 'merchant' ),
295 'default' => 0,
296 ),
297
298 array(
299 'id' => 'show_buy_now_button_instructions',
300 'type' => 'info_block',
301 'description' => esc_html__( 'You can display a Buy Now button by using Merchant’s Buy Now module.', 'merchant' ),
302 'button_text' => esc_html__( 'View Buy Now', 'merchant' ),
303 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=buy-now' ) ),
304 'condition' => array( 'show_buy_now_button', '==', '1' ),
305 ),
306
307 array(
308 'id' => 'show_suggested_products',
309 'pro' => true, // Merchant Pro dependent
310 'type' => 'switcher',
311 'title' => esc_html__( 'Show suggested products', 'merchant' ),
312 'default' => 1,
313 ),
314 array(
315 'id' => 'suggested_products_module',
316 'pro' => true,
317 'type' => 'select',
318 'options' => array(
319 'bulk_discounts' => esc_html__( 'Bulk Discounts', 'merchant' ),
320 'buy_x_get_y' => esc_html__( 'Buy X Get Y', 'merchant' ),
321 'frequently_bought_together' => esc_html__( 'Frequently Bought Together', 'merchant' ),
322 ),
323 'default' => 'bulk_discounts',
324 'conditions' => array(
325 'terms' => array(
326 array(
327 'field' => 'show_suggested_products',
328 'operator' => '===',
329 'value' => true,
330 ),
331 ),
332 ),
333 ),
334 array(
335 'id' => 'suggested_products_instructions_bulk_discounts',
336 'pro' => true,
337 'type' => 'info_block',
338 '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' ),
339 'button_text' => esc_html__( 'View Bulk Discounts', 'merchant' ),
340 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=volume-discounts' ) ),
341 'conditions' => array(
342 'relation' => 'AND',
343 'terms' => array(
344 array(
345 'field' => 'show_suggested_products',
346 'operator' => '===',
347 'value' => true,
348 ),
349 array(
350 'field' => 'suggested_products_module',
351 'operator' => '===',
352 'value' => 'bulk_discounts',
353 ),
354 ),
355 ),
356 ),
357 array(
358 'id' => 'suggested_products_instructions_frequently_bought_together',
359 'pro' => true,
360 'type' => 'info_block',
361 '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' ),
362 'button_text' => esc_html__( 'View Frequently Bought Together', 'merchant' ),
363 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=frequently-bought-together' ) ),
364 'conditions' => array(
365 'relation' => 'AND',
366 'terms' => array(
367 array(
368 'field' => 'show_suggested_products',
369 'operator' => '===',
370 'value' => true,
371 ),
372 array(
373 'field' => 'suggested_products_module',
374 'operator' => '===',
375 'value' => 'frequently_bought_together',
376 ),
377 ),
378 ),
379 ),
380 array(
381 'id' => 'suggested_products_instructions_buy_x_get_y',
382 'pro' => true,
383 'type' => 'info_block',
384 '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' ),
385 'button_text' => esc_html__( 'View Buy X Get Y', 'merchant' ),
386 'button_link' => esc_url( admin_url( 'admin.php?page=merchant&module=buy-x-get-y' ) ),
387 'conditions' => array(
388 'relation' => 'AND',
389 'terms' => array(
390 array(
391 'field' => 'show_suggested_products',
392 'operator' => '===',
393 'value' => true,
394 ),
395 array(
396 'field' => 'suggested_products_module',
397 'operator' => '===',
398 'value' => 'buy_x_get_y',
399 ),
400 ),
401 ),
402 ),
403 array(
404 'id' => 'suggested_products_placement',
405 'pro' => true,
406 'type' => 'radio',
407 'title' => esc_html__( 'Suggested products placement', 'merchant' ),
408 'options' => array(
409 'before_add_to_cart' => esc_html__( 'Before Add to Cart', 'merchant' ),
410 'after_add_to_cart' => esc_html__( 'After Add to Cart', 'merchant' ),
411 ),
412 'default' => 'after_add_to_cart',
413 'conditions' => array(
414 'terms' => array(
415 array(
416 'field' => 'show_suggested_products',
417 'operator' => '===',
418 'value' => true,
419 ),
420 ),
421 ),
422 ),
423
424 array(
425 'id' => 'sale-price-color',
426 'type' => 'color',
427 'title' => esc_html__( 'Sale price color', 'merchant' ),
428 'default' => '#212121',
429 ),
430
431 array(
432 'id' => 'regular-price-color',
433 'type' => 'color',
434 'title' => esc_html__( 'Regular price color', 'merchant' ),
435 'default' => '#999999',
436 ),
437
438 ),
439 ) );
440
441 // Shortcode
442 $merchant_module_id = Merchant_Quick_View::MODULE_ID;
443 Merchant_Admin_Options::create( array(
444 'module' => $merchant_module_id,
445 'title' => esc_html__( 'Use shortcode', 'merchant' ),
446 'fields' => array(
447 array(
448 'id' => 'use_shortcode',
449 'type' => 'switcher',
450 'title' => esc_html__( 'Use shortcode', 'merchant' ),
451 'default' => 0,
452 ),
453 array(
454 'type' => 'info',
455 'id' => 'shortcode_info',
456 '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' ),
457 ),
458 array(
459 'id' => 'shortcode_text',
460 'type' => 'text_readonly',
461 'title' => esc_html__( 'Shortcode text', 'merchant' ),
462 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
463 'condition' => array( 'use_shortcode', '==', '1' ),
464 ),
465 ),
466 ) );