| 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 |
); |
| 116 |
|