PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.8
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.8
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 / recently-viewed-products / admin / options.php

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

217 lines 6.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Recently Viewed Products 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' => __( 'Settings', 'merchant' ),
16 'module' => Merchant_Recently_Viewed_Products::MODULE_ID,
17 'fields' => array(
18
19 // Title.
20 array(
21 'id' => 'title',
22 'type' => 'text',
23 'title' => __( 'Title', 'merchant' ),
24 'default' => __( 'Recently Viewed', 'merchant' )
25 ),
26
27 // Title HTML Tag.
28 array(
29 'id' => 'title_tag',
30 'type' => 'select',
31 'title' => __( 'Title HTML tag', 'merchant' ),
32 'options' => array(
33 'h1' => __( 'H1', 'merchant' ),
34 'h2' => __( 'H2', 'merchant' ),
35 'h3' => __( 'H3', 'merchant' ),
36 'h4' => __( 'H4', 'merchant' ),
37 'h5' => __( 'H5', 'merchant' ),
38 'h6' => __( 'H6', 'merchant' ),
39 'div' => __( 'div', 'merchant' )
40 ),
41 'default' => 'h2'
42 ),
43
44 // Hide Title.
45 array(
46 'id' => 'hide_title',
47 'type' => 'switcher',
48 'title' => __( 'Hide title', 'merchant' ),
49 'desc' => __( 'Hide the title visually only. The title will continue being rendered in the HTML source code.', 'merchant' ),
50 'default' => 0
51 ),
52
53 // Slider Style.
54 array(
55 'id' => 'slider',
56 'type' => 'switcher',
57 'title' => __( 'Slider style', 'merchant' ),
58 'desc' => __( 'Display the products grid as a slider.' , 'merchant' ),
59 'default' => 0
60 ),
61
62 // Slider Navigation.
63 array(
64 'id' => 'slider_nav',
65 'type' => 'radio',
66 'title' => __( 'Slider navigation', 'merchant' ),
67 'options' => array(
68 'always-show' => __( 'Always Show', 'merchant' ),
69 'on-hover' => __( 'Show On Hover', 'merchant' ),
70 ),
71 'default' => 'on-hover',
72 'condition' => array( 'slider', '==', true )
73 ),
74
75 // Number of Products.
76 array(
77 'id' => 'posts_per_page',
78 'type' => 'range',
79 'title' => __( 'Products', 'merchant' ),
80 'desc' => __( 'Controls the number of products to display in the products grid.', 'merchant' ),
81 'min' => 1,
82 'max' => 30,
83 'step' => 1,
84 'unit' => '',
85 'default' => 10
86 ),
87
88 // Number of Columns.
89 array(
90 'id' => 'columns',
91 'type' => 'range',
92 'title' => __( 'Columns', 'merchant' ),
93 'desc' => __( 'Controls the number of columns to display in the products grid.', 'merchant' ),
94 'min' => 1,
95 'max' => 6,
96 'step' => 1,
97 'unit' => '',
98 'default' => 3
99 ),
100
101 // Columns Gap.
102 array(
103 'id' => 'columns_gap',
104 'type' => 'range',
105 'title' => __( 'Columns gap', 'merchant' ),
106 'desc' => __( 'Controls gap between each column in the products grid.', 'merchant' ),
107 'min' => 0,
108 'max' => 100,
109 'step' => 1,
110 'unit' => 'px',
111 'default' => 15
112 ),
113
114 // Order by.
115 array(
116 'id' => 'orderby',
117 'type' => 'select',
118 'title' => __( 'Order by', 'merchant' ),
119 'options' => array(
120 'id' => __( 'ID', 'merchant' ),
121 'rand' => __( 'Random', 'merchant' ),
122 'title' => __( 'TItle', 'merchant' ),
123 'date' => __( 'Date', 'merchant' ),
124 'modified' => __( 'Modified date', 'merchant' ),
125 'menu_order' => __( 'Menu order', 'merchant' ),
126 ),
127 'default' => 'rand'
128 ),
129
130 // Order.
131 array(
132 'id' => 'order',
133 'type' => 'select',
134 'title' => __( 'Order', 'merchant' ),
135 'options' => array(
136 'asc' => __( 'Asc', 'merchant' ),
137 'desc' => __( 'Desc', 'merchant' )
138 ),
139 'default' => 'desc'
140 ),
141
142 // Hook Order.
143 array(
144 'id' => 'hook_order',
145 'type' => 'range',
146 'title' => __( 'Loading priority', 'merchant' ),
147 'desc' => __( 'Note: This is a developer level feature. The recently viewed product module is "hooked" into a specific location on the page. Themes and other plugins might also add additional elements to the same location. By modifying the hook 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' ),
148 'min' => 1,
149 'max' => 100,
150 'step' => 1,
151 'unit' => '',
152 'default' => 20
153 ),
154
155 // colors.
156
157 // Title color.
158 array(
159 'id' => 'title_color',
160 'type' => 'color',
161 'title' => __( 'Title color', 'merchant' ),
162 'default' => '#212121'
163 ),
164
165 // Navigation Icon color.
166 array(
167 'id' => 'navigation_icon_color',
168 'type' => 'color',
169 'title' => __( 'Navigation icon color', 'merchant' ),
170 'default' => '#FFF',
171 'condition' => array( 'slider', '==', true )
172 ),
173
174 // Naviation color.
175 array(
176 'id' => 'navigation_color',
177 'type' => 'color',
178 'title' => __( 'Navigation color', 'merchant' ),
179 'default' => '#212121',
180 'condition' => array( 'slider', '==', true )
181 ),
182
183 // Naviation color (hover).
184 array(
185 'id' => 'navigation_color_hover',
186 'type' => 'color',
187 'title' => __( 'Navigation color (hover)', 'merchant' ),
188 'default' => '#757575',
189 'condition' => array( 'slider', '==', true )
190 )
191
192 )
193 ) );
194
195 // Shortcode
196 $merchant_module_id = Merchant_Recently_Viewed_Products::MODULE_ID;
197 Merchant_Admin_Options::create( array(
198 'module' => $merchant_module_id,
199 'title' => esc_html__( 'Use shortcode', 'merchant' ),
200 'fields' => array(
201 array(
202 'id' => 'use_shortcode',
203 'type' => 'switcher',
204 'title' => __( 'Use shortcode', 'merchant' ),
205 'default' => 0,
206 'desc' => esc_html__( '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.',
207 'merchant' ),
208 ),
209 array(
210 'id' => 'shortcode_text',
211 'type' => 'text_readonly',
212 'title' => esc_html__( 'Shortcode text', 'merchant' ),
213 'default' => '[merchant_module_' . str_replace( '-', '_', $merchant_module_id ) . ']',
214 'condition' => array( 'use_shortcode', '==', '1' ),
215 ),
216 ),
217 ) );