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

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

216 lines 7.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Stock Scarcity — 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 // Settings
17
18 return array(
19 array(
20 'module' => Merchant_Stock_Scarcity::MODULE_ID,
21 'title' => esc_html__('Settings', 'merchant'),
22 'fields' => array(
23
24 array(
25 'id' => 'min_inventory',
26 'type' => 'number',
27 'title' => esc_html__('Show urgency box when variant inventory is below', 'merchant'),
28 'default' => 50,
29 'ai_meta' => array(
30 'usage_hint' => 'Stock quantity threshold (integer) below which the scarcity urgency box is displayed. Applies per variant for variable products.',
31 ),
32 ),
33 array(
34 'id' => 'display-pages',
35 'type' => 'checkbox_multiple',
36 'title' => esc_html__( 'Show on pages', 'merchant' ),
37 'options' => array(
38 'product' => esc_html__( 'Product Page', 'merchant' ),
39 'archive' => esc_html__( 'Product Archive', 'merchant' ),
40 ),
41 'default' => array( 'product' ),
42 'ai_meta' => array(
43 'usage_hint' => 'Controls which page types display the stock scarcity urgency box. Select product for single product pages, archive for shop/category listing pages.',
44 ),
45 ),
46
47 // Loading position/priority on single product.
48 array(
49 'id' => 'hook-order-single-product',
50 'type' => 'hook_select',
51 'title' => esc_html__('Loading position and priority on single product', 'merchant'),
52 'options' => array(
53 'woocommerce_before_add_to_cart_button' => esc_html__('Before add to cart button', 'merchant'),
54 'woocommerce_after_add_to_cart_button' => esc_html__('After add to cart button', 'merchant'),
55 'woocommerce_before_add_to_cart_quantity' => esc_html__('Before add to cart quantity', 'merchant'),
56 'woocommerce_after_add_to_cart_quantity' => esc_html__('After add to cart quantity', 'merchant'),
57 ),
58 'min' => -999,
59 'max' => 999,
60 'step' => 1,
61 'unit' => '',
62 'order' => true,
63 'default' => array(
64 'hook_name' => 'woocommerce_after_add_to_cart_button',
65 'hook_priority' => 10,
66 ),
67 ),
68 array(
69 'id' => 'developer_info_single_product',
70 'type' => 'info',
71 'content' => esc_html__('This is a developer level feature. The Stock Scarcity 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'),
72 ),
73
74 // Loading position/priority on shop archive.
75 array(
76 'id' => 'hook-order-shop-archive',
77 'type' => 'hook_select',
78 'title' => esc_html__('Loading position and priority on shop archive', 'merchant'),
79 'options' => array(
80 'woocommerce_before_shop_loop_item' => esc_html__('Before shop loop item', 'merchant'),
81 'woocommerce_before_shop_loop_item_title' => esc_html__('Before shop loop item title', 'merchant'),
82 'woocommerce_shop_loop_item_title' => esc_html__('Shop loop item title', 'merchant'),
83 'woocommerce_after_shop_loop_item_title' => esc_html__('After shop loop item title', 'merchant'),
84 'woocommerce_after_shop_loop_item' => esc_html__('After shop loop item', 'merchant'),
85 ),
86 'min' => -999,
87 'max' => 999,
88 'step' => 1,
89 'unit' => '',
90 'order' => true,
91 'default' => array(
92 'hook_name' => 'woocommerce_after_shop_loop_item',
93 'hook_priority' => 10,
94 ),
95 ),
96 array(
97 'id' => 'hook-order-shop-archive_info',
98 'type' => 'info',
99 'content' => esc_html__('This is a developer level feature. The Stock Scarcity 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'),
100 ),
101 ),
102 ),
103 array(
104 'title' => esc_html__('Text Formatting Settings', 'merchant'),
105 'module' => Merchant_Stock_Scarcity::MODULE_ID,
106 'fields' => array(
107
108 array(
109 'id' => 'low_inventory_text',
110 'type' => 'text',
111 'title' => esc_html__('Text when inventory is low (when only 1 item left in stock)', 'merchant'),
112 'default' => esc_html__('Hurry! Only {stock} unit left in stock!', 'merchant'),
113 ),
114
115 array(
116 'id' => 'low_inventory_text_plural',
117 'type' => 'text',
118 'title' => esc_html__('Text when inventory is low (when more than 1 item is left in stock)', 'merchant'),
119 'default' => esc_html__('Hurry! Only {stock} units left in stock!', 'merchant'),
120 ),
121
122 array(
123 'id' => 'low_inventory_text_simple',
124 'type' => 'text',
125 'title' => esc_html__('Text when inventory is low (variable - used for product variation)', 'merchant'),
126 'default' => esc_html__('Hurry, low stock.', 'merchant'),
127 ),
128 ),
129 ),
130 array(
131 'module' => Merchant_Stock_Scarcity::MODULE_ID,
132 'title' => esc_html__('Style', 'merchant'),
133 'fields' => array(
134
135 array(
136 'id' => 'gradient_start',
137 'type' => 'color',
138 'title' => esc_html__('Progress bar gradient start', 'merchant'),
139 'default' => '#ffc108',
140 ),
141
142 array(
143 'id' => 'gradient_end',
144 'type' => 'color',
145 'title' => esc_html__('Progress bar gradient end', 'merchant'),
146 'default' => '#d61313',
147 ),
148
149 array(
150 'id' => 'progress_bar_bg',
151 'type' => 'color',
152 'title' => esc_html__('Progress bar background color', 'merchant'),
153 'default' => '#e1e1e1',
154 ),
155
156 array(
157 'id' => 'text_font_weight',
158 'type' => 'select',
159 'title' => esc_html__('Text font weight', 'merchant'),
160 'options' => array(
161 'lighter' => esc_html__('Light', 'merchant'),
162 'normal' => esc_html__('Normal', 'merchant'),
163 'bold' => esc_html__('Bold', 'merchant'),
164 ),
165 'default' => 'normal',
166 ),
167
168 array(
169 'id' => 'text_font_size',
170 'type' => 'range',
171 'title' => esc_html__('Text font size', 'merchant'),
172 'min' => 0,
173 'max' => 100,
174 'step' => 1,
175 'unit' => 'px',
176 'default' => 16,
177 ),
178
179 array(
180 'id' => 'text_text_color',
181 'type' => 'color',
182 'title' => esc_html__('Text text color', 'merchant'),
183 'default' => '#212121',
184 ),
185
186 ),
187 ),
188 array(
189 'module' => Merchant_Stock_Scarcity::MODULE_ID,
190 'title' => esc_html__('Use shortcode', 'merchant'),
191 'fields' => array(
192 array(
193 'id' => 'use_shortcode',
194 'type' => 'switcher',
195 'title' => __('Use shortcode', 'merchant'),
196 'default' => 0,
197 ),
198 array(
199 'id' => 'shortcode_info',
200 'type' => 'info',
201 'content' => esc_html__(
202 '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.',
203 'merchant'
204 ),
205 ),
206 array(
207 'id' => 'shortcode_text',
208 'type' => 'text_readonly',
209 'title' => esc_html__('Shortcode text', 'merchant'),
210 'default' => '[merchant_module_' . str_replace('-', '_', Merchant_Stock_Scarcity::MODULE_ID) . ']',
211 'condition' => array( 'use_shortcode', '==', '1' ),
212 ),
213 ),
214 ),
215 );
216