PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.0.0
ShopBuilder – WooCommerce Builder For Elementor v1.0.0
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 / ProductCats.php

ProductCats.php in ShopBuilder – WooCommerce Builder For Elementor 1.0.0, at app/Elementor/Widgets/Single/ProductCats.php

66 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductCats class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Single;
9
10 use RadiusTheme\SB\Helpers\Fns;
11 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
12 use RadiusTheme\SB\Elementor\Widgets\Controls\ProductTaxSettings;
13
14 // Do not allow directly accessing this file.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit( 'This script cannot be accessed directly.' );
17 }
18
19 /**
20 * Product Categories class
21 */
22 class ProductCats extends ElementorWidgetBase {
23 /**
24 * Construct function
25 *
26 * @param array $data default array.
27 * @param mixed $args default arg.
28 */
29 public function __construct( $data = [], $args = null ) {
30 $this->rtsb_name = esc_html__( 'Product Categories', 'shopbuilder' );
31 $this->rtsb_base = 'rtsb-product-categories';
32 parent::__construct( $data, $args );
33 }
34
35 /**
36 * Widget Field
37 *
38 * @return array
39 */
40 public function widget_fields() {
41 $fields = ProductTaxSettings::widget_fields( $this );
42 return apply_filters( 'rtsb/elements/elementor/single/' . $this->rtsb_base, $fields, $this );
43 }
44
45 /**
46 * Render Function
47 *
48 * @return void
49 */
50 protected function render() {
51 global $product;
52 $_product = $product;
53 $product = Fns::get_product();
54 $controllers = $this->get_settings_for_display();
55 $this->theme_support();
56 $data = [
57 'template' => 'elementor/single-product/categories',
58 'controllers' => $controllers,
59 ];
60 Fns::load_template( $data['template'], $data );
61 $this->theme_support( 'render_reset' );
62 $product = $_product; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
63 }
64
65 }
66