<?php
$prato_store_options = prato_store_theme_options();
$product_section_title = $prato_store_options['product_section_title'];
$product_column = $prato_store_options['product_column'];


$limit = ( get_theme_mod( 'noofproduct' ) );
$limit;
$display_product = $prato_store_options['display_product'];




?>


<div class="products-section section">
    <div class="container">
        <div class="row">
            <?php if($product_section_title) { ?>
                <div class="section-title">
                    <h2><?php echo esc_html($product_section_title); ?></h2>
                </div>
            <?php } 
            if (class_exists('WooCommerce')) { ?>

            <?php if($display_product=="recent") {
            echo do_shortcode( ' [recent_products limit="'. $limit . '" columns="'. $product_column . '" orderby="popularity" on_sale="true" ] ' ); 
            }
            if($display_product=="featured") {
            echo do_shortcode( ' [featured_products limit="'. $limit . '" columns="'. $product_column . '" orderby="popularity" on_sale="true" ] ' ); 
            } 
            if($display_product=="toprated") {
                echo do_shortcode( ' [top_rated_products limit="'. $limit . '" columns="'. $product_column . '" orderby="popularity" on_sale="true" ] ' ); 
            } 
            if($display_product=="sale") {
            echo do_shortcode( ' [sale_products limit="'. $limit . '" columns="'. $product_column . '" orderby="popularity" on_sale="true" ] ' ); 
            } 

        }
            ?>
        </div>
    </div>
</div>