PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Controls / ModuleBtnControls.php

ModuleBtnControls.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.4, at app/Elementor/Widgets/Controls/ModuleBtnControls.php

355 lines 13.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductDescription class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
9
10 use Elementor\Controls_Manager;
11 use RadiusTheme\SB\Helpers\Fns;
12
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * Product Description class
20 */
21 class ModuleBtnControls {
22 /**
23 * Widget Field
24 *
25 * @param object $widget Widget Object.
26 * @return array
27 */
28 public static function module_button_style( $widget ) {
29 $selector = $widget->selectors;
30 $module_btn_active = Fns::is_module_active('wishlist') || Fns::is_module_active('compare') || Fns::is_module_active('quick_view');
31 $fields = [];
32 if( $module_btn_active ) {
33 $fields = [
34 'module_section' => [
35 'mode' => 'section_start',
36 'tab' => 'style',
37 'label' => esc_html__('Wishlist, Compare & Quick view', 'shopbuilder'),
38 'conditions' => [
39 'relation' => 'or',
40 'terms' => [
41 [
42 'name' => 'wishlist_button',
43 'operator' => '===',
44 'value' => 'yes',
45 ],
46 [
47 'name' => 'comparison_button',
48 'operator' => '===',
49 'value' => 'yes',
50 ],
51 [
52 'name' => 'quick_view_button',
53 'operator' => '===',
54 'value' => 'yes',
55 ],
56 ],
57 ],
58 ],
59 'module_width' => [
60 'label' => esc_html__('Width', 'shopbuilder'),
61 'type' => 'slider',
62 'separator' => 'default',
63 'range' => [
64 'px' => [
65 'min' => 10,
66 'max' => 200,
67 ],
68 ],
69 'default' => [
70 'size' => 20,
71 ],
72 'selectors' => [
73 $selector['module_width'] => 'width: {{SIZE}}{{UNIT}};',
74 ],
75 ],
76 'module_height' => [
77 'label' => esc_html__('Height', 'shopbuilder'),
78 'type' => 'slider',
79 'range' => [
80 'px' => [
81 'min' => 10,
82 'max' => 200,
83 ],
84 ],
85 'default' => [
86 'size' => 20,
87 ],
88 'selectors' => [
89 $selector['module_height'] => 'height: {{SIZE}}{{UNIT}};',
90 ],
91 ],
92 'module_item_gap' => [
93 'label' => esc_html__('Item Gap (px)', 'shopbuilder'),
94 'type' => 'slider',
95 'separator' => 'default',
96 'range' => [
97 'px' => [
98 'min' => 0,
99 'max' => 100,
100 ],
101 ],
102 'default' => [
103 'size' => 5,
104 ],
105 'selectors' => [
106 $selector['module_item_gap'] => 'gap: {{SIZE}}{{UNIT}};',
107 ],
108 ],
109 'module_item_alignment' => [
110 'mode' => 'responsive',
111 'type' => 'choose',
112 'label' => esc_html__( 'Elements Alignment', 'shopbuilder' ),
113 'options' => [
114 'left' => [
115 'title' => esc_html__( 'Left', 'shopbuilder' ),
116 'icon' => 'eicon-text-align-left',
117 ],
118 'center' => [
119 'title' => esc_html__( 'Center', 'shopbuilder' ),
120 'icon' => 'eicon-text-align-center',
121 ],
122 'right' => [
123 'title' => esc_html__( 'Right', 'shopbuilder' ),
124 'icon' => 'eicon-text-align-right',
125 ],
126 ],
127 'separator' => 'before-short elementor-control-separator-after',
128 'selectors' => [
129 $selector['module_item_alignment'] => 'justify-content: {{VALUE}};',
130 ],
131 ],
132 'module_tabs_start' => [
133 'mode' => 'tabs_start',
134 ],
135 // Tab For normal view.
136 'module_normal' => [
137 'mode' => 'tab_start',
138 'label' => esc_html__('Normal', 'shopbuilder'),
139 ],
140 'module_text_color_normal' => [
141 'label' => esc_html__('Color', 'shopbuilder'),
142 'type' => 'color',
143
144 'separator' => 'default',
145 'selectors' => [
146 $selector['module_text_color_normal'] => 'color: {{VALUE}};',
147 ],
148 ],
149 'module_bg_color_normal' => [
150 'label' => esc_html__('Background Color', 'shopbuilder'),
151 'type' => 'color',
152
153 'selectors' => [
154 $selector['module_bg_color_normal'] => 'background-color: {{VALUE}};',
155 ],
156 ],
157
158 'module_border' => [
159 'mode' => 'group',
160 'type' => 'border',
161 'selector' => $selector['module_border'],
162 'size_units' => ['px'],
163 ],
164 'module_normal_end' => [
165 'mode' => 'tab_end',
166 ],
167 'module_hover' => [
168 'mode' => 'tab_start',
169 'label' => esc_html__('Hover', 'shopbuilder'),
170 ],
171 'module_text_color_hover' => [
172 'label' => esc_html__('Color', 'shopbuilder'),
173 'type' => 'color',
174
175 'separator' => 'default',
176 'selectors' => [
177 $selector['module_text_color_hover'] => 'color: {{VALUE}};',
178 ],
179 ],
180 'module_bg_color_hover' => [
181 'label' => esc_html__('Background Color', 'shopbuilder'),
182 'type' => 'color',
183
184 'selectors' => [
185 $selector['module_bg_color_hover'] => 'background-color: {{VALUE}};',
186 ],
187 ],
188 'module_border_hover_color' => [
189 'label' => esc_html__('Border Color', 'shopbuilder'),
190 'type' => 'color',
191
192 'selectors' => [
193 $selector['module_border_hover_color'] => 'border-color: {{VALUE}};',
194 ],
195 ],
196 'module_hover_end' => [
197 'mode' => 'tab_end',
198 ],
199 'module_tabs_end' => [
200 'mode' => 'tabs_end',
201 ],
202 'module_border_radius' => [
203 'label' => esc_html__('Border Radius (px)', 'shopbuilder'),
204 'type' => 'dimensions',
205 'separator' => 'before',
206 'size_units' => ['px'],
207 'selectors' => [
208 $selector['module_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
209 ],
210 ],
211
212 'icon_size' => [
213 'label' => esc_html__('Icon Size', 'shopbuilder'),
214 'type' => 'slider',
215 'separator' => 'before',
216 'range' => [
217 'px' => [
218 'min' => 10,
219 'max' => 200,
220 ],
221 ],
222 'default' => [
223 'size' => 15,
224 ],
225 'selectors' => [
226 $selector['icon_size'] => 'font-size: {{SIZE}}{{UNIT}};',
227 ],
228 ],
229 'module_wrapper_margin' => [
230 'label' => esc_html__('Module Wrapper Gap (px)', 'shopbuilder'),
231 'type' => 'dimensions',
232 'size_units' => ['px'],
233 'selectors' => [
234 $selector['module_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
235 ],
236 ],
237 'module_section_end' => [
238 'mode' => 'section_end',
239 ],
240 ];
241 }
242 return $fields;
243 }
244 /**
245 * Widget Field
246 *
247 * @return array
248 */
249 public static function module_switch()
250 {
251 $fields = [] ;
252 if (Fns::is_module_active('wishlist')) {
253 $fields['wishlist_button'] = [
254 'type' => 'switch',
255 'label' => esc_html__('Show Product Wishlist?', 'shopbuilder'),
256 'description' => esc_html__('Switch on to show product wishlist.', 'shopbuilder'),
257 'default' => 'yes',
258 ];
259 }
260 if( Fns::is_module_active('compare') ){
261 $fields['comparison_button'] = [
262 'type' => 'switch',
263 'label' => esc_html__( 'Show Product Comparison?', 'shopbuilder' ),
264 'description' => esc_html__( 'Switch on to show product comparison.', 'shopbuilder' ),
265 'default' => 'yes',
266 ];
267 }
268 if( Fns::is_module_active('quick_view') ) {
269 $fields['quick_view_button'] = [
270 'type' => 'switch',
271 'label' => esc_html__('Show Product Quick View?', 'shopbuilder'),
272 'description' => esc_html__('Switch on to show product quick view.', 'shopbuilder'),
273 'default' => 'yes',
274 ];
275 }
276 return $fields;
277 }
278 /**
279 * Widget Field
280 *
281 * @return array
282 */
283 public static function module_icons() {
284 $module_btn_active = Fns::is_module_active('wishlist') || Fns::is_module_active('compare') || Fns::is_module_active('quick_view');
285 $fields = [];
286 if( $module_btn_active ){
287 if( Fns::is_module_active('wishlist') ){
288 $fields['wishlist_icon'] = [
289 'label' => esc_html__( 'Wishlist Icon', 'shopbuilder' ),
290 'type' => 'icons',
291 'separator' => 'default',
292 'default' => [
293 'value' => 'far fa-heart',
294 'library' => 'fa-solid',
295 ],
296 'condition' => [
297 'wishlist_button' => 'yes',
298 ],
299 ];
300 $fields['wishlist_icon_added'] = [
301 'label' => esc_html__( 'After Added Wishlist Icon', 'shopbuilder' ),
302 'type' => 'icons',
303 'default' => [
304 'value' => 'fas fa-heart',
305 'library' => 'fa-solid',
306 ],
307 'condition' => [
308 'wishlist_button' => 'yes',
309 ],
310 ];
311 }
312 if( Fns::is_module_active('compare') ){
313 $fields['comparison_icon'] = [
314 'label' => esc_html__( 'Compare Icon', 'shopbuilder' ),
315 'type' => 'icons',
316 'default' => [
317 'value' => 'fas fa-compress',
318 'library' => 'fa-solid',
319 ],
320 'condition' => [
321 'comparison_button' => 'yes',
322 ],
323 ];
324 $fields['comparison_icon_added'] = [
325 'label' => esc_html__( 'After Added Compare Icon', 'shopbuilder' ),
326 'type' => 'icons',
327 'default' => [
328 'value' => 'fas fa-check',
329 'library' => 'fa-solid',
330 ],
331 'condition' => [
332 'comparison_button' => 'yes',
333 ],
334 ];
335 }
336 if( Fns::is_module_active('quick_view') ){
337 $fields['quick_view_icon'] = [
338 'label' => esc_html__( 'Quick View Icon', 'shopbuilder' ),
339 'type' => 'icons',
340 'default' => [
341 'value' => 'far fa-eye',
342 'library' => 'fa-solid',
343 ],
344 'condition' => [
345 'quick_view_button' => 'yes',
346 ],
347 ];
348 }
349 }
350 return $fields;
351 }
352
353
354 }
355