get_control( 'botiga_product_catalog_tabs' ) ) { $controls_general = json_decode( $wp_customize->get_control( 'botiga_product_catalog_tabs' )->controls_general ); $new_controls_general = array( '#customize-control-shop_archive_header_cats_includes_brands' ); $wp_customize->get_control( 'botiga_product_catalog_tabs' )->controls_general = json_encode( array_merge( $controls_general, $new_controls_general ) ); } // Display brands with categories $wp_customize->add_setting( 'shop_archive_header_cats_includes_brands', array( 'default' => 0, 'sanitize_callback' => 'botiga_sanitize_checkbox', ) ); $wp_customize->add_control( new Botiga_Toggle_Control( $wp_customize, 'shop_archive_header_cats_includes_brands', array( 'label' => esc_html__( 'Include Brands On Categories', 'botiga' ), 'description' => esc_html__( 'Check to filter and display product brands along with product categories', 'botiga' ), 'section' => 'woocommerce_product_catalog', 'active_callback' => array( $this, 'is_bp' ), 'priority' => 22 ) ) ); /** * Single Product */ // Tabs control $controls_general = json_decode( $wp_customize->get_control( 'botiga_single_product_layout_tabs' )->controls_general ); $new_controls_general = array( '#customize-control-botiga_wc_brands_brand_image_width', '#customize-control-botiga_wc_brands_brand_image_height' ); $wp_customize->get_control( 'botiga_single_product_layout_tabs' )->controls_general = json_encode( array_merge( $controls_general, $new_controls_general ) ); // Brand image width $wp_customize->add_setting( 'botiga_wc_brands_brand_image_width', array( 'default' => 65, 'sanitize_callback' => 'botiga_sanitize_text', ) ); $wp_customize->add_control( new Botiga_Responsive_Slider( $wp_customize, 'botiga_wc_brands_brand_image_width', array( 'label' => esc_html__( 'Brand Image Width', 'botiga' ), 'section' => 'botiga_section_single_product_layout', 'active_callback' => array( $this, 'is_brand_element_active' ), 'is_responsive' => 0, 'settings' => array ( 'size_desktop' => 'botiga_wc_brands_brand_image_width', ), 'input_attrs' => array ( 'min' => 0, 'max' => 300, 'step' => 1 ), 'priority' => 91 ) ) ); // Brand image height $wp_customize->add_setting( 'botiga_wc_brands_brand_image_height', array( 'default' => 65, 'sanitize_callback' => 'botiga_sanitize_text', ) ); $wp_customize->add_control( new Botiga_Responsive_Slider( $wp_customize, 'botiga_wc_brands_brand_image_height', array( 'label' => esc_html__( 'Brand Image Height', 'botiga' ), 'section' => 'botiga_section_single_product_layout', 'active_callback' => array( $this, 'is_brand_element_active' ), 'is_responsive' => 0, 'settings' => array ( 'size_desktop' => 'botiga_wc_brands_brand_image_height', ), 'input_attrs' => array ( 'min' => 0, 'max' => 300, 'step' => 1 ), 'priority' => 91 ) ) ); } } // Initialize the class new Botiga_WC_Brands(); /** * Single product elements 'Brand' output * */ function botiga_wc_brands_brand() { $width = get_theme_mod( 'botiga_wc_brands_brand_image_width', 65 ); $height = get_theme_mod( 'botiga_wc_brands_brand_image_height', 65 ); echo '