<?php $__env->startSection('title', 'خانه'); ?>
<?php $__env->startSection('description', 'فروشگاه اینترنتی,خرید محصول'); ?>
<?php $__env->startSection('keywords', 'فروشگاه اینترنتی,خرید محصول'); ?>
<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('assets/js/jss/basket.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('main'); ?>
    <div class="content-home" >
        <h1 class="head">خرید های شما</h1>
        <div class="container-fluid">
            <?php $Price = 0;?>
            <?php $__empty_1 = true; $__currentLoopData = session('ids'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_1 = false; ?>
                <div class="col-sm-5  product-box">
                    <h2 class="title"><?php  $p = \App\Models\Product::find($product); echo $p->title ?></h2>
                    <span>قیمت : </span><span class="desc"><?php
                        $pr = $p->Discount()->get();
                        $sum = 0 ;
                        foreach($pr as $d)
                        {
                            $sum+= $d->price;
                        }
                        echo $p->price-$sum;$Price +=$p->price - $sum;
                        ?>
                        </span><br><br>
                </div>
                <div class="col-sm-1"></div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_1): ?>
            <?php endif; ?><br>
        </div>
        <div class="container-fluid">
            <h1 class="head">جمع کل : <?php echo e($Price); ?> ریال</h1>
            <textarea placeholder="آدرس و نام شما" cols="40" rows="5" class="address"></textarea><br><br>
            <a class="sale btn btn-default">تایید آدرس </a><br><br>
            <form class="form-group" method="post" action="<?php echo e(url('/buy')); ?>">
                <input type="text" size="40" class="edit" name="code" placeholder="کد تخفیفتان را وارد کنید"><br><br>
                <input hidden name="price" value="<?php echo e($Price); ?>">
                <input hidden name="_token" value="<?php echo e(csrf_token()); ?>">
                <input type="submit"  class="btn btn-wide btn-success " value="پرداخت">
            </form><br>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('sidebar'); ?>
    <div class="content-home" >
        <div class="container-fluid">
            <?php $__empty_1 = true; $__currentLoopData = $Cat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_1 = false; ?>
                <a href="<?php echo e(url('/cat/'.$cat->id)); ?>" class="feed-item"><span class="glyphicon glyphicon-folder-close"></span><?php echo e($cat->name); ?></a><br>
                <?php $__empty_2 = true; $__currentLoopData = $cat->subcat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sub): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_2 = false; ?>
                    <a href="<?php echo e(url('/subcat/'.$sub->id)); ?>" style="padding-right: 20px"><span class="glyphicon glyphicon-folder-open"></span><?php echo e($sub->name); ?></a><br>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_2): ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_1): ?>
            <?php endif; ?>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>