PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.3
ShopBuilder – WooCommerce Builder For Elementor v1.1.3
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 / Controllers / PluginsSupport / RtwpvsSupport.php

RtwpvsSupport.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.3, at app/Controllers/PluginsSupport/RtwpvsSupport.php

63 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * RadiusTheme Variation Swatches support.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Controllers\PluginsSupport;
9
10 use RadiusTheme\SB\Traits\SingletonTrait;
11 use RadiusTheme\SB\Helpers\Fns;
12
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * Product Description class
20 */
21 class RtwpvsSupport {
22 /**
23 * SingletonTrait.
24 */
25 use SingletonTrait;
26
27 /**
28 * Construct function
29 */
30 private function __construct() {
31 add_filter( 'rtsb/elements/elementor/visibility_control', [ $this, 'general_content_visibility' ] );
32 }
33
34 /**
35 * Content Visibility
36 *
37 * @param array $fields Fields.
38 *
39 * @return array
40 */
41 public function general_content_visibility( $fields ) {
42 $extra_controls['show_swatches'] = [
43 'type' => 'switch',
44 'label' => esc_html__( 'Show Product Variation Swatches?', 'shopbuilder' ),
45 'description' => esc_html__( 'Switch on to show product variation swatches.', 'shopbuilder' ),
46 'label_on' => esc_html__( 'On', 'shopbuilder' ),
47 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
48 'default' => 'yes',
49 ];
50
51 $extra_controls['show_vs_clear_btn'] = [
52 'type' => 'switch',
53 'label' => esc_html__( 'Show Swatches Clear Button?', 'shopbuilder' ),
54 'description' => esc_html__( 'Switch on to show product variation swatches clear button.', 'shopbuilder' ),
55 'label_on' => esc_html__( 'On', 'shopbuilder' ),
56 'label_off' => esc_html__( 'Off', 'shopbuilder' ),
57 'condition' => [ 'show_swatches' => [ 'yes' ] ],
58 ];
59
60 return Fns::insert_controls( 'show_categories', $fields, $extra_controls, true );
61 }
62 }
63