# merchant/1.8/inc/modules/spending-goal/admin/options.php

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

- Page: https://pluginprobe.com/plugins/merchant/1.8/code/inc/modules/spending-goal/admin/options.php
- Raw: https://pluginprobe.com/plugins/merchant/1.8/raw/inc/modules/spending-goal/admin/options.php
- Modified: 2023-12-13T17:56:38+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.8/code/inc/modules/spending-goal/admin/options.php#L10-L20`.

```php
<?php

/**
 * Spending Goal Options.
 *
 * @package Merchant
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

// Settings
Merchant_Admin_Options::create( array(
	'title'  => esc_html__( 'Settings', 'merchant' ),
	'module' => Merchant_Spending_Goal::MODULE_ID,
	'fields' => array(

		array(
			'id'      => 'spending_goal',
			'type'    => 'number',
			'title'   => esc_html__( 'Spending goal', 'merchant' ),
			'default' => 150,
		),

		array(
			'id'      => 'total_type',
			'type'    => 'select',
			'title'   => esc_html__( 'Based on', 'merchant' ),
			'desc'    => esc_html__( 'To which the spending goal should be based on. "Cart Subtotal" does not include additional calculated discounts, whereas the "Cart Total" does.',
				'merchant' ),
			'options' => array(
				'subtotal' => esc_html__( 'Cart subtotal', 'merchant' ),
				'total'    => esc_html__( 'Cart total', 'merchant' ),
			),
			'default' => 'subtotal'
		),

		array(
			'id'      => 'discount_type',
			'type'    => 'select',
			'title'   => esc_html__( 'Discount type', 'merchant' ),
			'options' => array(
				'percent' => esc_html__( 'Percent', 'merchant' ),
				'fixed'   => esc_html__( 'Fixed amount', 'merchant' ),
			),
			'default' => 'percent'
		),

		array(
			'id'      => 'discount_amount',
			'type'    => 'number',
			'title'   => esc_html__( 'Discount amount', 'merchant' ),
			'default' => 10,
		),

		array(
			'id'      => 'discount_name',
			'type'    => 'text',
			'title'   => esc_html__( 'Discount name', 'merchant' ),
			'default' => esc_html__( 'Spending goal', 'merchant' ),
			'desc'    => esc_html__( 'This will be the name of the applied discount on the cart page.', 'merchant' ),
		),

	)

) );

// Text Formatting Settings
Merchant_Admin_Options::create( array(
	'title'  => esc_html__( 'Text Formatting Settings', 'merchant' ),
	'module' => Merchant_Spending_Goal::MODULE_ID,
	'fields' => array(

		array(
			'id'      => 'text_goal_zero',
			'type'    => 'text',
			'title'   => esc_html__( 'When the goal target is at 0%', 'merchant' ),
			'default' => esc_html__( 'Spend {spending_goal} to get a {discount_amount} discount!', 'merchant' ),
			'desc'    => esc_html__( 'Default is: Spend {spending_goal} to get a {discount_amount} discount!', 'merchant' ),
		),

		array(
			'id'      => 'text_goal_started',
			'type'    => 'text',
			'title'   => esc_html__( 'When the goal target is between 1-99%', 'merchant' ),
			'default' => esc_html__( 'Spend {spending_goal} more to get a {discount_amount} discount', 'merchant' ),
			'desc'    => esc_html__( 'Default is: Spend {spending_goal} more to get a {discount_amount} discount', 'merchant' ),
		),

		array(
			'id'      => 'text_goal_reached',
			'type'    => 'text',
			'title'   => esc_html__( 'When the goal target is at 100%', 'merchant' ),
			'default' => esc_html__( 'Congratulations! You get a discount of {discount_amount} on this order!', 'merchant' ),
			'desc'    => esc_html__( 'Default: Congratulations! You get a discount of {discount_amount} on this order!', 'merchant' ),
		),
	)
) );

// Style Settings
Merchant_Admin_Options::create( array(
	'module' => Merchant_Spending_Goal::MODULE_ID,
	'title'  => esc_html__( 'Style', 'merchant' ),
	'fields' => array(

		array(
			'id'      => 'gradient_start',
			'type'    => 'color',
			'title'   => esc_html__( 'Gradient start', 'merchant' ),
			'default' => '#5e5e5e'
		),

		array(
			'id'      => 'gradient_end',
			'type'    => 'color',
			'title'   => esc_html__( 'Gradient end', 'merchant' ),
			'default' => '#212121'
		),

		array(
			'id'      => 'progress_bar',
			'type'    => 'color',
			'title'   => esc_html__( 'Progress bar color', 'merchant' ),
			'default' => '#d83a3b'
		),

		array(
			'id'      => 'content_width',
			'type'    => 'range',
			'title'   => esc_html__( 'Content width', 'merchant' ),
			'min'     => 0,
			'max'     => 600,
			'step'    => 1,
			'unit'    => 'px',
			'default' => 300
		),

		array(
			'id'      => 'content_bg_color',
			'type'    => 'color',
			'title'   => esc_html__( 'Content background color', 'merchant' ),
			'default' => '#f9f9f9'
		),

		array(
			'id'      => 'content_text_color',
			'type'    => 'color',
			'title'   => esc_html__( 'Content text color', 'merchant' ),
			'default' => '#3c434a'
		),
	),
) );

```
