PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.10.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.10.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 1.10.2, at inc/modules/stock-scarcity/admin/options.php

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