PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 2.2.7
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v2.2.7
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 / buy-now / admin / options.php

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

337 lines 10.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Merchant Buy Now
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10 /**
11 * Settings
12 */
13 Merchant_Admin_Options::create( array(
14 'title' => esc_html__( 'Settings', 'merchant' ),
15 'module' => 'buy-now',
16 'fields' => array(
17
18 array(
19 'id' => 'button-text',
20 'type' => 'text',
21 'title' => esc_html__( 'Button text', 'merchant' ),
22 'default' => esc_html__( 'Buy Now', 'merchant' ),
23 ),
24
25 // Customize The Button or Inherit from Themes.
26 array(
27 'id' => 'customize-button',
28 'type' => 'switcher',
29 'title' => esc_html__( 'Customize Button', 'merchant' ),
30 'default' => 1,
31 ),
32
33 array(
34 'id' => 'text-color',
35 'type' => 'color',
36 'title' => esc_html__( 'Button text color', 'merchant' ),
37 'default' => '#ffffff',
38 'condition' => array( 'customize-button', '==', '1' ),
39 ),
40
41 array(
42 'id' => 'text-hover-color',
43 'type' => 'color',
44 'title' => esc_html__( 'Button text color hover', 'merchant' ),
45 'default' => '#ffffff',
46 'condition' => array( 'customize-button', '==', '1' ),
47 ),
48
49 array(
50 'id' => 'border-color',
51 'type' => 'color',
52 'title' => esc_html__( 'Button border color', 'merchant' ),
53 'default' => '#212121',
54 'condition' => array( 'customize-button', '==', '1' ),
55 ),
56
57 array(
58 'id' => 'border-hover-color',
59 'type' => 'color',
60 'title' => esc_html__( 'Button border color hover', 'merchant' ),
61 'default' => '#414141',
62 'condition' => array( 'customize-button', '==', '1' ),
63 ),
64
65 array(
66 'id' => 'background-color',
67 'type' => 'color',
68 'title' => esc_html__( 'Button background color', 'merchant' ),
69 'default' => '#212121',
70 'condition' => array( 'customize-button', '==', '1' ),
71 ),
72
73 array(
74 'id' => 'background-hover-color',
75 'type' => 'color',
76 'title' => esc_html__( 'Button background color hover', 'merchant' ),
77 'default' => '#414141',
78 'condition' => array( 'customize-button', '==', '1' ),
79 ),
80
81 array(
82 'id' => 'button-size',
83 'type' => 'select',
84 'title' => esc_html__( 'Button size', 'merchant' ),
85 'options' => array(
86 'small' => esc_html__( 'Small', 'merchant' ),
87 'medium' => esc_html__( 'Medium', 'merchant' ),
88 'large' => esc_html__( 'Large', 'merchant' ),
89 'custom' => esc_html__( 'Custom', 'merchant' ),
90 ),
91 'default' => 'medium',
92 'condition' => array( 'customize-button', '==', '1' ),
93 ),
94
95 array(
96 'id' => 'font-size',
97 'type' => 'range',
98 'title' => esc_html__( 'Font size', 'merchant' ),
99 'min' => 1,
100 'max' => 100,
101 'step' => 1,
102 'default' => 16,
103 'unit' => 'px',
104 'condition' => array( 'customize-button', '==', '1' ),
105 ),
106
107 array(
108 'id' => 'margin-top',
109 'type' => 'range',
110 'title' => esc_html__( 'Margin top', 'merchant' ),
111 'min' => 0,
112 'max' => 100,
113 'step' => 1,
114 'default' => 10,
115 'unit' => 'px',
116 'conditions' => array(
117 'terms' => array(
118 array(
119 'field' => 'customize-button',
120 'operator' => '===',
121 'value' => true,
122 ),
123 ),
124 ),
125 ),
126
127 array(
128 'id' => 'margin-bottom',
129 'type' => 'range',
130 'title' => esc_html__( 'Margin bottom', 'merchant' ),
131 'min' => 0,
132 'max' => 100,
133 'step' => 1,
134 'default' => 10,
135 'unit' => 'px',
136 'conditions' => array(
137 'terms' => array(
138 array(
139 'field' => 'customize-button',
140 'operator' => '===',
141 'value' => true,
142 ),
143 ),
144 ),
145 ),
146
147 array(
148 'id' => 'padding_top_bottom',
149 'type' => 'range',
150 'title' => esc_html__( 'Padding Top/Bottom', 'merchant' ),
151 'min' => 0,
152 'max' => 100,
153 'step' => 1,
154 'default' => 12,
155 'unit' => 'px',
156 'conditions' => array(
157 'terms' => array(
158 array(
159 'field' => 'customize-button',
160 'operator' => '===',
161 'value' => true,
162 ),
163 ),
164 ),
165 ),
166
167 array(
168 'id' => 'padding_left_right',
169 'type' => 'range',
170 'title' => esc_html__( 'Padding Left/Right', 'merchant' ),
171 'min' => 0,
172 'max' => 100,
173 'step' => 1,
174 'default' => 24,
175 'unit' => 'px',
176 'conditions' => array(
177 'terms' => array(
178 array(
179 'field' => 'customize-button',
180 'operator' => '===',
181 'value' => true,
182 ),
183 ),
184 ),
185 ),
186
187 array(
188 'id' => 'border-radius',
189 'type' => 'range',
190 'title' => esc_html__( 'Border radius', 'merchant' ),
191 'min' => 0,
192 'max' => 9999,
193 'step' => 1,
194 'unit' => 'px',
195 'default' => 0,
196 'condition' => array( 'customize-button', '==', '1' ),
197 ),
198
199 ),
200 ) );
201
202 // Display Settings
203 Merchant_Admin_Options::create( array(
204 'module' => 'buy-now',
205 'title' => esc_html__( 'Display Settings', 'merchant' ),
206 'fields' => array(
207
208 array(
209 'id' => 'display-archive',
210 'type' => 'checkbox',
211 'label' => __( 'Show on product archive', 'merchant' ),
212 'default' => 1,
213 ),
214 array(
215 'id' => 'display-product',
216 'type' => 'checkbox',
217 'label' => __( 'Show on single product page', 'merchant' ),
218 'default' => 1,
219 ),
220 array(
221 'id' => 'display-upsell-related',
222 'type' => 'checkbox',
223 'label' => __( 'Show on upsell and related products', 'merchant' ),
224 'default' => 1,
225 ),
226
227 // Loading position/priority on shop archive.
228 array(
229 'id' => 'hook-order-shop-archive',
230 'type' => 'hook_select',
231 'title' => __( 'Loading position and priority on shop archive', 'merchant' ),
232 'options' => array(
233 'woocommerce_before_shop_loop_item' => __( 'Before shop loop item', 'merchant' ),
234 'woocommerce_before_shop_loop_item_title' => __( 'Before shop loop item title', 'merchant' ),
235 'woocommerce_shop_loop_item_title' => __( 'Shop loop item title', 'merchant' ),
236 'woocommerce_after_shop_loop_item_title' => __( 'After shop loop item title', 'merchant' ),
237 'woocommerce_after_shop_loop_item' => __( 'After shop loop item', 'merchant' ),
238 ),
239 'min' => -999,
240 'max' => 999,
241 'step' => 1,
242 'unit' => '',
243 'order' => true,
244 'default' => array(
245 'hook_name' => 'woocommerce_after_shop_loop_item',
246 'hook_priority' => 10,
247 ),
248 ),
249 array(
250 'id' => 'hook-order-shop-archive_info',
251 'type' => 'info',
252 'content' => esc_html__( 'This is a developer level feature. The buy now button module is "hooked" into a specific location on the shop archive pages. Themes and other plugins might also add additional elements to the same location. By modifying the loading postiion and priority, you have the ability to customize the placement of this element on that particular location. A lower number = a higher priority, so the module will appear higher on the page.', 'merchant' ),
253 ),
254
255 // Loading position/priority on single product.
256 array(
257 'id' => 'hook-order-single-product',
258 'type' => 'hook_select',
259 'title' => __( 'Loading position and priority on single product', 'merchant' ),
260 'options' => array(
261 'woocommerce_before_add_to_cart_button' => __( 'Before add to cart button', 'merchant' ),
262 'woocommerce_after_add_to_cart_button' => __( 'After add to cart button', 'merchant' ),
263 'woocommerce_before_add_to_cart_quantity' => __( 'Before add to cart quantity', 'merchant' ),
264 'woocommerce_after_add_to_cart_quantity' => __( 'After add to cart quantity', 'merchant' ),
265 ),
266 'min' => -999,
267 'max' => 999,
268 'step' => 1,
269 'unit' => '',
270 'order' => true,
271 'default' => array(
272 'hook_name' => 'woocommerce_after_add_to_cart_button',
273 'hook_priority' => 10,
274 ),
275 ),
276 array(
277 'id' => 'hook-order-single-product_info',
278 'type' => 'info',
279 'content' => esc_html__( 'This is a developer level feature. The buy now button module is "hooked" into a specific location on the single product pages. Themes and other plugins might also add additional elements to the same location. By modifying the loading postiion and priority, you have the ability to customize the placement of this element on that particular location. A lower number = a higher priority, so the module will appear higher on the page.', 'merchant' ),
280 ),
281 ),
282 ) );
283
284 // Exclusion Settings
285 Merchant_Admin_Options::create( array(
286 'module' => 'buy-now',
287 'title' => esc_html__( 'Conditional Display', 'merchant' ),
288 'fields' => array(
289 array(
290 'id' => 'exclusion',
291 'type' => 'switcher',
292 'title' => __( 'Enable conditional display', 'merchant' ),
293 'desc' => __( 'Enable product exclusion rules', 'merchant' ),
294 'default' => 0,
295 ),
296 array(
297 'id' => 'excluded_products',
298 'type' => 'products_selector',
299 'title' => __( 'Exclude Products', 'merchant' ),
300 'desc' => __( 'Select products to exclude from buy now button', 'merchant' ),
301 'condition' => array( 'exclusion', '==', '1' ),
302 ),
303 array(
304 'id' => 'excluded_categories',
305 'type' => 'select_ajax',
306 'title' => __( 'Exclude Categories', 'merchant' ),
307 'source' => 'options',
308 'multiple' => true,
309 'options' => Merchant_Admin_Options::get_category_select2_choices(),
310 'placeholder' => __( 'Select categories', 'merchant' ),
311 'desc' => __( 'Select categories to exclude from buy now button', 'merchant' ),
312 'condition' => array( 'exclusion', '==', '1' ),
313 ),
314 array(
315 'id' => 'excluded_tags',
316 'type' => 'select_ajax',
317 'source' => 'options',
318 'multiple' => true,
319 'options' => Merchant_Admin_Options::get_tag_select2_choices(),
320 'placeholder' => __( 'Select tags', 'merchant' ),
321 'title' => __( 'Exclude Tags', 'merchant' ),
322 'desc' => __( 'Select tags to exclude from buy now button', 'merchant' ),
323 'condition' => array( 'exclusion', '==', '1' ),
324 ),
325 array(
326 'id' => 'excluded_brands',
327 'type' => 'select_ajax',
328 'source' => 'options',
329 'multiple' => true,
330 'options' => Merchant_Admin_Options::get_brand_select2_choices(),
331 'placeholder' => __( 'Select brands', 'merchant' ),
332 'title' => __( 'Exclude Brands', 'merchant' ),
333 'desc' => __( 'Select brands to exclude from buy now button', 'merchant' ),
334 'condition' => array( 'exclusion', '==', '1' ),
335 ),
336 ),
337 ) );