<?php
    $items = 0;
    foreach($carts as $cart){
        if(auth()->check()){
            $items += $cart->qty;
        }else{
            $items += $cart['qty'];
        }
    }

    $base_url = url('/');
    $current_url = url()->current();
    $just_path = trim(str_replace($base_url,'',$current_url));

?>
<a href="javascript:void(0);" class="cart_menu_item">
    <i class="ti-bag"><span><?php echo e($items); ?></span></i> <?php echo e(__('common.cart')); ?></a>
<div class="cart_iner cart_for_inner">
    <div class="all_product_cart_submenu">
    <?php
    $subtotal = 0;
    ?>

    <?php $__currentLoopData = $carts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cart): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $subtotal += $cart->price * $cart->qty;
        ?>
        <?php if($cart->product_type == "gift_card"): ?>
            <div class="single_product media">
                <div class="cart_data_img_div">
                    <img class="" src="<?php echo e(asset(asset_path(@$cart->giftCard->thumbnail_image))); ?>" alt="#" />
                </div>
                <div class="media-body">
                    <a class="d-block" href="<?php echo e(route('frontend.gift-card.show',$cart->giftCard->sku)); ?>"><?php echo e($cart->giftCard->name); ?></a>

                    <span><?php echo e(single_price($cart->price)); ?> x <?php echo e($cart->qty); ?></span>
                    <div class="close_icon">
                        <?php if($just_path != '/checkout'): ?>
                        <button type="button" class="transfarent-btn" id="submenu_cart_btn_<?php echo e($cart->id); ?>"><i class="ti-close text-white remove_from_submenu_btn" data-id="<?php echo e($cart->id); ?>" data-product_id="<?php echo e($cart->product_id); ?>" data-btn="#submenu_cart_btn_<?php echo e($cart->id); ?>"></i></button>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        <?php else: ?>
            <div class="single_product media">
                <div class="cart_data_img_div">
                    <img class="" src="
                        <?php if(@$cart->product->product->product->product_type == 1): ?>
                            <?php echo e(asset(asset_path(@$cart->product->product->product->thumbnail_image_source))); ?>

                        <?php else: ?>
                            <?php echo e(asset(asset_path(@$cart->product->sku->variant_image?@$cart->product->sku->variant_image:@$cart->product->product->product->thumbnail_image_source))); ?>

                        <?php endif; ?>
                        " alt="#" />
                </div>
                <div class="media-body">
                    <a class="d-block" href="<?php echo e(route('frontend.item.show',$cart->product->product->slug)); ?>"><?php echo e($cart->product->product->product->product_name); ?></a>
                    <?php if($cart->product->product->product->product_type == 2): ?>
                        <p>
                            <?php
                                $countCombinatiion = count(@$cart->product->product_variations);
                            ?>
                            <?php $__currentLoopData = $cart->product->product_variations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $combination): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if($combination->attribute->name == 'Color'): ?>
                                <?php echo e($combination->attribute->name); ?>: <?php echo e($combination->attribute_value->color->name); ?>

                                <?php else: ?>
                                <?php echo e($combination->attribute->name); ?>: <?php echo e($combination->attribute_value->value); ?>

                                <?php endif; ?>

                                <?php if($countCombinatiion > $key +1): ?>
                                ,
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                        </p>
                    <?php endif; ?>
                    <span><?php echo e(single_price($cart->price)); ?> x <?php echo e($cart->qty); ?></span>
                    <div class="close_icon">
                        <?php if($just_path != '/checkout'): ?>
                        <button type="button" class="transfarent-btn" id="submenu_cart_btn_<?php echo e($cart->id); ?>"><i class="ti-close text-white remove_from_submenu_btn" data-id="<?php echo e($cart->id); ?>" data-product_id="<?php echo e($cart->product_id); ?>" data-btn="#submenu_cart_btn_<?php echo e($cart->id); ?>"></i></button>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

</div>


    <div class="total_price d-flex align-items-center justify-content-between">
        <p><?php echo e(__('common.subtotal')); ?></p>
        <span><?php echo e(single_price($subtotal)); ?></span>
    </div>
    <a href="<?php echo e(route('frontend.shopping_from_recent_viewed')); ?>" class="btn_2"><?php echo e(__('defaultTheme.continue_shopping')); ?></a>
    <a href="<?php echo e(route('frontend.cart')); ?>" class="btn_1"><?php echo e(__('defaultTheme.view_shopping_cart')); ?></a>

</div>
<?php /**PATH /home/penastud/public_html/mart/resources/views/frontend/default/partials/_cart_details_submenu.blade.php ENDPATH**/ ?>