<?php


use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if (!defined('ABSPATH')) exit; // Exit if accessed directly


class Digipluskaveh extends Widget_Base
{

    public function get_name()
    {
        return 'digipluskaveh';
    }

    public function get_title()
    {
        return esc_html__('Digiplus Widget', 'kavehTheme');
    }

    public function get_icon()
    {
        return 'eicon-archive-posts';
    }

    public function get_categories()
    {
        return ['kavehelements'];
    }

    protected function register_controls()
    {

        $this->start_controls_section(
            'contentdigipluskaveh',
            [
                'label' => esc_html__('Title Content', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'titledigipluskaveh',
            [
                'label' => esc_html__('Main Title', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Special Services for Digiplus Members', 'kavehTheme'),

            ]
        );
        $this->add_control(
            'tagheadingdigipluskaveh',
            [
                'label' => esc_html__('Main Title Tag', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'H3',
                'options' => [
                    'H1' => esc_html__('H1', 'kavehTheme'),
                    'H2' => esc_html__('H2', 'kavehTheme'),
                    'H3' => esc_html__('H3', 'kavehTheme'),
                    'H4' => esc_html__('H4', 'kavehTheme'),
                    'H5' => esc_html__('H5', 'kavehTheme'),
                    'H6' => esc_html__('H6', 'kavehTheme'),
                    'p' => esc_html__('p', 'kavehTheme'),
                    'div' => esc_html__('div', 'kavehTheme'),
                    'span' => esc_html__('span', 'kavehTheme'),
                ],
            ]
        );

        $this->add_control(
            'titleboxproductdigipluskaveh',
            [
                'label' => esc_html__('Product Box Title', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Free Express Delivery', 'kavehTheme'),

            ]
        );
        $this->add_control(
            'tagheadingboxproductdigipluskaveh',
            [
                'label' => esc_html__('Product Box Title Tag', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'H3',
                'options' => [
                    'H1' => esc_html__('H1', 'kavehTheme'),
                    'H2' => esc_html__('H2', 'kavehTheme'),
                    'H3' => esc_html__('H3', 'kavehTheme'),
                    'H4' => esc_html__('H4', 'kavehTheme'),
                    'H5' => esc_html__('H5', 'kavehTheme'),
                    'H6' => esc_html__('H6', 'kavehTheme'),
                    'p' => esc_html__('p', 'kavehTheme'),
                    'div' => esc_html__('div', 'kavehTheme'),
                    'span' => esc_html__('span', 'kavehTheme'),
                ],
            ]
        );

        $this->end_controls_section();
        $this->start_controls_section(
            'content2digipluskaveh',
            [
                'label' => esc_html__('Product Settings', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );
        $this->add_control(
            'displayproductsdigipluskaveh',
            [
                'label' => esc_html__('Display Products', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'custom',
                'options' => [
                    'custom' => esc_html__('Custom Mode', 'kavehTheme'),
                    'cat' => esc_html__('Category Mode', 'kavehTheme'),

                ],
            ]
        );

        $repeater = new \Elementor\Repeater();
        $repeater->add_control(
            'imgproductdigipluskaveh',
            [
                'label' => esc_html__('Product Image', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::MEDIA,
            ]
        );
        $repeater->add_control(
            'linkproductdigipluskaveh',
            [
                'label' => esc_html__('Product Link', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('#', 'kavehTheme'),

            ]
        );
        $this->add_control(
            'listproductdigipluskaveh',
            [
                'label' => esc_html__('Products', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::REPEATER,
                'fields' => $repeater->get_controls(),
                'condition' => [
                    'displayproductsdigipluskaveh' => 'custom',
                ],
                'default' => [
                    [
                        'linkproductdigipluskaveh' => esc_html__('#', 'kavehTheme'),
                    ],
                ]
            ]

        );

        $options2 = array();
        $orderby = 'name';
        $order = 'asc';
        $hide_empty = true;
        $cat_args = array(
            'orderby' => $orderby,
            'order' => $order,
            'hide_empty' => $hide_empty,
        );

        $product_categories = get_terms('product_cat', $cat_args);

        foreach ($product_categories as $key => $category) {
            $options2[$category->term_id] = $category->name;
        }
        $this->add_control(
            'catproductsdigipluskaveh',
            [
                'label' => esc_html__('Select Category', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'multiple' => true,
                'options' => $options2,
                'condition' => [
                    'displayproductsdigipluskaveh' => 'cat',
                ],
            ]
        );
        $this->add_control(
            'numberproductsdigipluskaveh',
            [
                'label' => esc_html__('Number of Displayed Products', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'min' => 0,
                'max' => 20,
                'step' => 1,
                'default' => 12,
                'condition' => [
                    'displayproductsdigipluskaveh' => 'cat',
                ],
            ]
        );


        $this->end_controls_section();

        $this->start_controls_section(
            'content3digipluskaveh',
            [
                'label' => esc_html__('Buttons', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'buttondigipluskaveh',
            [
                'label' => esc_html__('Button Title', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('Membership', 'kavehTheme'),
            ]
        );
        $this->add_control(
            'iconbuttondigipluskaveh',
            [
                'label' => esc_html__('Icon', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'skin' => 'inline',
                'exclude_inline_options' => ['svg'],
                'default' => [
                    'value' => 'fas fa-arrow-left',
                ],
            ]
        );
        $this->add_control(
            'buttonlinkdigipluskaveh',
            [
                'label' => esc_html__('Button Link', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('#', 'kavehTheme'),

            ]
        );

        $this->add_control(
            'buttonseealldigipluskaveh',
            [
                'label' => esc_html__('View More Button Title', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('View All', 'kavehTheme'),
            ]
        );
        $this->add_control(
            'iconbuttonseealldigipluskaveh',
            [
                'label' => esc_html__('View More Button Icon', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::ICONS,
                'skin' => 'inline',
                'exclude_inline_options' => ['svg'],
                'default' => [
                    'value' => 'fas fa-arrow-left',
                ],
            ]
        );
        $this->add_control(
            'buttonlinkseealldigipluskaveh',
            [
                'label' => esc_html__('View More Button Link', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => esc_html__('#', 'kavehTheme'),

            ]
        );

        $this->end_controls_section();
        $this->start_controls_section(
            'content4digipluskaveh',
            [
                'label' => esc_html__('Image', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );
        $this->add_control(
            'imgtoptitledigipluskaveh',
            [
                'label' => esc_html__('Image Above Title', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::MEDIA,
            ]
        );
        $this->add_control(
            'bgunderbuttondigipluskaveh',
            [
                'label' => esc_html__('Image Below Button', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right' =>
                        'background-image: url({{URL}})',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'style_digipluskaveh',
            [
                'label' => esc_html__('Title Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'textcolor1digipluskaveh',
            [
                'label' => esc_html__('Main Title Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .sub-title' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'title_digipluskaveh',
                'label' => esc_html__('Main Title Typography', 'kavehTheme'),
                'selector' => '{{WRAPPER}} .send-instantaneous-right .sub-title',
            ]
        );

        $this->add_control(
            'textcolor2digipluskaveh',
            [
                'label' => esc_html__('Product Box Title Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left .title' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'title2_digipluskaveh',
                'label' => esc_html__('Product Box Title Typography', 'kavehTheme'),
                'selector' => '{{WRAPPER}} .send-instantaneous-left .title',
            ]
        );

        $this->add_control(
            'iconcolordigipluskaveh',
            [
                'label' => esc_html__('Product Box Title Icon Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left .title svg' => 'fill: {{VALUE}} !important',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'style2_digipluskaveh',
            [
                'label' => esc_html__('First Button Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'button1_digipluskaveh',
                'label' => esc_html__('Button Text Typography', 'kavehTheme'),
                'selector' => '{{WRAPPER}} .send-instantaneous-right .btn',
            ]
        );
        $this->add_control(
            'iconsizebutton1digipluskaveh',
            [
                'label' => esc_html__('Icon Size', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 300,
                        'step' => 1,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => 15,
                ],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn i' => 'font-size: {{SIZE}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
            'textbutton1colordigipluskaveh',
            [
                'label' => esc_html__('Button Text Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'iconbutton1colordigipluskaveh',
            [
                'label' => esc_html__('Icon Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn i' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'button1colordigipluskaveh',
            [
                'label' => esc_html__('Button Background Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn' => 'background-color: {{VALUE}}',
                ],
            ]
        );
        $this->add_control(
            'button1radiusdigipluskaveh',
            [
                'label' => esc_html__('Button Border Radius', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Border::get_type(),
            [
                'name' => 'border1digipluskaveh',
                'label' => esc_html__('Border', 'kavehTheme'),
                'selector' => '{{WRAPPER}} .send-instantaneous-right .btn',
            ]
        );

        $this->add_control(
            'button1paddingdigipluskaveh',
            [
                'label' => esc_html__('Padding', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right .btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_section();
        $this->start_controls_section(
            'style3_digipluskaveh',
            [
                'label' => esc_html__('View More Button Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'button2_digipluskaveh',
                'label' => esc_html__('Button Text Typography', 'kavehTheme'),
                'selector' => '{{WRAPPER}} .send-instantaneous-left .link-more',
            ]
        );
        $this->add_control(
            'iconsizebutton2digipluskaveh',
            [
                'label' => esc_html__('Icon Size', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 2000,
                        'step' => 5,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => 'px',
                    'size' => 15,
                ],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left .link-more i' => 'font-size: {{SIZE}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
            'textbutton2colordigipluskaveh',
            [
                'label' => esc_html__('Button Text Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left .link-more' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_control(
            'iconbutton2colordigipluskaveh',
            [
                'label' => esc_html__('Icon Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left .link-more i' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'style4_digipluskaveh',
            [
                'label' => esc_html__('Image Above Title Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_control(
            'imagewidthdigipluskaveh',
            [
                'label' => esc_html__('Image Width', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 2000,
                        'step' => 5,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'default' => [
                    'unit' => '%',
                    'size' => 100,
                ],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right img' => 'width: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->add_control(
            'imageheightdigipluskaveh',
            [
                'label' => esc_html__('Image Height', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['px', '%'],
                'range' => [
                    'px' => [
                        'min' => 0,
                        'max' => 2000,
                        'step' => 5,
                    ],
                    '%' => [
                        'min' => 0,
                        'max' => 100,
                    ],
                ],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-right img' => 'height: {{SIZE}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_section();
        $this->start_controls_section(
            'style4_boxdigipluskaveh',
            [
                'label' => esc_html__('Main Box Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'bgcolordigipluskaveh',
            [
                'label' => esc_html__('Background Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-wrapper' => 'background-color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'boxbgradiusdigipluskaveh',
            [
                'label' => esc_html__('Border Radius', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_section();
        $this->start_controls_section(
            'style5_boxproductdigipluskaveh',
            [
                'label' => esc_html__('Product Box Style', 'kavehTheme'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'bgcolorboxproductdigipluskaveh',
            [
                'label' => esc_html__('Background Color', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left' => 'background-color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'boxproductradiusdigipluskaveh',
            [
                'label' => esc_html__('Border Radius', 'kavehTheme'),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'selectors' => [
                    '{{WRAPPER}} .send-instantaneous-left' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->end_controls_section();

    }


    protected function render()
    {
        $settings = $this->get_settings_for_display();
        $clsid = $this->get_id();
        ?>


        <!-- Start Digiplus -->
        <section class="send-instantaneous"">
        <div class="container">
            <div class="send-instantaneous-wrapper d-flex p-3 flex-column flex-lg-row">
                <div class="send-instantaneous-right w-100 pt-3 pt-lg-4 pr-4 mb-4 mb-lg-0">
                    <a href="<?php echo esc_url($settings['buttonlinkdigipluskaveh']); ?>" class="d-block">
                        <img src="<?php echo esc_url($settings['imgtoptitledigipluskaveh']['url']); ?>"
                             alt="<?php echo esc_attr(\Elementor\Control_Media::get_image_alt($settings['imgtoptitledigipluskaveh'])); ?>">
                    </a>
                    <<?php echo esc_attr($settings['tagheadingdigipluskaveh']); ?> class="sub-title
                    mt-1"><?php echo esc_html($settings['titledigipluskaveh']); ?>
                </<?php echo esc_attr($settings['tagheadingdigipluskaveh']); ?>>
                <a href="<?php echo esc_url($settings['buttonlinkdigipluskaveh']); ?>"
                   class="btn d-flex align-items-center justify-content-center">
                    <?php echo esc_html($settings['buttondigipluskaveh']); ?>
                    <i class="<?php echo esc_attr($settings['iconbuttondigipluskaveh']['value']); ?> ms-1"></i>
                </a>
            </div>
            <div class="send-instantaneous-left w-100 pt-3 px-3">
                <div class="d-flex align-items-center justify-content-between mb-3">
                    <<?php echo esc_attr($settings['tagheadingboxproductdigipluskaveh']); ?> class="title mb-0">
                    <svg class="me-2">
                        <path fill-rule="evenodd"
                              d="M11.539 1.083l.224-.054a1 1 0 01.452-.006A6.098 6.098 0 0117 6.98v2.486l2.555 1.703a1 1 0 01.394.516l2 6a1 1 0 01-1.145 1.297L15.9 18H8.099l-4.903.98a1 1 0 01-1.145-1.296l2-6a1 1 0 01.394-.516L7 9.465V6.979a6.104 6.104 0 014.539-5.896zM7 11.868v4.312l-2.507.501 1.346-4.039L7 11.868zM15 10v6H9V6.979a4.099 4.099 0 012.839-3.9L12 3.03l.178.054A4.099 4.099 0 0115 6.98V10zm2 6.18l2.506.501-1.346-4.039-1.16-.773v4.311zM10 9a2 2 0 114 0 2 2 0 01-4 0zm0 13v-3H8v3h2zm6-3v3h-2v-3h2zm-3 4v-4h-2v4h2z"
                              clip-rule="evenodd"></path>
                    </svg>
                    <?php echo esc_html($settings['titleboxproductdigipluskaveh']); ?>
                </<?php echo esc_attr($settings['tagheadingboxproductdigipluskaveh']); ?>>
                <a href="<?php echo esc_url($settings['buttonlinkseealldigipluskaveh']); ?>"
                   class="link-more d-flex align-items-center ">
                    <?php echo esc_html($settings['buttonseealldigipluskaveh']); ?>
                    <i class="<?php echo esc_attr($settings['iconbuttonseealldigipluskaveh']['value']); ?> ms-1"></i>
                </a>
            </div>
            <ul class="send-instantaneous-items d-flex align-items-center flex-wrap">
                <?php if ('cat' === $settings['displayproductsdigipluskaveh']) : ?>
                    <?php

                    // WP_Query args
                    $cat_query_args = array(
                        'post_type' => array('product'),
'post_status' => array('publish'),
                        'posts_per_page' => $settings['numberproductsdigipluskaveh'],
                        'order' => 'DESC',
                        'orderby' => 'date',
                        'tax_query' => array(
                            array(
                                "taxonomy" => "product_cat",
                                "field" => "term_id",
                                "terms" => $settings['catproductsdigipluskaveh'],
                            ),
                        ),
                        'meta_query' => array(
                            array(
                                'key' => '_stock_status',
                                'value' => 'outofstock',
                                'compare' => 'NOT IN',
                            ),
                        ),
                    );

                    // The Query
                    $pcat_query = new \WP_Query($cat_query_args);

                    // The Loop
                    if ($pcat_query->have_posts()) :?>
                        <?php while ($pcat_query->have_posts()) :
                            $pcat_query->the_post(); ?>
                            <li class="w-100">
                                <a href="<?php the_permalink(); ?>" class="d-block">
                                    <img src="<?php the_post_thumbnail_url('full'); ?>"
                                         alt="<?php the_title(); ?>"
                                         width="116"
                                         height="116"
                                         class="d-block w-100">
                                </a>
                            </li>
                        <?php
                        endwhile;
                        // Reset Original Post Data
                        wp_reset_postdata();
                        ?>
                    <?php endif; ?>
                <?php elseif ('custom' === $settings['displayproductsdigipluskaveh']) : ?>
                    <?php if ($settings['listproductdigipluskaveh']) : ?>
                        <?php foreach ($settings['listproductdigipluskaveh'] as $item) : ?>
                            <li class="w-100">
                                <a href="<?php echo esc_url($item['linkproductdigipluskaveh']); ?>" class="d-block">
                                    <img src="<?php echo esc_url($item['imgproductdigipluskaveh']['url']); ?>"
                                         alt="<?php echo esc_attr(\Elementor\Control_Media::get_image_alt($item['imgproductdigipluskaveh'])); ?>"
                                         width="116"
                                         height="116"
                                         class="d-block w-100">
                                </a>
                            </li>
                        <?php endforeach; ?>
                    <?php endif; ?>
                <?php endif; ?>
            </ul>
        </div>
        </div>
        </div>
        </section>

        <style>
            @media only screen and (max-width: 575px) {
            <?php echo '.elementor-element-' . $clsid . ''; ?>  .send-instantaneous-right {
                background: unset !important;
            }
            }
        </style>

        <!-- End Digiplus -->
        <?php
    }


}
