start_controls_section( 'content_section', [ 'label' => esc_html__('Content', 'addonnest'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); // Title text field $this->add_control( 'title_text', [ 'label' => esc_html__('Title Text', 'addonnest'), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__('Enter title text', 'addonnest'), 'default' => esc_html__('WHATSAPP ORDERING SERVICE PLACE YOUR ORDERS AT', 'addonnest'), 'dynamic' => [ 'active' => true, ], ] ); // Hotline text field $this->add_control( 'hotline_text', [ 'label' => esc_html__('Hotline Text', 'addonnest'), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__('Enter hotline', 'addonnest'), 'default' => esc_html__('392 96 32', 'addonnest'), 'dynamic' => [ 'active' => true, ], ] ); // Link for hotline $this->add_control( 'hotline_link', [ 'label' => esc_html__('Hotline Link', 'addonnest'), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__('https://your-link.com', 'addonnest'), 'show_external' => true, 'default' => [ 'url' => 'tel:3929632', 'is_external' => false, 'nofollow' => false, ], ] ); // Delivery image $this->add_control( 'delivery_image', [ 'label' => esc_html__('Choose Image', 'addonnest'), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], 'dynamic' => [ 'active' => true, ], ] ); // Icon $this->add_control( 'icon', [ 'label' => esc_html__('Icon', 'addonnest'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fab fa-whatsapp', 'library' => 'fa-brands', ], 'recommended' => [ 'fa-brands' => [ 'whatsapp', 'telegram', 'phone-alt', ], 'fa-solid' => [ 'shopping-cart', 'mobile-alt', 'phone-volume', ], ], ] ); $this->end_controls_section(); // Style Tab $this->start_controls_section( 'style_section', [ 'label' => esc_html__('Style', 'addonnest'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); // Container Style $this->add_control( 'container_style_heading', [ 'label' => esc_html__('Container', 'addonnest'), 'type' => \Elementor\Controls_Manager::HEADING, ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background', 'label' => esc_html__('Background', 'addonnest'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .addonnest-online-delivery', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border', 'label' => esc_html__('Border', 'addonnest'), 'selector' => '{{WRAPPER}} .addonnest-online-delivery', ] ); $this->add_control( 'border_radius', [ 'label' => esc_html__('Border Radius', 'addonnest'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .addonnest-online-delivery' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => esc_html__('Box Shadow', 'addonnest'), 'selector' => '{{WRAPPER}} .addonnest-online-delivery', ] ); $this->add_responsive_control( 'padding', [ 'label' => esc_html__('Padding', 'addonnest'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .addonnest-online-delivery' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); // Title Style $this->add_control( 'title_style_heading', [ 'label' => esc_html__('Title', 'addonnest'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__('Text Color', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => esc_html__('Typography', 'addonnest'), 'selector' => '{{WRAPPER}} .addonnest-delivery-title', ] ); $this->add_responsive_control( 'title_margin', [ 'label' => esc_html__('Margin', 'addonnest'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); // Hotline Style $this->add_control( 'hotline_style_heading', [ 'label' => esc_html__('Hotline', 'addonnest'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'hotline_color', [ 'label' => esc_html__('Text Color', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-hotline' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'hotline_typography', 'label' => esc_html__('Typography', 'addonnest'), 'selector' => '{{WRAPPER}} .addonnest-delivery-hotline', ] ); $this->add_control( 'hotline_hover_color', [ 'label' => esc_html__('Hover Color', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-hotline:hover' => 'color: {{VALUE}};', ], ] ); // Icon Style $this->add_control( 'icon_style_heading', [ 'label' => esc_html__('Icon', 'addonnest'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__('Color', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-icon' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__('Size', 'addonnest'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 200, ], 'em' => [ 'min' => 0.5, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-icon' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_spacing', [ 'label' => esc_html__('Spacing', 'addonnest'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-icon' => 'margin-right: {{SIZE}}{{UNIT}};', ], ] ); // Image Style $this->add_control( 'image_style_heading', [ 'label' => esc_html__('Image', 'addonnest'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'image_width', [ 'label' => esc_html__('Width', 'addonnest'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', '%'], 'range' => [ 'px' => [ 'min' => 50, 'max' => 500, ], '%' => [ 'min' => 5, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-image img' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'image_spacing', [ 'label' => esc_html__('Spacing', 'addonnest'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-delivery-image' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Hover Effects Section $this->start_controls_section( 'hover_effects_section', [ 'label' => esc_html__('Hover Effects', 'addonnest'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'hover_animation', [ 'label' => esc_html__('Hover Animation', 'addonnest'), 'type' => \Elementor\Controls_Manager::HOVER_ANIMATION, ] ); $this->add_control( 'hover_background', [ 'label' => esc_html__('Hover Background', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-online-delivery:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'hover_border_color', [ 'label' => esc_html__('Hover Border Color', 'addonnest'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-online-delivery:hover' => 'border-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'hover_box_shadow', 'label' => esc_html__('Hover Box Shadow', 'addonnest'), 'selector' => '{{WRAPPER}} .addonnest-online-delivery:hover', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute('wrapper', 'class', 'addonnest-online-delivery'); if (!empty($settings['hover_animation'])) { $this->add_render_attribute('wrapper', 'class', 'elementor-animation-' . $settings['hover_animation']); } $hotline_link_attr = 'href="' . esc_url( $settings['hotline_link']['url'] ) . '"'; if ($settings['hotline_link']['is_external']) { $hotline_link_attr .= ' target="_blank"'; } if ($settings['hotline_link']['nofollow']) { $hotline_link_attr .= ' rel="nofollow"'; } ?>