<?php if ('layout_three' === $settings['layout_type']) : ?>

    <section class="product-two">
        <div class="product-two__shape-one" style="background-image: url(<?php echo esc_url($settings['layout_three_shape_one']['url']); ?>);"></div>
        <div class="product-two__shape-two" style="background-image: url(<?php echo esc_url($settings['layout_three_shape_two']['url']); ?>);"></div>
        <div class="container">
            <div class="sec-title-two">

                <<?php echo esc_attr($settings['section_sub_title_tag_layout_three']); ?> class="sec-title-two__tagline">
                    <span class="sec-title-two__tagline__icon">
                        <?php \Elementor\Icons_Manager::render_icon($settings['layout_three_sec_icon'], ['aria-hidden' => 'true'], 'i'); ?>
                    </span><?php echo wp_kses($settings['layout_three_sec_sub_title'], 'ostech_allowed_tags'); ?>
                </<?php echo esc_attr($settings['section_sub_title_tag_layout_three']); ?>><!-- /.sec-title-two__tagline -->

                <?php
                if (!empty($settings['layout_three_sec_title'])) :
                    $this->add_inline_editing_attributes('layout_three_sec_title', 'none');
                    ostech_elementor_rendered_content($this, 'layout_three_sec_title', 'sec-title-two__title', $settings['section_title_tag_layout_three']);
                endif;
                ?>

            </div><!-- /.sec-title-two -->
            <div class="product-two__carousel ostech-owl__carousel ostech-owl__carousel--with-shadow owl-carousel owl-theme" data-owl-options='<?php echo esc_attr(ostech_get_owl_options($settings)); ?>'>
                <?php
                if (!empty($settings['layout_three_select_category'])) :
                    $shop_post_query = new \WP_Query(array(
                        'post_type' => 'product',
                        'posts_per_page' => $settings['layout_three_post_count']['size'],
                        'orderby' => 'menu_order title',
                        'order'   => $settings['layout_three_query_order'],
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'product_cat',
                                'field' => 'slug',
                                'terms' => $settings['layout_three_select_category']
                            )
                        )
                    ));

                else :

                    $shop_post_query = new \WP_Query(array(
                        'post_type' => 'product',
                        'posts_per_page' => $settings['layout_three_post_count']['size'],
                        'orderby' => 'menu_order title',
                        'order'   => $settings['layout_three_query_order'],
                    ));

                endif;
                $i = 1;
                while ($shop_post_query->have_posts()) :
                    $shop_post_query->the_post();
                    global $product;

                    $currency_symbol = get_woocommerce_currency_symbol();
                    $discount_price = get_post_meta(get_the_ID(), '_price', true);
                    $regular_price = get_post_meta(get_the_ID(), '_regular_price', true);
                ?>
                    <div class="item">
                        <div class="product__item__two wow fadeInUp" data-wow-duration='1500ms' data-wow-delay='000ms'>
                            <div class="product__item__two__img">
                                <?php the_post_thumbnail('ostech_woog_270X280'); ?>
                                <div class="product__item__btn">
                                    <?php
                                    if (class_exists('WPCleverWoosw')) {
                                        echo do_shortcode('[woosw]');
                                    }
                                    ?>

                                    <?php
                                    if (class_exists('WPCleverWoosq')) {
                                        echo do_shortcode('[woosq]');
                                    }
                                    ?>
                                </div>
                            </div><!-- /.product-image -->
                            <div class="product__item__two__content">
                                <div class="product__item__two__ratings">
                                    <?php echo woocommerce_template_loop_rating(); ?>
                                </div><!-- /.product-ratings -->
                                <h4 class="product__item__two__title">
                                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                </h4><!-- /.product-title -->
                                <div class="product__item__two__price"><?php echo woocommerce_template_loop_price(); ?></div><!-- /.product-price -->
                                <?php
                                $ostech_ajax_cart_class = (get_option('woocommerce_enable_ajax_add_to_cart') == 'yes' ? 'ostech_ajax' : '');
                                if ($product->is_type('variable')) {

                                    echo sprintf(
                                        '<a href="%s" class="%s">%s</a>',
                                        esc_url($product->add_to_cart_url()),
                                        esc_attr(implode(' ', array_filter(array(
                                            'button', 'product_type_' . $product->get_type(),
                                            'product__all-btn add_to_cart_button thm-btn'
                                        )))),
                                        esc_html($product->add_to_cart_text())
                                    );
                                } else {
                                    echo sprintf(
                                        '<a href="%s" data-quantity="1" class="%s" %s>%s</a>',
                                        esc_url($product->add_to_cart_url()),
                                        esc_attr(implode(' ', array_filter(array(
                                            'button', 'product_type_' . $product->get_type(),
                                            $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
                                            $product->supports('ajax_add_to_cart') ? 'thm-btn product__all-btn add_to_cart_button ajax_add_to_cart' : 'thm-btn shop-one__cart add_to_cart_button ',
                                            $ostech_ajax_cart_class
                                        )))),
                                        wc_implode_html_attributes(array(
                                            'data-product_id'  => $product->get_id(),
                                            'data-product_sku' => $product->get_sku(),
                                            'aria-label'       => $product->add_to_cart_description(),
                                            'rel'              => 'nofollow',
                                        )),
                                        esc_html($product->add_to_cart_text())
                                    );
                                }
                                ?>
                            </div><!-- /.product-content -->
                        </div><!-- /.product-item -->
                    </div><!-- /.item -->
                <?php $i++;
                endwhile;
                wp_reset_postdata(); ?>
            </div><!-- /.slider -->
        </div><!-- /.container -->
    </section><!-- /.product-two -->
    <!-- Products Two End -->
<?php endif; ?>