start_controls_section( 'section_title', [ 'label' => __( 'Title Element', 'addonnest' ) ] ); $this->add_control( 'shop_banner_image', [ 'label' => esc_html__( 'Choose Image', 'addonnest' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'sales', [ 'label' => __( 'Seasonal Sales', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'Enter your sales name', 'addonnest' ), 'default' => __( 'Seasonal Sales', 'addonnest' ), ] ); $this->add_control( 'sales_offer', [ 'label' => __( 'Sales Offers', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' => __( 'Enter your offer', 'addonnest' ), 'default' => __( 'Up To Breads', 'addonnest' ), ] ); $this->add_control( 'highlight_text', [ 'label' => __( 'Highlight Text', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'Enter your Highlight text', 'addonnest' ), 'default' => __( '50% Off', 'addonnest' ), ] ); $this->add_control( 'shop_button_name', [ 'label' => __( 'Shop Button Name', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'Enter your button name', 'addonnest' ), 'default' => __( 'Shop Now', 'addonnest' ), ] ); $this->add_control( 'shop_button_url', [ 'label' => __( 'Shop Button URL', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => __( 'Enter your url', 'addonnest' ), 'default' => __( '#', 'addonnest' ), ] ); // Vertical Align $this->add_responsive_control( 'vertical_align', [ 'label' => esc_html__( 'Vertical Alignment', 'addonnest' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html__( 'Top', 'addonnest' ), 'icon' => 'eicon-justify-start-v', ], 'center' => [ 'title' => esc_html__( 'Center', 'addonnest' ), 'icon' => 'eicon-justify-space-between-v', ], 'flex-end' => [ 'title' => esc_html__( 'Bottom', 'addonnest' ), 'icon' => ' eicon-justify-end-v', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .banner_one .details' => 'align-items: {{VALUE}};', ], ] ); // Align $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'addonnest' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'addonnest' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'addonnest' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'addonnest' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'addonnest' ), 'icon' => 'eicon-text-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); # Option End # Style $this->start_controls_section( 'section_banner_image', [ 'label' => __( 'Banner Image', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'banner_image_height', [ 'label' => esc_html__( 'Height', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000, ], ], 'selectors' => [ '{{WRAPPER}} .banner_one .thumb' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'banner_image_border_radius', [ 'label' => esc_html__( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .banner_one .thumb' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); # Seasonal Sales $this->add_control( 'banner_image_bgColor', [ 'label' => __( 'Image overlay color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .banner_one .details' => 'background: {{VALUE}};', ], ] ); $this->end_controls_section(); # Banner Section $this->start_controls_section( 'section_banner_style', [ 'label' => __( 'Banner Section', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); # Seasonal Sales $this->add_control( 'seasonal_title_sales', [ 'label' => __( 'Seasonal Sales Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .banner_one .details .para' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Sales Text Typography', 'addonnest' ), 'name' => 'sales_typography', 'selector' => '{{WRAPPER}} .banner_one .details .para', ] ); $this->add_responsive_control( 'section_title_space', [ 'label' => esc_html__( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'default' => [ 'size' => 40, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .banner_one .details .para' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); # Banner Title $this->add_control( 'banner_title', [ 'label' => esc_html__( 'Banner Title', 'addonnest' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); # Title Sales $this->add_control( 'title_sales', [ 'label' => __( 'Sales Title Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .banner_one .details .title' => 'color: {{VALUE}};', ], ] ); # Title Sales Typography $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Sales Title Typography', 'addonnest' ), 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .banner_one .details .title', ] ); # Highlight $this->add_control( 'highlight_title', [ 'label' => __( 'Highlight Text Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .banner_one .details .title .text-thm2' => 'color: {{VALUE}};', ], ] ); # Title Sales Typography $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Highlight Text Typography', 'addonnest' ), 'name' => 'highlight_typography', 'selector' => '{{WRAPPER}} .banner_one .details .title .text-thm2', ] ); $this->add_responsive_control( 'banner_title_space', [ 'label' => esc_html__( 'Title Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'default' => [ 'size' => 5, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .banner_one .details .title' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'banner_padding', [ 'label' => __( 'Banner Padding', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .banner_one .details' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); # Title Section end 1 # Shop Now btn Style $this->start_controls_section( 'section_btn_style', [ 'label' => __( 'Button', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'shopnow_btn_color', [ 'label' => __( 'Shop Now Button Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .shop_btn' => 'color: {{VALUE}};', '{{WRAPPER}} .shop_btn:before' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'shopnow_btn_hover_color', [ 'label' => __( 'Shop Now Button Hover Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .shop_btn:hover' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'label' => __( 'Button Typography', 'addonnest' ), 'name' => 'btn_typography', 'selector' => '{{WRAPPER}} .shop_btn', ] ); $this->end_controls_section(); # Title Section end 1 } protected function render( ) { $settings = $this->get_settings(); $sales = $settings['sales']; $sales_offer = $settings['sales_offer']; $highlight_text = $settings['highlight_text']; $shop_button_name = $settings['shop_button_name']; $shop_button_url = $settings['shop_button_url']; ?>
widgets_manager->register_widget_type( new AddonNest_Widget_Shop_Banner() );