<div style="margin-bottom: 30px;" class="row">
    <a style="position: absolute;left: 10px;top: 3px;" class="btn btn-sm bg-blue addComb" href="#"><i class="fa fa-plus-square"></i> إضافة كمية</a>
</div>
<div class="CombList">
<?php $__currentLoopData = $product->productCombination; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $prodcomb): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <?php
        $ci = $loop->iteration-1;
    ?>
    <div class="row itemComb">
            <div class="col-md-4">
                <div class="form-group">
                    <label>المخزن</label>
                    <select required name="combination[<?php echo e($ci); ?>][store_id]" class="form-control">
                        <?php $__currentLoopData = \App\Store::get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $storeObj): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php echo e($storeObj->id==$prodcomb->pivot->store_id?'selected':''); ?> value="<?php echo e($storeObj->id); ?>"><?php echo e($storeObj->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label>اللون والمقاس</label>
                    <select required name="combination[<?php echo e($ci); ?>][combination_id]" class="form-control colorsize" style="width: 100%;">
                        <option value="">--- إختر ---</option>
                        <?php $__currentLoopData = \App\Combination::get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $combination): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php echo e($combination->id==$prodcomb->id?'selected':''); ?> value="<?php echo e($combination->id); ?>"><?php echo e($combination->title); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label><?php echo app('translator')->getFromJson('front.quantity'); ?></label>
                    <input name="combination[<?php echo e($ci); ?>][qty]" value="<?php echo e($prodcomb->pivot->qty); ?>" type="number" step="any"  class="form-control" required="required">
                </div>
                <a style="position: absolute;left: 50px;top: -6px;" class="btn btn-sm bg-green addComb" href="#"><i class="fa fa-plus-square"></i></a>
                <a style="position: absolute;left: 15px;top: -6px;" class="btn btn-sm bg-red removeComb" href="#"><i class="fa fa-minus"></i></a>
            </div>
        </div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php $__env->startPush('js'); ?>
    <script>

        $(document).on("click",".removeComb",function(e){
            e.preventDefault();
            $(this).closest('.itemComb').remove();
        });
        $(document).on("click",".addComb",function(e){
            e.preventDefault();
            var clone = $(".com-item").find(".itemComb").clone();
            var i = $(".itemComb:visible").length;
            clone.find('input,select').each(function() {
                this.name= this.name.replace('[]', '['+i+']');
            });
            clone.find(".colorsize").select2({dir: "rtl"});
            $(".CombList").append(clone);
        });
    </script>

<?php $__env->stopPush(); ?>
