

<div class="block" x-data="order_details($store.cart.content)">
    <div class="row">
      <div class="col-lg-12">
          <?php echo $__env->make('backend.orders.create.blocs.order.order-details', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
      </div>
    </div>
  </div>


<?php $__env->startPush("js"); ?>
    <script>

        document.addEventListener('alpine:init', () => {

            Alpine.data("switch",() => ({
                is_checked : true,
            }));


            Alpine.store('cart', {
                init (){
                   const content = this.content ;

                   // Par defaut le panier est ce qui se trouve dans le localStorage
                   if(content){
                        if ("customer" in content)  this.customer = content.customer;
                        if ("allTotal" in content)   this.allTotal = content.allTotal ;
                        if ("config" in content)   this.config = content.config ;
                        if ("items" in content)   this.items = content.items ;
                        if ("reference" in content)   this.ref = content.ref ;
                        if ("billing_desk" in content)   this.billing_desk = content.billing_desk ;
                        if ("warehouse" in content)   this.warehouse = content.warehouse ;
                        if ("admin" in content)   this.admin = content.admin ;
                       // showOffcanvasBottom(true)
                   }
                },
                customer : null,
                ref : null,
                billing_desk : null,
                admin : <?php echo json_encode($admin, 15, 512) ?>,
                items :  [],
                config: {},
                allTotal: {},

                get count () {
                    return this.items.length;
                }  ,

                get content  () {
                    return JSON.parse(localStorage.getItem("CART")) ?? {};
                },
                setCart ( cart = {}){
                    localStorage.setItem("CART",JSON.stringify(cart))

                    if ("customer" in cart)  this.customer = cart.customer;
                    if ("allTotal" in cart)   this.allTotal = cart.allTotal ;
                    if ("config" in cart)   this.config = cart.config ;
                    if ("items" in cart)   this.items = cart.items ;
                    if ("billing_desk" in cart)   this.billing_desk = cart.billing_desk ;

                    //showOffcanvasBottom((this.items.length > 0))
                },
            });


        });
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH /home2/lekruu/public_html/resources/views/backend/orders/create/blocs/order/tab-cart.blade.php ENDPATH**/ ?>