 <?php $__empty_1 = true; $__currentLoopData = $categoryproducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoryproduct): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
    <?php
        $firstcatepro=App\Models\Product::with([
            'sizes' => function ($query) {
                $query->select('id','product_id','Discount','RegularPrice','SalePrice')->take(1);
            }
            ])->where('id',json_decode($categoryproduct->RelatedProductIds)[0]->productID)->select('id','ProductName')->first();

        $review = App\Models\Review::where('product_id', $firstcatepro->id)->avg(
                                        'rating',
                                    );
    ?>
    <?php if(isset($firstcatepro)): ?>
        <div class="mb-2 col-6 col-md-4 col-lg-2">
            <div class="product">
                    <div class="product-micro">
                        <div class="row product-micro-row">
                            <div class="col-12">
                                <div class="product-image" style="position: relative;">
                                    <div class="text-center image">
                                        <a href="<?php echo e(url('view-product/' . $categoryproduct->ProductSlug)); ?>">
                                            <img src="<?php echo e(asset($categoryproduct->ProductImage)); ?>"
                                                alt="<?php echo e($categoryproduct->ProductName); ?>" id="featureimagenew">
                                        </a>
                                    </div>
                                    <span id="discountpart"> <p id="pdis">SAVE ৳<?php echo e(round($firstcatepro->sizes[0]->Discount)); ?></p></span>

                                </div>
                                <!-- /.product-image -->
                            </div>
                            <!-- /.col -->
                            <div class="col-12">
                                <div class="p-2 infofe p-md-2" style="border-top:none;background: white;">
                                    <div class="product-info">
                                        <h2 class="name text-truncate" id="f_name"><a
                                                href="<?php echo e(url('view-product/' . $categoryproduct->ProductSlug)); ?>"
                                                id="f_pro_name"><?php echo e($firstcatepro->ProductName); ?></a>
                                        </h2>
                                    </div>

                                    <div class="d-flex" style="justify-content:space-between">
                                        <div class="star" style="padding-top: 5px;">
                                            <span style="font-weight: bold;color:black;font-size:10px">(<?php echo e(App\Models\Review::where('product_id', $firstcatepro->id)->select('id')->get()->count()); ?>)</span>
                                            <?php if(intval($review) == 1): ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                            <?php elseif(intval($review) == 2): ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                            <?php elseif(intval($review) == 3): ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star"></span>
                                                <span class="fas fa-star"></span>
                                            <?php elseif(intval($review) == 4): ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star"></span>
                                            <?php elseif(intval($review) == 5): ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                            <?php else: ?>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                                <span class="fas fa-star" id="checked"></span>
                                            <?php endif; ?>
                                        </div>

                                    </div>

                                <div class="price-box">
                                        <del class="old-product-price strong-400">৳
                                            <?php echo e(round($firstcatepro->sizes[0]->RegularPrice)); ?></del>
                                        <span
                                            class="product-price strong-600">৳ <?php echo e(round($firstcatepro->sizes[0]->SalePrice)); ?></span>
                                </div>

                                </div>

                                <a href="<?php echo e(url('view-product/' . $categoryproduct->ProductSlug)); ?>">
                                    <button class="mb-0 btn btn-danger btn-sm btn-block"
                                            style="width: 100%;border-radius: 0%;" id="purcheseBtn">অর্ডার করুন</button>
                                </a>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.product-micro-row -->
                    </div>

                    <!-- /.product-micro -->

                </div>
        </div>
    <?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<?php endif; ?>
<?php /**PATH /home/mayabot1/jaframart.com/resources/views/webview/product.blade.php ENDPATH**/ ?>