PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Single / ProductMeta.php

ProductMeta.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.4, at app/Elementor/Widgets/Single/ProductMeta.php

93 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductMeta class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Single;
9
10 use Elementor\Controls_Manager;
11 use RadiusTheme\SB\Helpers\Fns;
12 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
13 use RadiusTheme\SB\Elementor\Widgets\Controls\MetaSettings;
14 use RadiusTheme\SB\Elementor\Widgets\Controls\ProductTaxSettings;
15
16 // Do not allow directly accessing this file.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit( 'This script cannot be accessed directly.' );
19 }
20
21 /**
22 * Product Meta class
23 */
24 class ProductMeta extends ElementorWidgetBase {
25 /**
26 * Construct function
27 *
28 * @param array $data default array.
29 * @param mixed $args default arg.
30 */
31 public function __construct( $data = [], $args = null ) {
32 $this->rtsb_name = esc_html__( 'Product Meta', 'shopbuilder' );
33 $this->rtsb_base = 'rtsb-product-meta';
34 parent::__construct( $data, $args );
35 }
36 /**
37 * Widget Field
38 *
39 * @return array
40 */
41 public function widget_fields() {
42 $fields = MetaSettings::widget_fields( $this );
43 $tax_settings = ProductTaxSettings::widget_fields( $this );
44 $tax_settings['meta_content']['tab'] = 'style';
45 $fields = $fields + $tax_settings;
46 unset( $fields['show_label'] );
47 unset( $fields['meta_label_heading']['condition'] );
48 unset( $fields['label_typo']['condition'] );
49 unset( $fields['meta_label_color']['condition'] );
50 return apply_filters( 'rtsb/elements/elementor/single/' . $this->rtsb_base, $fields, $this );
51 }
52 /**
53 * Set Widget Keyword.
54 *
55 * @return array
56 */
57 public function get_keywords() {
58 return [ 'SKU', 'Category', 'Tag' ] + parent::get_keywords();
59 }
60 /**
61 * Render Function
62 *
63 * @return void
64 */
65 protected function render() {
66 global $product;
67 $_product = $product;
68 $product = Fns::get_product();
69 $controllers = $this->get_settings_for_display();
70 $this->theme_support();
71 // show_sku.
72 $classes = '';
73 if ( ! empty( $controllers['show_sku'] ) ) {
74 $classes .= 'rtsb-show-sku ';
75 }
76 if ( ! empty( $controllers['show_cat'] ) ) {
77 $classes .= 'rtsb-show-cat ';
78 }
79 if ( ! empty( $controllers['show_tag'] ) ) {
80 $classes .= 'rtsb-show-tag ';
81 }
82 $data = [
83 'template' => 'elementor/single-product/meta',
84 'controllers' => $controllers,
85 'classes' => $classes,
86 ];
87 Fns::load_template( $data['template'], $data );
88 $this->theme_support( 'render_reset' );
89 $product = $_product; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
90 }
91
92 }
93