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
← All changes | inc/modules/cart-reserved-timer/admin/options.php +115 -121 1.8 → 2.3.2 View file →
@@ -1,121 +1,115 @@
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 -) );
1 +<?php
2 +
3 +/**
4 + * Cart Reserved Timer — Option group definitions.
5 + *
6 + * Pure data file. Returns the option groups array
7 + * consumed by init_option_groups().
8 + *
9 + * @package Merchant
10 + */
11 +
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit; // Exit if accessed directly
14 +}
15 +
16 +// Variables
17 +$icon_path = MERCHANT_URI . 'assets/images/icons/' . Merchant_Cart_Reserved_timer::MODULE_ID;
18 +
19 +// Settings
20 +
21 +return array(
22 + array(
23 + 'title' => esc_html__( 'Settings', 'merchant' ),
24 + 'module' => Merchant_Cart_Reserved_timer::MODULE_ID,
25 + 'fields' => array(
26 + array(
27 + 'id' => 'duration',
28 + 'type' => 'number',
29 + 'title' => esc_html__( 'Count down duration minutes', 'merchant' ),
30 + 'default' => 10,
31 + ),
32 +
33 + array(
34 + 'id' => 'reserved_message',
35 + 'type' => 'text',
36 + 'title' => esc_html__( 'Cart reserved message', 'merchant' ),
37 + 'default' => esc_html__( 'An item in your cart is in high demand.', 'merchant' ),
38 + ),
39 +
40 + array(
41 + 'id' => 'timer_message_minutes',
42 + 'type' => 'text',
43 + 'title' => esc_html__( 'Timer message for > 1 min ', 'merchant' ),
44 + 'default' => esc_html__( 'Your cart is saved for {timer} minutes!', 'merchant' ),
45 + ),
46 +
47 + array(
48 + 'id' => 'timer_message_seconds',
49 + 'type' => 'text',
50 + 'title' => esc_html__( 'Timer message for < 1 min', 'merchant' ),
51 + 'default' => esc_html__( 'Your cart is saved for {timer} seconds!', 'merchant' ),
52 + ),
53 +
54 + array(
55 + 'id' => 'time_expires',
56 + 'type' => 'radio',
57 + 'title' => esc_html__( 'What to do after the timer expires?', 'merchant' ),
58 + 'options' => array(
59 + 'hide-timer' => esc_html__( 'Hide timer', 'merchant' ),
60 + 'clear-cart' => esc_html__( 'Clear cart', 'merchant' ),
61 + ),
62 + 'default' => 'clear-cart',
63 + 'ai_meta' => array(
64 + 'usage_hint' => 'clear-cart removes all items from the cart on expiry — destructive. Use hide-timer to just hide the countdown without affecting cart contents.',
65 + ),
66 + ),
67 +
68 + array(
69 + 'id' => 'icon',
70 + 'type' => 'choices',
71 + 'title' => esc_html__( 'Choose an icon', 'merchant' ),
72 + 'class' => 'merchant-module-page-setting-field-choices-icon',
73 + 'options' => array(
74 + 'none' => $icon_path . '/cancel.svg',
75 + 'fire' => $icon_path . '/fire.svg',
76 + 'clock' => $icon_path . '/clock.svg',
77 + 'hour-glass' => $icon_path . '/hour-glass.svg',
78 + ),
79 + 'default' => 'fire',
80 + ),
81 +
82 + array(
83 + 'id' => 'background_color',
84 + 'type' => 'color',
85 + 'title' => esc_html__( 'Background Color', 'merchant' ),
86 + 'default' => '#f4f6f8',
87 + ),
88 +
89 + ),
90 +),
91 + array(
92 + 'module' => Merchant_Cart_Reserved_timer::MODULE_ID,
93 + 'title' => esc_html__( 'Use shortcode', 'merchant' ),
94 + 'fields' => array(
95 + array(
96 + 'id' => 'use_shortcode',
97 + 'type' => 'switcher',
98 + 'title' => __( 'Use shortcode', 'merchant' ),
99 + 'default' => 0,
100 + ),
101 + array(
102 + 'type' => 'info',
103 + 'id' => 'shortcode_info',
104 + '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' ),
105 + ),
106 + array(
107 + 'id' => 'shortcode_text',
108 + 'type' => 'text_readonly',
109 + 'title' => esc_html__( 'Shortcode text', 'merchant' ),
110 + 'default' => '[merchant_module_' . str_replace( '-', '_', Merchant_Cart_Reserved_timer::MODULE_ID ) . ']',
111 + 'condition' => array( 'use_shortcode', '==', '1' ),
112 + ),
113 + ),
114 +),
115 +);