PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.6.9
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.6.9
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 / view-single-product / view-single-product.php
shopengine / widgets / view-single-product Last commit date
view-single-product-config.php 4 years ago view-single-product.php 3 years ago
view-single-product.php
322 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9 class ShopEngine_View_Single_Product extends \ShopEngine\Base\Widget {
10
11 public function config() {
12 return new ShopEngine_View_Single_Product_Config();
13 }
14
15 protected function register_controls() {
16 $this->start_controls_section(
17 'shopengine_settings_section',
18 [
19 'label' => esc_html__('Button', 'shopengine'),
20 'tab' => Controls_Manager::TAB_STYLE,
21 ]
22 );
23
24 $this->add_control(
25 'shopengine_button_title',
26 [
27 'label' => esc_html__('Button Title', 'shopengine'),
28 'type' => Controls_Manager::TEXT,
29 'default' => esc_html__('View Full Info', 'shopengine')
30 ]
31 );
32
33 $this->add_control(
34 'shopengine_button_align',
35 [
36 'label' => esc_html__('Button Alignment', 'shopengine'),
37 'type' => Controls_Manager::CHOOSE,
38 'options' => [
39 'left' => [
40 'title' => esc_html__('Left', 'shopengine'),
41 'icon' => 'eicon-text-align-left',
42 ],
43 'center' => [
44 'title' => esc_html__('Center', 'shopengine'),
45 'icon' => 'eicon-text-align-center',
46 ],
47 'right' => [
48 'title' => esc_html__('Right', 'shopengine'),
49 'icon' => 'eicon-text-align-right',
50 ],
51 ],
52 'prefix_class' => 'elementor-align-',
53 'selectors' => [
54 '{{WRAPPER}} .shopengine-view-single-product .view-single-product' => 'text-align: {{VALUE}};',
55 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-view-single-product .view-single-product' => 'text-align: left;',
56 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-view-single-product .view-single-product' => 'text-align: right;',
57 ],
58 ]
59 );
60
61 $this->add_group_control(
62 Group_Control_Typography::get_type(),
63 [
64 'name' => 'shopengine_typography_primary',
65 'label' => esc_html__('Typography', 'shopengine'),
66 'exclude' => ['letter_spacing','font_style', 'text_style', 'text_decoration'],
67 'fields_options' => [
68 'typography' => [
69 'default' => 'custom',
70 ],
71 'font_weight' => [
72 'default' => '600',
73 ],
74 'font_size' => [
75 'label' => esc_html__('Font Size (px)', 'shopengine'),
76 'size_units' => ['px'],
77 'default' => [
78 'size' => '15',
79 'unit' => 'px',
80 ],
81 ],
82 'line_height' => [
83 'size_units' => ['px'],
84 'label' => 'Line Height (px)',
85 'responsive' => false,
86 ]
87 ],
88 'selector' => '{{WRAPPER}} .shopengine-view-single-product .button',
89 ]
90 );
91
92 $this->start_controls_tabs('shopengine_button_tabs_style');
93
94 $this->start_controls_tab(
95 'shopengine_button_tabnormal',
96 [
97 'label' => esc_html__('Normal', 'shopengine'),
98 ]
99 );
100
101 $this->add_control(
102 'shopengine_button_text_color',
103 [
104 'label' => esc_html__('Text Color', 'shopengine'),
105 'type' => Controls_Manager::COLOR,
106 'alpha' => false,
107 'default' => '#ffffff',
108 'selectors' => [
109 '{{WRAPPER}} .shopengine-view-single-product .button' => 'color: {{VALUE}} !important;',
110 ],
111 ]
112 );
113
114 $this->add_control(
115 'shopengine_button_text_bg_color',
116 [
117 'label' => esc_html__('Background Color', 'shopengine'),
118 'type' => Controls_Manager::COLOR,
119 'alpha' => false,
120 'default' => '#101010',
121 'selectors' => [
122 '{{WRAPPER}} .shopengine-view-single-product .button' => 'background-color: {{VALUE}} !important;',
123 ],
124 ]
125 );
126
127
128 $this->add_group_control(
129 Group_Control_Border::get_type(),
130 [
131 'name' => 'shopengine_input_border',
132 'label' => esc_html__('Border', 'shopengine'),
133 'fields_options' => [
134 'border' => [
135 'default' => 'solid',
136 'responsive' => false,
137 'selectors' => [
138 '{{WRAPPER}} .shopengine-view-single-product .button' => 'border-style: {{VALUE}} !important;',
139 ],
140 ],
141
142 'width' => [
143 'label' => esc_html__('Border Width', 'shopengine'),
144 'default' => [
145 'top' => '1',
146 'right' => '1',
147 'bottom' => '1',
148 'left' => '1',
149 'unit' => 'px',
150 ],
151 'selectors' => [
152 '{{WRAPPER}} .shopengine-view-single-product .button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
153 '.rtl {{WRAPPER}} .shopengine-view-single-product .button' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
154 ],
155 'responsive' => false,
156 ],
157
158 'color' => [
159 'label' => esc_html__('Border Color', 'shopengine'),
160 'alpha' => false,
161 'responsive' => false,
162 'selectors' => [
163 '{{WRAPPER}} .shopengine-view-single-product .button' => 'border-color: {{VALUE}} !important;',
164 ],
165 ],
166
167 ],
168 ]
169 );
170
171 $this->end_controls_tab();
172
173 $this->start_controls_tab(
174 'shopengine_button_tab_button_hover',
175 [
176 'label' => esc_html__('Hover', 'shopengine'),
177 ]
178 );
179
180 $this->add_control(
181 'shopengine_button_hover_color',
182 [
183 'label' => esc_html__('Text Color', 'shopengine'),
184 'type' => Controls_Manager::COLOR,
185 'default' => '#ffffff',
186 'alpha' => false,
187 'selectors' => [
188 '{{WRAPPER}} .shopengine-view-single-product .button:hover' => 'color: {{VALUE}} !important;',
189 ],
190 ]
191 );
192
193
194 $this->add_control(
195 'shopengine_button_hover_bg_color',
196 [
197 'label' => esc_html__('Background Color', 'shopengine'),
198 'type' => Controls_Manager::COLOR,
199 'default' => '#000000',
200 'alpha' => false,
201 'selectors' => [
202 '{{WRAPPER}} .shopengine-view-single-product .button:hover' => 'background-color: {{VALUE}} !important;',
203 ],
204 ]
205 );
206
207
208 $this->add_group_control(
209 Group_Control_Border::get_type(),
210 [
211 'name' => 'shopengine_input_border_hover',
212 'label' => esc_html__('Border', 'shopengine'),
213 'fields_options' => [
214 'border' => [
215 'default' => 'solid',
216 'responsive' => false,
217 'selectors' => [
218 '{{WRAPPER}} .shopengine-view-single-product .button:hover' => 'border-style: {{VALUE}} !important;',
219 ],
220 ],
221
222 'width' => [
223 'label' => esc_html__('Border Width', 'shopengine'),
224 'default' => [
225 'top' => '1',
226 'right' => '1',
227 'bottom' => '1',
228 'left' => '1',
229 'unit' => 'px',
230 ],
231 'selectors' => [
232 '{{WRAPPER}} .shopengine-view-single-product .button:hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
233 '.rtl {{WRAPPER}} .shopengine-view-single-product .button:hover' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
234 ],
235 'responsive' => false,
236 ],
237
238 'color' => [
239 'label' => esc_html__('Border Color', 'shopengine'),
240 'alpha' => false,
241 'responsive' => false,
242 'selectors' => [
243 '{{WRAPPER}} .shopengine-view-single-product .button:hover' => 'border-color: {{VALUE}} !important;',
244 ],
245 ],
246
247 ],
248 ]
249 );
250
251 $this->end_controls_tab();
252 $this->end_controls_tabs();
253
254 $this->add_control(
255 'shopengine_button_border_radius',
256 [
257 'label' => esc_html__('Border Radius', 'shopengine'),
258 'type' => Controls_Manager::DIMENSIONS,
259 'size_units' => ['px'],
260 'default' => [
261 'unit' => 'px',
262 'top' => 3,
263 'right' => 3,
264 'bottom' => 3,
265 'left' => 3,
266 'isLinked' => true
267 ],
268 'separator' => 'before',
269 'selectors' => [
270 '{{WRAPPER}} .shopengine-view-single-product .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
271 '.rtl {{WRAPPER}} .shopengine-view-single-product .button' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
272 ],
273 ]
274 );
275
276 $this->add_control(
277 'shopengine_button_text_padding',
278 [
279 'label' => esc_html__('Padding', 'shopengine'),
280 'type' => Controls_Manager::DIMENSIONS,
281 'size_units' => ['px'],
282 'default' => [
283 'top' => '15',
284 'right' => '20',
285 'bottom' => '16',
286 'left' => '20',
287 'unit' => 'px',
288 'isLinked' => false,
289 ],
290 'selectors' => [
291 '{{WRAPPER}} .shopengine-view-single-product .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
292 '.rtl {{WRAPPER}} .shopengine-view-single-product .button' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
293 ],
294 ]
295 );
296
297 $this->add_group_control(
298 Group_Control_Box_Shadow::get_type(),
299 [
300 'name' => 'shopengine_button_box_shadow_group',
301 'selector' => '{{WRAPPER}} .shopengine-view-single-product .button',
302 ]
303 );
304
305 $this->end_controls_section();
306 }
307
308 protected function screen() {
309 $settings = $this->get_settings_for_display();
310 $product = Products::instance()->get_product(get_post_type());
311 ?>
312 <div class="shopengine-view-single-product">
313 <p class="view-single-product">
314 <a title="<?php esc_html_e('View Product Full Details','shopengine')?>" class="button" href="<?php echo esc_url($product->get_permalink()); ?>">
315 <?php echo esc_html($settings['shopengine_button_title']);?>
316 </a>
317 </p>
318 </div>
319 <?php
320 }
321 }
322