PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.0.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.0.0
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 / product-title / product-title.php
shopengine / widgets / product-title Last commit date
product-title-config.php 5 years ago product-title.php 5 years ago
product-title.php
137 lines
1 <?php
2
3 namespace Elementor;
4
5 defined('ABSPATH') || exit;
6
7 use ShopEngine\Core\Template_Cpt;
8 use ShopEngine\Widgets\Products;
9
10 class ShopEngine_Product_Title extends \ShopEngine\Base\Widget
11 {
12
13 public function config() {
14 return new ShopEngine_Product_Title_Config();
15 }
16
17 protected function register_controls() {
18
19 $this->start_controls_section(
20 'shopengine_section_product_title_style',
21 array(
22 'label' => esc_html__('Product Title', 'shopengine'),
23 'tab' => Controls_Manager::TAB_STYLE,
24 )
25 );
26
27 $this->add_control(
28 'shopengine_product_title_header_size',
29 [
30 'label' => esc_html__('HTML Tag', 'shopengine'),
31 'type' => Controls_Manager::SELECT,
32 'options' => [
33 'h1' => 'H1',
34 'h2' => 'H2',
35 'h3' => 'H3',
36 'h4' => 'H4',
37 'h5' => 'H5',
38 'h6' => 'H6',
39 'div' => 'div',
40 'span' => 'span',
41 'p' => 'p',
42 ],
43 'default' => 'h1',
44 'selectors' => [
45 '{{WRAPPER}} .product-title' => 'margin: 0; padding: 0;',
46 ],
47 ]
48 );
49
50 $this->add_responsive_control(
51 'shopengine_product_title_align',
52 \ShopEngine\Utils\Controls_Helper::get_alignment_conf()
53 );
54
55 $this->add_control(
56 'shopengine_product_title_product_title_color',
57 [
58 'label' => esc_html__('Title Color', 'shopengine'),
59 'type' => Controls_Manager::COLOR,
60 'default' => '#000000',
61 'alpha' => false,
62 'selectors' => [
63 '{{WRAPPER}} .product-title' => 'color: {{VALUE}};',
64 ],
65 ]
66 );
67
68 $this->add_group_control(
69 Group_Control_Typography::get_type(),
70 array(
71 'name' => 'shopengine_product_title_typography',
72 'label' => esc_html__('Typography', 'shopengine'),
73 'selector' => '{{WRAPPER}} .product-title',
74 'exclude' => ['text_decoration'],
75 'fields_options' => [
76 'typography' => [
77 'default' => 'custom',
78 ],
79 'font_weight' => [
80 'default' => '700',
81 ],
82 'font_size' => [
83 'label' => esc_html__('Font Size (px)', 'shopengine'),
84 'default' => [
85 'size' => '24',
86 'unit' => 'px'
87 ],
88 'size_units' => ['px'],
89 ],
90 'text_transform' => [
91 'default' => 'uppercase',
92 ],
93 'line_height' => [
94 'label' => esc_html__('Line Height (px)', 'shopengine'),
95 'default' => [
96 'size' => '24',
97 'unit' => 'px'
98 ],
99 'size_units' => ['px'],
100 'tablet_default' => [
101 'unit' => 'px',
102 ],
103 'mobile_default' => [
104 'unit' => 'px',
105 ],
106 ],
107 'letter_spacing' => [
108 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
109 'default' => [
110 'size' => '0.1',
111 ],
112 'size_units' => ['px'],
113 ],
114 ],
115 )
116 );
117
118 $this->end_controls_section();
119
120 }
121
122 protected function screen() {
123
124 $settings = $this->get_settings_for_display();
125
126 $post_type = get_post_type();
127
128 $product = Products::instance()->get_product($post_type);
129
130 echo sprintf(
131 '<div class="shopengine-product-title"><%1$s class="product-title">%2$s</%1$s></div>',
132 $settings['shopengine_product_title_header_size'],
133 get_the_title($product->get_id())
134 );
135 }
136 }
137