PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.9.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.9.2
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / return-to-shop / return-to-shop.php
shopengine / widgets / return-to-shop Last commit date
screens 3 years ago return-to-shop-config.php 2 years ago return-to-shop.php 3 years ago
return-to-shop.php
320 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9 class ShopEngine_Return_To_Shop extends \ShopEngine\Base\Widget
10 {
11
12 public function config() {
13 return new ShopEngine_Return_To_Shop_Config();
14 }
15
16
17 protected function register_controls() {
18 $this->start_controls_section(
19 'shopengine_settings_section',
20 [
21 'label' => esc_html__('Button', 'shopengine'),
22 'tab' => Controls_Manager::TAB_STYLE,
23 ]
24 );
25
26 $this->add_control(
27 'shopengine_button_align',
28 [
29 'label' => esc_html__('Button Alignment', 'shopengine'),
30 'type' => Controls_Manager::CHOOSE,
31 'options' => [
32 'left' => [
33 'title' => esc_html__('Left', 'shopengine'),
34 'icon' => 'eicon-text-align-left',
35 ],
36 'center' => [
37 'title' => esc_html__('Center', 'shopengine'),
38 'icon' => 'eicon-text-align-center',
39 ],
40 'right' => [
41 'title' => esc_html__('Right', 'shopengine'),
42 'icon' => 'eicon-text-align-right',
43 ],
44 ],
45 'selectors' => [
46 '{{WRAPPER}} .shopengine-return-to-shop .return-to-shop' => 'text-align: {{VALUE}};',
47 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-return-to-shop .return-to-shop' => 'text-align:right;',
48 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-return-to-shop .return-to-shop' => 'text-align:left;',
49 ],
50 'prefix_class' => 'elementor-align-',
51 ]
52 );
53
54 $this->add_group_control(
55 Group_Control_Typography::get_type(),
56 [
57 'name' => 'shopengine_typography_primary',
58 'label' => esc_html__('Typography', 'shopengine'),
59 'exclude' => ['letter_spacing','font_style', 'text_style', 'text_decoration'],
60 'fields_options' => [
61 'typography' => [
62 'default' => 'custom',
63 ],
64 'font_weight' => [
65 'default' => '600',
66 ],
67 'font_size' => [
68 'label' => esc_html__('Font Size (px)', 'shopengine'),
69 'size_units' => ['px'],
70 'default' => [
71 'size' => '15',
72 'unit' => 'px',
73 ],
74 ],
75 'line_height' => [
76 'size_units' => ['px'],
77 'label' => 'Line Height (px)',
78 'responsive' => false,
79 ]
80 ],
81 'selector' => '{{WRAPPER}} .shopengine-return-to-shop .button',
82 ]
83 );
84
85 $this->start_controls_tabs('shopengine_button_tabs_style');
86
87 $this->start_controls_tab(
88 'shopengine_button_tabnormal',
89 [
90 'label' => esc_html__('Normal', 'shopengine'),
91 ]
92 );
93
94 $this->add_control(
95 'shopengine_button_text_color',
96 [
97 'label' => esc_html__('Text Color', 'shopengine'),
98 'type' => Controls_Manager::COLOR,
99 'alpha' => false,
100 'default' => '#ffffff',
101 'selectors' => [
102 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'color: {{VALUE}} !important;',
103 ],
104 ]
105 );
106
107 $this->add_control(
108 'shopengine_button_text_bg_color',
109 [
110 'label' => esc_html__('Background Color', 'shopengine'),
111 'type' => Controls_Manager::COLOR,
112 'alpha' => false,
113 'default' => '#101010',
114 'selectors' => [
115 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'background-color: {{VALUE}} !important;',
116 ],
117 ]
118 );
119
120
121 $this->add_group_control(
122 Group_Control_Border::get_type(),
123 [
124 'name' => 'shopengine_input_border',
125 'label' => esc_html__('Border', 'shopengine'),
126 'fields_options' => [
127 'border' => [
128 'default' => 'solid',
129 'responsive' => false,
130 'selectors' => [
131 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'border-style: {{VALUE}} !important;',
132 ],
133 ],
134
135 'width' => [
136 'label' => esc_html__('Border Width', 'shopengine'),
137 'default' => [
138 'top' => '1',
139 'right' => '1',
140 'bottom' => '1',
141 'left' => '1',
142 'unit' => 'px',
143 ],
144 'selectors' => [
145 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
146 '.rtl {{WRAPPER}} .shopengine-return-to-shop .button' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
147 ],
148 'responsive' => false,
149 ],
150
151 'color' => [
152 'label' => esc_html__('Border Color', 'shopengine'),
153 'alpha' => false,
154 'responsive' => false,
155 'selectors' => [
156 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'border-color: {{VALUE}} !important;',
157 ],
158 ],
159
160 ],
161 ]
162 );
163
164 $this->end_controls_tab();
165
166 $this->start_controls_tab(
167 'shopengine_button_tab_button_hover',
168 [
169 'label' => esc_html__('Hover', 'shopengine'),
170 ]
171 );
172
173 $this->add_control(
174 'shopengine_button_hover_color',
175 [
176 'label' => esc_html__('Text Color', 'shopengine'),
177 'type' => Controls_Manager::COLOR,
178 'default' => '#ffffff',
179 'alpha' => false,
180 'selectors' => [
181 '{{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'color: {{VALUE}} !important;',
182 ],
183 ]
184 );
185
186
187 $this->add_control(
188 'shopengine_button_hover_bg_color',
189 [
190 'label' => esc_html__('Background Color', 'shopengine'),
191 'type' => Controls_Manager::COLOR,
192 'default' => '#000000',
193 'alpha' => false,
194 'selectors' => [
195 '{{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'background-color: {{VALUE}} !important;',
196 ],
197 ]
198 );
199
200
201 $this->add_group_control(
202 Group_Control_Border::get_type(),
203 [
204 'name' => 'shopengine_input_border_hover',
205 'label' => esc_html__('Border', 'shopengine'),
206 'fields_options' => [
207 'border' => [
208 'default' => 'solid',
209 'responsive' => false,
210 'selectors' => [
211 '{{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'border-style: {{VALUE}} !important;',
212 ],
213 ],
214
215 'width' => [
216 'label' => esc_html__('Border Width', 'shopengine'),
217 'default' => [
218 'top' => '1',
219 'right' => '1',
220 'bottom' => '1',
221 'left' => '1',
222 'unit' => 'px',
223 ],
224 'selectors' => [
225 '{{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
226 '.rtl {{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
227 ],
228 'responsive' => false,
229 ],
230
231 'color' => [
232 'label' => esc_html__('Border Color', 'shopengine'),
233 'alpha' => false,
234 'responsive' => false,
235 'selectors' => [
236 '{{WRAPPER}} .shopengine-return-to-shop .button:hover' => 'border-color: {{VALUE}} !important;',
237 ],
238 ],
239
240 ],
241 ]
242 );
243
244 $this->end_controls_tab();
245 $this->end_controls_tabs();
246
247 $this->add_control(
248 'shopengine_button_border_radius',
249 [
250 'label' => esc_html__('Border Radius', 'shopengine'),
251 'type' => Controls_Manager::DIMENSIONS,
252 'size_units' => ['px'],
253 'default' => [
254 'unit' => 'px',
255 'top' => 3,
256 'right' => 3,
257 'bottom' => 3,
258 'left' => 3,
259 'isLinked' => true
260 ],
261 'separator' => 'before',
262 'selectors' => [
263 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
264 '.rtl {{WRAPPER}} .shopengine-return-to-shop .button' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
265 ],
266 ]
267 );
268
269 $this->add_control(
270 'shopengine_button_text_padding',
271 [
272 'label' => esc_html__('Padding', 'shopengine'),
273 'type' => Controls_Manager::DIMENSIONS,
274 'size_units' => ['px'],
275 'default' => [
276 'top' => '15',
277 'right' => '20',
278 'bottom' => '16',
279 'left' => '20',
280 'unit' => 'px',
281 'isLinked' => false,
282 ],
283 'selectors' => [
284 '{{WRAPPER}} .shopengine-return-to-shop .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
285 '.rtl {{WRAPPER}} .shopengine-return-to-shop .button' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
286 ],
287 ]
288 );
289
290 //
291
292 $this->add_group_control(
293 Group_Control_Box_Shadow::get_type(),
294 [
295 'name' => 'shopengine_button_box_shadow_group',
296 'selector' => '{{WRAPPER}} .shopengine-return-to-shop .button',
297 ]
298 );
299
300 $this->end_controls_section();
301 }
302
303 /**
304 * Render widget output on the frontend.
305 *
306 * Written in PHP and used to generate the final HTML.
307 *
308 * @since 1.0.0
309 * @access protected
310 */
311 protected function screen() {
312
313 if(wc_get_page_id('shop') > 0) {
314
315 $tpl = Products::instance()->get_widget_template($this->get_name());
316
317 include $tpl;
318 }
319 }
320 }