<?php
$displyProduct = 9;
$orderBy = 'ASC';

if (isset($singelWidgetData->widget_content)) {
    $widgetContent = $singelWidgetData->getTranslation('widget_content');
    $displyProduct = isset($widgetContent['display_per_page']) ? $widgetContent['display_per_page'] : 9;
    $orderBy = isset($widgetContent['storted_by']) ? $widgetContent['storted_by'] : 'ASC';
    $productType = isset($widgetContent['product_type']) ? $widgetContent['product_type'] : 'all';
    $sidebar_enable = isset($widgetContent['sidebar_enable']) ? $widgetContent['sidebar_enable'] : 'yes';
}

$type = $productType == 'auction' ? 1 : ($productType == 'direct' ? 2 : '');
$products = products(['type' => $type], '', $perpage = $displyProduct, $orderBy);

?>

<div class="live-auction-section pt-120">
    <img alt="image" src="<?php echo e(asset('frontend/images/bg/section-bg.png')); ?>" class="img-fluid section-bg-top">
    <img alt="image" src="<?php echo e(asset('frontend/images/bg/section-bg.png')); ?>" class="img-fluid section-bg-bottom">
    <div class="container">
        <div class="row gy-4">

            <?php if($sidebar_enable == 'yes'): ?>

                <div class="col-xl-3">
                    <div class="product-sidebar">


                        <div class="product-widget-item">
                            <div class="search-area">
                                <div class="sidebar-widget-title">
                                    <h4><?php echo e(translate('Search Product')); ?></h4>
                                    <span></span>
                                </div>
                                <div class="product-widget-body">
                                    <div class="form-inner">
                                        <input type="text" class="keyword"
                                            placeholder="<?php echo e(translate('Search Here')); ?>">
                                        <button class="search--btn keyword-search"><i
                                                class='bx bx-search-alt-2'></i></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="product-widget-item">
                            <div class="search-area">
                                <div class="sidebar-widget-title">
                                    <h4><?php echo e(translate('Price Filter')); ?></h4>
                                    <span></span>
                                </div>
                                <div class="product-widget-body">
                                    <div class="range-wrap">
                                        <div class="row">
                                            <div class="col-sm-12">
                                                <input type="hidden" id="min_value" class="min_value" name="min_value">
                                                <input type="hidden" id="max_value" class="max_value" name="max_value">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12">
                                                <div id="slider-range"></div>
                                            </div>
                                        </div>
                                        <div class="slider-labels">
                                            <div class="caption">
                                                <span id="slider-range-value1"></span>
                                            </div>
                                            <div class="priceRange"><?php echo e(translate('Apply')); ?></div>
                                            <div class="caption">
                                                <span id="slider-range-value2"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </div>
                        <?php if(categoryProducts()->count() > 0): ?>
                            <div class="product-widget-item">
                                <div class="top-product">
                                    <div class="sidebar-widget-title">
                                        <h4><?php echo e(translate('Product Categories')); ?></h4>
                                        <span></span>
                                    </div>
                                    <div class="auction-widget-body">
                                        <ul class="checkbox-container">
                                            <?php $__currentLoopData = categoryProducts(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <li>
                                                    <label class="containerss">
                                                        <input type="checkbox" class="categories filter-option category"
                                                            value="<?php echo e($category->id); ?>">
                                                        <span class="checkmark"></span>
                                                        <span
                                                            class="text"><?php echo e($category->getTranslation('name')); ?></span>
                                                        <span
                                                            class="qty"><?php echo e($category->action_products_count); ?></span>
                                                    </label>
                                                </li>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>

                        <div class="text-center  show-reset mb-40">
                            <a class="eg-btn btn--primary2 btn--sm text-center reset-btns"
                                id="refreshPage"><?php echo e(translate('Reset')); ?></a>
                        </div>

                        <?php if(latestBidingProducts(5)->count() > 0): ?>
                            <div class="product-widget-item">
                                <div class="product-category">
                                    <div class="sidebar-widget-title">
                                        <h4><?php echo e(translate('Top Bidding Product')); ?></h4>
                                        <span></span>
                                    </div>
                                    <div class="product-widget-body">
                                        <ul class="recent-post">
                                            <?php $__currentLoopData = latestBidingProducts(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $top_bid): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <li class="single-post">
                                                    <div class="post-img">
                                                        <a href="<?php echo e(route('auction.details', $top_bid->slug)); ?>">
                                                            <?php if($top_bid->features_image): ?>
                                                                <img alt="Acution image"
                                                                    src="<?php echo e(asset('uploads/products/features/' . $top_bid->features_image)); ?>">
                                                            <?php else: ?>
                                                                <img alt="Acution image"
                                                                    src="<?php echo e(asset('uploads/placeholder.jpg')); ?>">
                                                            <?php endif; ?>
                                                        </a>
                                                    </div>
                                                    <div class="post-content">
                                                        <h6><a
                                                                href="<?php echo e(route('auction.details', $top_bid->slug)); ?>"><?php echo e($top_bid->getTranslation('name', $lang)); ?></a>
                                                        </h6>
                                                        <span><?php echo e(translate('Bidding Price')); ?> :
                                                            <?php echo e(currency_symbol() . $top_bid->min_bid_price); ?></span>
                                                    </div>
                                                </li>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>


                    </div>
                </div>
            <?php endif; ?>

            <div class="<?php echo e($sidebar_enable == 'yes' ? 'col-xl-9' : 'col-xl-12'); ?>">
                <div id="productPage" class="row g-4 justify-content-center product-page">
                    <input type="hidden" value="all-product" id="widget_name">
                    <input type="hidden" value="<?php echo e($displyProduct); ?>" id="item_show">
                    <div class="col-lg-12">
                        <div class="show-item-and-filte">
                            <p><?php echo e(translate('Showing')); ?> <strong class="show_count">
                                    <?php echo e($products->count()); ?></strong> <?php echo e(translate('result')); ?></p>
                            <?php if($productType == 'all'): ?>
                                <div class="filter-area">
                                    <input type="hidden" id="product_type">
                                    <h6><?php echo e(translate('Filter By')); ?>:</h6>
                                    <div class="form-inner">
                                        <select class="price_order_by">
                                            <option disabled selected><?php echo e(translate('Filter By')); ?></option>
                                            <option value="1"><?php echo e(translate('Auction Products')); ?></option>
                                            <option value="2"><?php echo e(translate('General Products')); ?></option>
                                            <option value="3"><?php echo e(translate('Comming Products')); ?></option>
                                        </select>
                                    </div>
                                </div>
                            <?php else: ?>
                                <input type="hidden" id="product_type" value="<?php echo e($type); ?>">
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="circle-loader"></div>
                    <div class="row g-4" id="loadProducts">
                        <?php echo $__env->make('frontend.template-' . $templateId . '.partials.filter-products', [
                            'products' => $products,
                        ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                    </div>
                    <input type="hidden" name="hidden_page" id="hidden_page" value="1" />
                </div>

            </div>
        </div>
    </div>
</div>
<input type="hidden" id="highest_price" value="<?php echo e(highestPrice()); ?>">

<?php $__env->startPush('js'); ?>
    <script src="<?php echo e(asset('frontend/js/product-filter.js')); ?>"></script>
<?php $__env->stopPush(); ?>
<?php /**PATH C:\ServBay\www\bidout-update\resources\views/frontend/template-1/all-product.blade.php ENDPATH**/ ?>