# merchant/1.6/inc/modules/cart-reserved-timer/admin/options.php

Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together &amp; More for WooCommerce – Merchant, version 1.6. 99 lines.

- Page: https://pluginprobe.com/plugins/merchant/1.6/code/inc/modules/cart-reserved-timer/admin/options.php
- Raw: https://pluginprobe.com/plugins/merchant/1.6/raw/inc/modules/cart-reserved-timer/admin/options.php
- Modified: 2023-11-29T20:09:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/merchant/1.6/code/inc/modules/cart-reserved-timer/admin/options.php#L10-L20`.

```php
<?php

/**
 * Cart Reserved Timer Options.
 *
 * @package Merchant
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

$before_fields = array();
if ( defined( 'MERCHANT_PRO_VERSION' ) && merchant_is_cart_block_layout() ) {
	$before_fields = array(
		'type'    => 'warning',
		'content' => sprintf( 
			/* Translators: 1. docs link */
			__( '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' ),
			'https://docs.athemes.com/article/how-to-switch-cart-checkout-blocks-to-the-classic-shortcodes/'
		),
	);
}

// Variables
$icon_path = MERCHANT_URI . 'assets/images/icons/' . Merchant_Cart_Reserved_timer::MODULE_ID;

// Settings
Merchant_Admin_Options::create( array(
	'title'  => esc_html__( 'Settings', 'merchant' ),
	'module' => Merchant_Cart_Reserved_timer::MODULE_ID,
	'fields' => array(

		$before_fields,

		array(
			'id'      => 'duration',
			'type'    => 'number',
			'title'   => esc_html__( 'Count down duration minutes', 'merchant' ),
			'default' => 10,
		),

		array(
			'id'      => 'reserved_message',
			'type'    => 'text',
			'title'   => esc_html__( 'Cart reserved message', 'merchant' ),
			'default' => esc_html__( 'An item in your cart is in high demand.', 'merchant' ),
		),

		array(
			'id'      => 'timer_message_minutes',
			'type'    => 'text',
			'title'   => esc_html__( 'Timer message for > 1 min ', 'merchant' ),
			'default' => esc_html__( 'Your cart is saved for {timer} minutes!', 'merchant' ),
		),

		array(
			'id'      => 'timer_message_seconds',
			'type'    => 'text',
			'title'   => esc_html__( 'Timer message for  < 1 min', 'merchant' ),
			'default' => esc_html__( 'Your cart is saved for {timer} seconds!', 'merchant' ),
		),

		array(
			'id'      => 'time_expires',
			'type'    => 'radio',
			'title'   => esc_html__( 'What to do after the timer expires?', 'merchant' ),
			'options' => array(
				'hide-timer' => esc_html__( 'Hide timer', 'merchant' ),
				'clear-cart' => esc_html__( 'Clear cart', 'merchant' ),
			),
			'default' => 'clear-cart'
		),

		array(
			'id'      => 'icon',
			'type'    => 'choices',
			'title'   => esc_html__( 'Choose an icon', 'merchant' ),
			'class'   => 'merchant-module-page-setting-field-choices-icon',
			'options' => array(
				'none'       => $icon_path . '/cancel.svg',
				'fire'       => $icon_path . '/fire.svg',
				'clock'      => $icon_path . '/clock.svg',
				'hour-glass' => $icon_path . '/hour-glass.svg',
			),
			'default' => 'fire'
		),

		array(
			'id'      => 'background_color',
			'type'    => 'color',
			'title'   => esc_html__( 'Choose background Color', 'merchant' ),
			'default' => '#f4f6f8',
		),

	),
) );


```
