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 / cart-reserved-timer / 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/cart-reserved-timer/admin/options.php

109 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Cart Reserved Timer Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // Variables
14 $icon_path = MERCHANT_URI . 'assets/images/icons/' . Merchant_Cart_Reserved_timer::MODULE_ID;
15
16 // Settings
17 Merchant_Admin_Options::create( array(
18 'title' => esc_html__( 'Settings', 'merchant' ),
19 'module' => Merchant_Cart_Reserved_timer::MODULE_ID,
20 'fields' => array(
21 array(
22 'id' => 'duration',
23 'type' => 'number',
24 'title' => esc_html__( 'Count down duration minutes', 'merchant' ),
25 'default' => 10,
26 ),
27
28 array(
29 'id' => 'reserved_message',
30 'type' => 'text',
31 'title' => esc_html__( 'Cart reserved message', 'merchant' ),
32 'default' => esc_html__( 'An item in your cart is in high demand.', 'merchant' ),
33 ),
34
35 array(
36 'id' => 'timer_message_minutes',
37 'type' => 'text',
38 'title' => esc_html__( 'Timer message for > 1 min ', 'merchant' ),
39 'default' => esc_html__( 'Your cart is saved for {timer} minutes!', 'merchant' ),
40 ),
41
42 array(
43 'id' => 'timer_message_seconds',
44 'type' => 'text',
45 'title' => esc_html__( 'Timer message for < 1 min', 'merchant' ),
46 'default' => esc_html__( 'Your cart is saved for {timer} seconds!', 'merchant' ),
47 ),
48
49 array(
50 'id' => 'time_expires',
51 'type' => 'radio',
52 'title' => esc_html__( 'What to do after the timer expires?', 'merchant' ),
53 'options' => array(
54 'hide-timer' => esc_html__( 'Hide timer', 'merchant' ),
55 'clear-cart' => esc_html__( 'Clear cart', 'merchant' ),
56 ),
57 'default' => 'clear-cart',
58 ),
59
60 array(
61 'id' => 'icon',
62 'type' => 'choices',
63 'title' => esc_html__( 'Choose an icon', 'merchant' ),
64 'class' => 'merchant-module-page-setting-field-choices-icon',
65 'options' => array(
66 'none' => $icon_path . '/cancel.svg',
67 'fire' => $icon_path . '/fire.svg',
68 'clock' => $icon_path . '/clock.svg',
69 'hour-glass' => $icon_path . '/hour-glass.svg',
70 ),
71 'default' => 'fire',
72 ),
73
74 array(
75 'id' => 'background_color',
76 'type' => 'color',
77 'title' => esc_html__( 'Background Color', 'merchant' ),
78 'default' => '#f4f6f8',
79 ),
80
81 ),
82 ) );
83
84 // Shortcode
85 $merchant_module_id = Merchant_Cart_Reserved_timer::MODULE_ID;
86 Merchant_Admin_Options::create( array(
87 'module' => $merchant_module_id,
88 'title' => esc_html__( 'Use shortcode', 'merchant' ),
89 'fields' => array(
90 array(
91 'id' => 'use_shortcode',
92 'type' => 'switcher',
93 'title' => __( 'Use shortcode', 'merchant' ),
94 'default' => 0,
95 ),
96 array(
97 'type' => 'info',
98 'id' => 'shortcode_info',
99 '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' ),
100 ),
101 array(
102 'id' => 'shortcode_text',
103 'type' => 'text_readonly',
104 'title' => esc_html__( 'Shortcode text', 'merchant' ),
105 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
106 'condition' => array( 'use_shortcode', '==', '1' ),
107 ),
108 ),
109 ) );