$mango_continer = mango_main_container_class();
$mango_class_name = mango_class_name();
get_header();
$portfolio_settings = mango_portfolio_settings();
?>
    <div class="<?php 
echo esc_attr($mango_continer);
?>
main">
                <div class="row">
                    <div class="<?php 
echo esc_attr($mango_class_name);
?>
">
                   <?php 
mango_taxonomy_banner();
?>
                    <?php 
if (have_posts()) {
    ?>
    <div class="row portfolio-row">
        <div id="portfolio-item-container" class="max-col-<?php 
    echo esc_attr($portfolio_settings['cols']);
    ?>
 popup-gallery" <?php 
    echo $portfolio_settings['page_style'] == 'grid' ? 'data-layoutmode="fitRows"' : "";
    ?>
>
            <?php 
    while (have_posts()) {
        the_post();
function mango_woocommerce_before_shop_loop()
{
    global $mango_settings;
    mango_taxonomy_banner();
    ?>
    <div class="filter-row clearfix">
    <?php 
    if (!woocommerce_products_will_display()) {
        ?>
</div>   <?php 
        return;
    }
    ?>
        <?php 
    add_filter("woocommerce_catalog_orderby", function ($catalog_orderby_options) {
        $catalog_orderby_options = array('menu_order' => __('Default Sorting', 'mango'), 'popularity' => __('Popularity', 'mango'), 'rating' => __('Average Rating', 'mango'), 'date' => __('Latest', 'mango'), 'price' => __('Lowest Price', 'mango'), 'price-desc' => __('Highest Price', 'mango'));
        return $catalog_orderby_options;
    });
    woocommerce_catalog_ordering();
    ?>
        <div class="filter-row-box second">
            <form method="get">
                <?php 
    if (isset($_GET) && !empty($_GET)) {
        foreach ($_GET as $k => $v) {
            if ($k != 'view') {
                ?>
                            <input type="hidden" name="<?php 
                echo esc_attr($k);
                ?>
"
                                   value="<?php 
                echo esc_attr($v);
                ?>
"/>
                        <?php 
            }
        }
    }
    ?>
                <button type="submit" name="view" value="grid"
                        class="btn <?php 
    echo mango_shop_view() == 'grid' ? 'active' : '';
    ?>
" title="Grid"><i
                        class="fa fa-th"></i></button>
                <button type="submit" name="view" value="list"
                        class="btn <?php 
    echo mango_shop_view() == 'list' ? 'active' : '';
    ?>
" title="List"><i
                        class="fa fa-th-list"></i></button>
            </form>
        </div>
        <!-- End .filter-row-box -->
        <div class="clearfix visible-xs"></div>
        <!-- End .clearfix -->
        <div class="filter-row-box last">
            <span class="filter-row-label"><?php 
    _e("Show", 'mango');
    ?>
</span>
            <div class="small-selectbox quantity-selectbox clearfix">
                <?php 
    $products_perpage = isset($mango_settings['mango_products_perpage']) && $mango_settings['mango_products_perpage'] ? $mango_settings['mango_products_perpage'] : '9,15,30';
    $pr_p_ar = explode(",", $products_perpage);
    if (isset($_GET['perpage']) && !in_array($_GET['perpage'])) {
        $pr_p_ar[] = $_GET['perpage'];
    }
    $current = isset($_GET['perpage']) && $_GET['perpage'] ? $_GET['perpage'] : $pr_p_ar[0];
    ?>
                <form method="get">
                    <?php 
    if (isset($_GET) && !empty($_GET)) {
        foreach ($_GET as $k => $v) {
            if ($k != 'perpage') {
                ?>
                                <input type="hidden" name="<?php 
                echo esc_attr($k);
                ?>
"
                                       value="<?php 
                echo esc_attr($v);
                ?>
"/>
                            <?php 
            }
        }
    }
    ?>
                    <select id="number" name="perpage" class="selectbox" onchange="this.form.submit()">
                        <?php 
    foreach ($pr_p_ar as $number) {
        ?>
                            <option
                                value="<?php 
        echo esc_attr($number);
        ?>
" <?php 
        selected($number, $current);
        ?>
><?php 
        echo esc_attr($number);
        ?>
</option>
                        <?php 
    }
    ?>
                    </select>
                </form>
            </div>
            <!-- End .normal-selectbox-->
            <span class="filter-row-label hidden-xss"><?php 
    _e("per page", 'mango');
    ?>
</span>
        </div>
        <!-- End .filter-row-box -->
        <nav class="filter-row-box right woocommerce-pagination">
            <?php 
    woocommerce_pagination();
    ?>
        </nav>
        <!-- End .filter-row-box -->
    </div><!-- End .filter-row -->
<?php 
}