PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.10.4
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.10.4
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 / spending-goal / admin / options.php

options.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.10.4, at inc/modules/spending-goal/admin/options.php

196 lines 5.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Spending Goal Options.
5 *
6 * @package Merchant
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 // Settings
14 Merchant_Admin_Options::create( array(
15 'title' => esc_html__( 'Settings', 'merchant' ),
16 'module' => Merchant_Spending_Goal::MODULE_ID,
17 'fields' => array(
18
19 array(
20 'id' => 'spending_goal',
21 'type' => 'number',
22 'title' => esc_html__( 'Spending goal', 'merchant' ),
23 'step' => 0.01,
24 'default' => 150,
25 ),
26
27 array(
28 'id' => 'total_type',
29 'type' => 'select',
30 'title' => esc_html__( 'Based on', 'merchant' ),
31 'desc' => esc_html__( 'Choose the basis for the spending goal. “Cart Subtotal” excludes additional calculated discounts, whereas “Cart Total” includes them.', 'merchant' ),
32 'options' => array(
33 'subtotal' => esc_html__( 'Cart subtotal', 'merchant' ),
34 'total' => esc_html__( 'Cart total', 'merchant' ),
35 ),
36 'default' => 'subtotal',
37 ),
38
39 array(
40 'id' => 'discount_type',
41 'type' => 'select',
42 'title' => esc_html__( 'Discount type', 'merchant' ),
43 'options' => array(
44 'percent' => esc_html__( 'Percent', 'merchant' ),
45 'fixed' => esc_html__( 'Fixed amount', 'merchant' ),
46 ),
47 'default' => 'percent',
48 ),
49
50 array(
51 'id' => 'discount_amount',
52 'type' => 'number',
53 'title' => esc_html__( 'Discount amount', 'merchant' ),
54 'step' => 0.01,
55 'default' => 10,
56 ),
57
58 array(
59 'id' => 'discount_name',
60 'type' => 'text',
61 'title' => esc_html__( 'Discount name', 'merchant' ),
62 'default' => esc_html__( 'Spending goal', 'merchant' ),
63 'desc' => esc_html__( 'This will be the name of the applied discount on the cart page.', 'merchant' ),
64 ),
65
66 array(
67 'id' => 'user_condition',
68 'type' => 'select',
69 'title' => esc_html__( 'User Condition', 'merchant' ),
70 'options' => array(
71 'all' => esc_html__( 'All Users', 'merchant' ),
72 'customers' => esc_html__( 'Selected Users', 'merchant' ),
73 'roles' => esc_html__( 'Selected Roles', 'merchant' ),
74 ),
75 'default' => 'all',
76 ),
77
78 array(
79 'id' => 'user_condition_roles',
80 'type' => 'select_ajax',
81 'title' => esc_html__( 'User Roles', 'merchant' ),
82 'desc' => esc_html__( 'This will limit the offer to users with these roles.', 'merchant' ),
83 'source' => 'options',
84 'multiple' => true,
85 'classes' => array( 'flex-grow' ),
86 'options' => Merchant_Admin_Options::get_user_roles_select2_choices(),
87 'condition' => array( 'user_condition', '==', 'roles' ),
88 ),
89
90 array(
91 'id' => 'user_condition_users',
92 'type' => 'select_ajax',
93 'title' => esc_html__( 'Users', 'merchant' ),
94 'desc' => esc_html__( 'This will limit the offer to the selected customers.', 'merchant' ),
95 'source' => 'user',
96 'multiple' => true,
97 'classes' => array( 'flex-grow' ),
98 'condition' => array( 'user_condition', '==', 'customers' ),
99 ),
100
101 array(
102 'id' => 'enable_auto_slide_in',
103 'type' => 'switcher',
104 'title' => esc_html__( 'Enable Auto Slide In', 'merchant' ),
105 'desc' => esc_html__( 'This will make the widget slide in each time a product is added to the cart.', 'merchant' ),
106 'default' => 1,
107 ),
108 ),
109 ) );
110
111 // Text Formatting Settings
112 Merchant_Admin_Options::create( array(
113 'title' => esc_html__( 'Text Formatting Settings', 'merchant' ),
114 'module' => Merchant_Spending_Goal::MODULE_ID,
115 'fields' => array(
116
117 array(
118 'id' => 'text_goal_zero',
119 'type' => 'text',
120 'title' => esc_html__( 'When the goal target is at 0%', 'merchant' ),
121 'default' => esc_html__( 'Spend {spending_goal} to get a {discount_amount} discount!', 'merchant' ),
122 'desc' => esc_html__( 'Default is: Spend {spending_goal} to get a {discount_amount} discount!', 'merchant' ),
123 ),
124
125 array(
126 'id' => 'text_goal_started',
127 'type' => 'text',
128 'title' => esc_html__( 'When the goal target is between 1-99%', 'merchant' ),
129 'default' => esc_html__( 'Spend {spending_goal} more to get a {discount_amount} discount!', 'merchant' ),
130 'desc' => esc_html__( 'Default is: Spend {spending_goal} more to get a {discount_amount} discount!', 'merchant' ),
131 ),
132
133 array(
134 'id' => 'text_goal_reached',
135 'type' => 'text',
136 'title' => esc_html__( 'When the goal target is at 100%', 'merchant' ),
137 'default' => esc_html__( 'Congratulations! You got a discount of {discount_amount} on this order!', 'merchant' ),
138 'desc' => esc_html__( 'Default: Congratulations! You got a discount of {discount_amount} on this order!', 'merchant' ),
139 ),
140 ),
141 ) );
142
143 // Style Settings
144 Merchant_Admin_Options::create( array(
145 'module' => Merchant_Spending_Goal::MODULE_ID,
146 'title' => esc_html__( 'Style', 'merchant' ),
147 'fields' => array(
148
149 array(
150 'id' => 'gradient_start',
151 'type' => 'color',
152 'title' => esc_html__( 'Gradient start', 'merchant' ),
153 'default' => '#5e5e5e',
154 ),
155
156 array(
157 'id' => 'gradient_end',
158 'type' => 'color',
159 'title' => esc_html__( 'Gradient end', 'merchant' ),
160 'default' => '#212121',
161 ),
162
163 array(
164 'id' => 'progress_bar',
165 'type' => 'color',
166 'title' => esc_html__( 'Progress bar color', 'merchant' ),
167 'default' => '#d83a3b',
168 ),
169
170 array(
171 'id' => 'content_width',
172 'type' => 'range',
173 'title' => esc_html__( 'Content width', 'merchant' ),
174 'min' => 0,
175 'max' => 600,
176 'step' => 1,
177 'unit' => 'px',
178 'default' => 300,
179 ),
180
181 array(
182 'id' => 'content_bg_color',
183 'type' => 'color',
184 'title' => esc_html__( 'Content background color', 'merchant' ),
185 'default' => '#f9f9f9',
186 ),
187
188 array(
189 'id' => 'content_text_color',
190 'type' => 'color',
191 'title' => esc_html__( 'Content text color', 'merchant' ),
192 'default' => '#3c434a',
193 ),
194 ),
195 ) );
196