PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.8.3
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.8.3
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 1.8.3, at inc/modules/cart-reserved-timer/admin/options.php

121 lines 3.9 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 $before_fields = array();
14 if ( defined( 'MERCHANT_PRO_VERSION' ) && merchant_is_cart_block_layout() ) {
15 $before_fields = array(
16 'type' => 'warning',
17 'content' => sprintf(
18 /* Translators: 1. docs link */
19 __( 'Your cart page is being rendered through the new WooCommerce cart block. You must edit the cart page to use the classic cart shortcode instead. Check <a href="%1$s" target="_blank">this documentation</a> to learn more.', 'merchant' ),
20 'https://docs.athemes.com/article/how-to-switch-cart-checkout-blocks-to-the-classic-shortcodes/'
21 ),
22 );
23 }
24
25 // Variables
26 $icon_path = MERCHANT_URI . 'assets/images/icons/' . Merchant_Cart_Reserved_timer::MODULE_ID;
27
28 // Settings
29 Merchant_Admin_Options::create( array(
30 'title' => esc_html__( 'Settings', 'merchant' ),
31 'module' => Merchant_Cart_Reserved_timer::MODULE_ID,
32 'fields' => array(
33
34 $before_fields,
35
36 array(
37 'id' => 'duration',
38 'type' => 'number',
39 'title' => esc_html__( 'Count down duration minutes', 'merchant' ),
40 'default' => 10,
41 ),
42
43 array(
44 'id' => 'reserved_message',
45 'type' => 'text',
46 'title' => esc_html__( 'Cart reserved message', 'merchant' ),
47 'default' => esc_html__( 'An item in your cart is in high demand.', 'merchant' ),
48 ),
49
50 array(
51 'id' => 'timer_message_minutes',
52 'type' => 'text',
53 'title' => esc_html__( 'Timer message for > 1 min ', 'merchant' ),
54 'default' => esc_html__( 'Your cart is saved for {timer} minutes!', 'merchant' ),
55 ),
56
57 array(
58 'id' => 'timer_message_seconds',
59 'type' => 'text',
60 'title' => esc_html__( 'Timer message for < 1 min', 'merchant' ),
61 'default' => esc_html__( 'Your cart is saved for {timer} seconds!', 'merchant' ),
62 ),
63
64 array(
65 'id' => 'time_expires',
66 'type' => 'radio',
67 'title' => esc_html__( 'What to do after the timer expires?', 'merchant' ),
68 'options' => array(
69 'hide-timer' => esc_html__( 'Hide timer', 'merchant' ),
70 'clear-cart' => esc_html__( 'Clear cart', 'merchant' ),
71 ),
72 'default' => 'clear-cart',
73 ),
74
75 array(
76 'id' => 'icon',
77 'type' => 'choices',
78 'title' => esc_html__( 'Choose an icon', 'merchant' ),
79 'class' => 'merchant-module-page-setting-field-choices-icon',
80 'options' => array(
81 'none' => $icon_path . '/cancel.svg',
82 'fire' => $icon_path . '/fire.svg',
83 'clock' => $icon_path . '/clock.svg',
84 'hour-glass' => $icon_path . '/hour-glass.svg',
85 ),
86 'default' => 'fire',
87 ),
88
89 array(
90 'id' => 'background_color',
91 'type' => 'color',
92 'title' => esc_html__( 'Choose background Color', 'merchant' ),
93 'default' => '#f4f6f8',
94 ),
95
96 ),
97 ) );
98
99 // Shortcode
100 $merchant_module_id = Merchant_Cart_Reserved_timer::MODULE_ID;
101 Merchant_Admin_Options::create( array(
102 'module' => $merchant_module_id,
103 'title' => esc_html__( 'Use shortcode', 'merchant' ),
104 'fields' => array(
105 array(
106 'id' => 'use_shortcode',
107 'type' => 'switcher',
108 'title' => __( 'Use shortcode', 'merchant' ),
109 'default' => 0,
110 'desc' => 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.',
111 'merchant' ),
112 ),
113 array(
114 'id' => 'shortcode_text',
115 'type' => 'text_readonly',
116 'title' => esc_html__( 'Shortcode text', 'merchant' ),
117 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
118 'condition' => array( 'use_shortcode', '==', '1' ),
119 ),
120 ),
121 ) );