👁 查看:fb9700f29fe840b45f28cecfc472999f1bd2e53c.php
路径:/home/boguraj1/.trash/storage/framework/views/fb9700f29fe840b45f28cecfc472999f1bd2e53c.php
大小:6.51 KB · 修改:2026-07-24 03:26:00 · 权限:0644 · 可写
<?php $__env->startSection('title', 'Shopping Cart'); ?>

<?php $__env->startSection('content'); ?>
<div class="container py-5">
    <h2 class="section-title">Shopping Cart</h2>

    <?php if($cartItems->count() > 0): ?>
    <div class="row g-4">
        <div class="col-lg-8">
            <div class="card border-0 shadow-sm">
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table align-middle mb-0">
                            <thead style="background:#f8f9fa">
                                <tr>
                                    <th class="px-4 py-3">Product</th>
                                    <th class="py-3">Price</th>
                                    <th class="py-3">Qty</th>
                                    <th class="py-3">Subtotal</th>
                                    <th class="py-3"></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $cartItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $price = $item->product->current_price + ($item->variation?->price_adjustment ?? 0);
                                    $sub   = $price * $item->quantity;
                                ?>
                                <tr>
                                    <td class="px-4 py-3">
                                        <div class="d-flex align-items-center gap-3">
                                            <img src="<?php echo e($item->product->thumbnail_url); ?>" style="width:60px;height:60px;object-fit:cover;border-radius:8px" alt="">
                                            <div>
                                                <a href="<?php echo e(route('product.show', $item->product->slug)); ?>" class="fw-semibold text-decoration-none" style="color:var(--dark)"><?php echo e($item->product->name); ?></a>
                                                <?php if($item->variation): ?>
                                                <div class="text-muted" style="font-size:12px"><?php echo e($item->variation->label); ?></div>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="py-3">৳<?php echo e(number_format($price, 0)); ?></td>
                                    <td class="py-3">
                                        <form action="<?php echo e(route('cart.update', $item)); ?>" method="POST" class="d-flex align-items-center gap-1">
                                            <?php echo csrf_field(); ?> <?php echo method_field('PATCH'); ?>
                                            <input type="number" name="quantity" value="<?php echo e($item->quantity); ?>" min="1" class="form-control form-control-sm text-center" style="width:60px">
                                            <button type="submit" class="btn btn-sm btn-outline-secondary"><i class="bi bi-arrow-repeat"></i></button>
                                        </form>
                                    </td>
                                    <td class="py-3 fw-bold" style="color:var(--primary)">৳<?php echo e(number_format($sub, 0)); ?></td>
                                    <td class="py-3">
                                        <form action="<?php echo e(route('cart.remove', $item)); ?>" method="POST">
                                            <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                            <button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Remove this item?')">
                                                <i class="bi bi-trash"></i>
                                            </button>
                                        </form>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="mt-3">
                <a href="<?php echo e(route('shop')); ?>" class="btn btn-outline-secondary">
                    <i class="bi bi-arrow-left me-1"></i>Continue Shopping
                </a>
            </div>
        </div>

        <div class="col-lg-4">
            <div class="card border-0 shadow-sm">
                <div class="card-body p-4">
                    <h5 class="fw-bold mb-4" style="color:var(--dark)">Order Summary</h5>
                    <div class="d-flex justify-content-between mb-2">
                        <span class="text-muted">Subtotal</span>
                        <span class="fw-semibold">৳<?php echo e(number_format($total, 0)); ?></span>
                    </div>
                    <div class="d-flex justify-content-between mb-2">
                        <span class="text-muted">Delivery</span>
                        <span class="text-success fw-semibold">Free</span>
                    </div>
                    <hr>
                    <div class="d-flex justify-content-between mb-4">
                        <span class="fw-bold fs-5">Total</span>
                        <span class="fw-bold fs-5" style="color:var(--primary)">৳<?php echo e(number_format($total, 0)); ?></span>
                    </div>
                    <a href="<?php echo e(route('checkout')); ?>" class="btn btn-danger w-100 py-2 fw-semibold">
                        Proceed to Checkout <i class="bi bi-arrow-right ms-1"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <?php else: ?>
    <div class="text-center py-5">
        <i class="bi bi-cart-x" style="font-size:80px;color:#ddd"></i>
        <h4 class="mt-3 text-muted">Your cart is empty</h4>
        <a href="<?php echo e(route('shop')); ?>" class="btn btn-danger mt-3 px-5">Start Shopping</a>
    </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/boguraj1/public_html/udoktaecom/resources/views/frontend/cart.blade.php ENDPATH**/ ?>