'{{WRAPPER}} .eael-woo-collections:hover .eael-woo-collections-overlay-inner span' => 'color: {{VALUE}}', '{{WRAPPER}} .eael-woo-collections-layout-two .eael-woo-collections-overlay-inner span:hover' => 'color: {{VALUE}}', ], 'separator' => 'after', ] ); $this->end_controls_section(); /** * Badge Style */ $this->start_controls_section( 'eael_woo_collections_badge_style', [ 'label' => esc_html__('Badge', 'essential-addons-elementor'), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'eael_woo_collections_is_show_badge' => 'yes' ] ] ); $this->add_control( 'eael_woo_collections_badge_padding', [ 'label' => __('Padding', 'essential-addons-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .eael-woo-collection-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'eael_woo_collections_badge_radius', [ 'label' => __('Radius', 'essential-addons-elementor'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .eael-woo-collection-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'eael_woo_collections_badge_background', [ 'label' => __('Background Color', 'essential-addons-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eael-woo-collection-badge' => 'background: {{VALUE}}', ], ] ); $this->add_control( 'eael_woo_collections_badge_color', [ 'label' => __('Text Color', 'essential-addons-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eael-woo-collection-badge' => 'color: {{VALUE}}', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); if (!apply_filters('eael/is_plugin_active', 'woocommerce/woocommerce.php')) { return; } $term = []; if ($settings['eael_woo_collections_type'] == 'category' && $settings['eael_woo_collections_category']) { $term = get_term($settings['eael_woo_collections_category']); } else if ($settings['eael_woo_collections_type'] == 'tags' && $settings['eael_woo_collections_tags']) { $term = get_term($settings['eael_woo_collections_tags']); } else if ($settings['eael_woo_collections_type'] == 'attributes' && $settings['eael_woo_collections_attributes']) { $term = get_term($settings['eael_woo_collections_attributes']); } $link = (!is_wp_error($term) && !empty($term)) ? get_term_link($term) : '#'; $name = (!is_wp_error($term) && !empty($term)) ? $term->name : __('Collection Name', 'essential-addons-elementor'); $this->add_render_attribute('eael-woo-collections-bg', [ 'class' => ['eael-woo-collections-bg', $settings['eael_woo_collections_bg_hover_effect']], 'src' => $settings['eael_woo_collections_bg_img']['url'], 'alt' => esc_attr(get_post_meta($settings['eael_woo_collections_bg_img']['id'], '_wp_attachment_image_alt', true)), ]); $badge = ''; if ( $settings['eael_woo_collections_is_show_badge'] == 'yes' && !empty($settings['eael_woo_collections_badge_label'])) { $badge = '
'.$settings['eael_woo_collections_badge_label'].'
'; } echo '
get_render_attribute_string('eael-woo-collections-bg') . '>
'.$badge.' ' . sprintf(esc_html__('%s', 'essential-addons-elementor'), ($settings['eael_woo_collections_subtitle'] ?: '')) . '

' . sprintf(esc_html__('%s', 'essential-addons-elementor'), $name) . '

'; } }