PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.8.7
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.8.7
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 / additional-information / additional-information.php
shopengine / widgets / additional-information Last commit date
screens 3 years ago additional-information-config.php 4 years ago additional-information.php 3 years ago
additional-information.php
225 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9
10 class ShopEngine_Additional_Information extends \ShopEngine\Base\Widget
11 {
12
13 public function config() {
14 return new ShopEngine_Additional_Information_Config();
15 }
16
17 protected function register_controls() {
18
19 $this->start_controls_section(
20 'shopengine_section_product_additional_information_common',
21 array(
22 'label' => esc_html__('Common', 'shopengine'),
23 'tab' => Controls_Manager::TAB_STYLE,
24 )
25 );
26
27
28 $this->add_responsive_control(
29 'shopengine_product_additional_information_table_cell_padding',
30 [
31 'label' => esc_html__('Table Cell Padding', 'shopengine'),
32 'type' => Controls_Manager::DIMENSIONS,
33 'default' => [
34 'top' => '15',
35 'right' => '35',
36 'bottom' => '15',
37 'left' => '35',
38 'unit' => 'px',
39 'isLinked' => false,
40 ],
41 'size_units' => ['px'],
42 'selectors' => [
43 '{{WRAPPER}} .shopengine-additional-information tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
44 '.rtl {{WRAPPER}} .shopengine-additional-information tr td' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}; text-align:right;',
45 '{{WRAPPER}} .shopengine-additional-information tr th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
46 '.rtl {{WRAPPER}} .shopengine-additional-information tr th' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};text-align:right;',
47 ],
48 ]
49 );
50 $this->add_group_control(
51 Group_Control_Typography::get_type(),
52 array(
53 'name' => 'shopengine_product_additional_information_label_typography',
54 'label' => esc_html__('Typography', 'shopengine'),
55 'selector' => '{{WRAPPER}} .shopengine-additional-information tr :is(td, th, p) ',
56 'exclude' => ['text_transform', 'text_decoration', 'line_height', 'text_style', 'letter_spacing'],
57 'fields_options' => [
58 'typography' => [
59 'default' => 'custom',
60 ],
61 'font_size' => [
62 'label' => esc_html__('Font Size (px)', 'shopengine'),
63 'size_units' => ['px'],
64 'default' => [
65 'size' => '16',
66 'unit' => 'px',
67 ],
68 ],
69 'font_weight' => [
70 'default' => '400',
71 ],
72 'text_transform' => [
73 'default' => 'capitalize',
74 ],
75 'font_style' => [
76 'default' => 'normal',
77 ],
78 'line_height' => [
79 'default' => [
80 'size' => '19',
81 'unit' => 'px',
82 ],
83 ],
84 'letter_spacing' => [
85 'default' => [
86 'size' => '0',
87 ],
88 ],
89 ],
90 )
91 );
92
93 $this->add_control(
94 'shopengine_product_additional_information_separator_color',
95 [
96 'label' => esc_html__('Separator Color', 'shopengine'),
97 'type' => Controls_Manager::COLOR,
98 'alpha' => false,
99 'selectors' => [
100 '{{WRAPPER}} .shopengine-additional-information .shop_attributes tr:not(:last-child),
101 {{WRAPPER}} .shopengine-additional-information table.shop_attributes tr td,
102 {{WRAPPER}} .shopengine-additional-information table.shop_attributes tr th' => 'border-color: {{VALUE}};',
103 ],
104 ]
105 );
106
107 $this->end_controls_section();
108
109
110 $this->start_controls_section(
111 'shopengine_section_product_additional_information_label',
112 array(
113 'label' => esc_html__('Label', 'shopengine'),
114 'tab' => Controls_Manager::TAB_STYLE,
115 )
116 );
117
118 $this->add_control(
119 'shopengine_product_additional_information_label_color',
120 [
121 'label' => esc_html__('Color', 'shopengine'),
122 'type' => Controls_Manager::COLOR,
123 'default' => '#888888',
124 'alpha' => false,
125 'selectors' => [
126 '{{WRAPPER}} .shopengine-additional-information tr th' => 'color: {{VALUE}};',
127 ],
128 ]
129 );
130
131 $this->add_control(
132 'shopengine_product_additional_information_label_bg_color',
133 [
134 'label' => esc_html__('Background', 'shopengine'),
135 'type' => Controls_Manager::COLOR,
136 'default' => '#f8f8f8',
137 'alpha' => false,
138 'selectors' => [
139 '{{WRAPPER}} .shopengine-additional-information tr th' => 'background: {{VALUE}};',
140 ],
141 ]
142 );
143
144
145
146 $this->add_responsive_control(
147 'shopengine_product_additional_information_label_width',
148 [
149 'label' => esc_html__('Width', 'shopengine'),
150 'type' => Controls_Manager::SLIDER,
151 'size_units' => ['px', '%'],
152 'range' => [
153 'px' => [
154 'min' => 0,
155 'max' => 1000,
156 'step' => 5,
157 ],
158 '%' => [
159 'min' => 0,
160 'max' => 100,
161 ],
162 ],
163 'default' => [
164 'unit' => '%',
165 'size' => 25,
166 ],
167 'selectors' => [
168 '{{WRAPPER}} .shopengine-additional-information tr th' => 'width: {{SIZE}}{{UNIT}};',
169 ],
170 ]
171 );
172
173 $this->end_controls_section();
174
175 $this->start_controls_section(
176 'shopengine_section_product_additional_information_value',
177 array(
178 'label' => esc_html__('Value', 'shopengine'),
179 'tab' => Controls_Manager::TAB_STYLE,
180 )
181 );
182
183 $this->add_control(
184 'shopengine_product_additional_information_value_color',
185 [
186 'label' => esc_html__('Color', 'shopengine'),
187 'type' => Controls_Manager::COLOR,
188 'default' => '#101010',
189 'alpha' => false,
190 'selectors' => [
191 '{{WRAPPER}} .shopengine-additional-information tr td p' => 'color: {{VALUE}};',
192 ],
193 ]
194 );
195
196 $this->add_control(
197 'shopengine_product_additional_information_value_bg_color',
198 [
199 'label' => esc_html__('Background', 'shopengine'),
200 'type' => Controls_Manager::COLOR,
201 'default' => '#fdfdfd',
202 'alpha' => false,
203 'selectors' => [
204 '{{WRAPPER}} .shopengine-additional-information tr td' => 'background: {{VALUE}};',
205 ],
206 ]
207 );
208
209 $this->end_controls_section();
210 }
211
212 protected function screen() {
213
214 $settings = $this->get_settings_for_display();
215
216 $post_type = get_post_type();
217
218 $product = Products::instance()->get_product($post_type);
219
220 $tpl = Products::instance()->get_widget_template($this->get_name());
221
222 include $tpl;
223 }
224 }
225