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.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 4 years ago product-title.php 2 years ago
product-title.php
148 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 'description' => esc_html__("The H1 tag is important for SEO, accessibility and usability, so ideally, you should have one on each page of your site. A H1 tag should describe what the content of the given page is all about", 'shopengine'),
33 'options' => [
34 'h1' => 'H1',
35 'h2' => 'H2',
36 'h3' => 'H3',
37 'h4' => 'H4',
38 'h5' => 'H5',
39 'h6' => 'H6',
40 'div' => 'Div',
41 'span' => 'Span',
42 'p' => 'P',
43 ],
44 'default' => 'h1',
45 'prefix_class' => 'shopengine_product_title_',
46 'selectors' => [
47 '{{WRAPPER}} .product-title' => 'margin: 0; padding: 0;',
48 ],
49 ]
50 );
51
52 $this->add_responsive_control(
53 'shopengine_product_title_align',
54 \ShopEngine\Utils\Controls_Helper::get_alignment_conf(
55 'shopengine-product-title-align-',
56 '',
57 [
58 '{{WRAPPER}} .shopengine-product-title' => 'text-align: {{VALUE}};',
59 '.rtl {{WRAPPER}}.shopengine-product-title-align-left .shopengine-product-title' => 'text-align:right;',
60 '.rtl {{WRAPPER}}.shopengine-product-title-align-right .shopengine-product-title' => 'text-align:left;',
61 ]
62 )
63 );
64
65 $this->add_control(
66 'shopengine_product_title_product_title_color',
67 [
68 'label' => esc_html__('Title Color', 'shopengine'),
69 'type' => Controls_Manager::COLOR,
70 'default' => '#000000',
71 'alpha' => false,
72 'selectors' => [
73 '{{WRAPPER}} .product-title' => 'color: {{VALUE}};',
74 ],
75 ]
76 );
77
78 $this->add_group_control(
79 Group_Control_Typography::get_type(),
80 array(
81 'name' => 'shopengine_product_title_typography',
82 'label' => esc_html__('Typography', 'shopengine'),
83 'selector' => '{{WRAPPER}} .product-title',
84 'exclude' => ['text_decoration'],
85 'fields_options' => [
86 'typography' => [
87 'default' => 'custom',
88 ],
89 'font_weight' => [
90 'default' => '700',
91 ],
92 'font_size' => [
93 'label' => esc_html__('Font Size (px)', 'shopengine'),
94 'default' => [
95 'size' => '24',
96 'unit' => 'px'
97 ],
98 'size_units' => ['px'],
99 ],
100 'text_transform' => [
101 'default' => 'uppercase',
102 ],
103 'line_height' => [
104 'label' => esc_html__('Line Height (px)', 'shopengine'),
105 'default' => [
106 'size' => '24',
107 'unit' => 'px'
108 ],
109 'size_units' => ['px'],
110 'tablet_default' => [
111 'unit' => 'px',
112 ],
113 'mobile_default' => [
114 'unit' => 'px',
115 ],
116 ],
117 'letter_spacing' => [
118 'label' => esc_html__('Letter Spacing (px)', 'shopengine'),
119 'default' => [
120 'size' => '0.1',
121 ],
122 'size_units' => ['px'],
123 ],
124 ],
125 )
126 );
127
128 $this->end_controls_section();
129 }
130
131 protected function screen() {
132
133 $settings = $this->get_settings_for_display();
134
135 $post_type = get_post_type();
136
137 $product = Products::instance()->get_product($post_type);
138
139 shopengine_content_render(
140 sprintf(
141 '<div class="shopengine-product-title"><%1$s class="product-title">%2$s</%1$s></div>',
142 isset( $settings['shopengine_product_title_header_size'] ) ? $settings['shopengine_product_title_header_size'] : 'h1',
143 get_the_title($product->get_id())
144 )
145 );
146 }
147 }
148