
<?php $__env->startSection('title', 'Product'); ?>
<?php $__env->startSection('content'); ?>
<div class="mad-content">
  <div class="container">
    <div class="content-element-13">
      <div class="mad-product mad-product-single">
        <div class="row justify-content-center">
          <div class="col-xl-6 col-lg-8 col-md-10">
            <div class="image-preview-container">
              <div class="image-preview">
                <a href="<?php echo e(asset('storage/media/'.$product->image)); ?>" data-fancybox="group">
                  <img id="zoom-image" src="<?php echo e(asset('storage/media/'.$product->image)); ?>" alt="">
                </a>
              </div>
            </div>
            <h2 class="mad-product-title"><?php echo e($product->name); ?>

              <div class="mad-label"><img class="svg" src="<?php echo e(asset('assets_front/yummi_svg_icons/carrot.svg')); ?>" alt=""></div>
            </h2>
            <p><?php echo e($product->short_desc); ?></p>
            <div class="mad-product-calc">
              <span class="mad-product-price"><?php echo e($product->product_price); ?></span>
            </div>
            <div class="form-control content-element-6">
              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Wings:</p>
                <div class="mad-toggled-fields hr-type">
                  <?php $__currentLoopData = $wings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $wings): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <input type="radio" name="wings" id="radio-wings<?php echo e($wings->id); ?>">
                  <label for="radio-wings<?php echo e($wings->id); ?>" class="mad-label-radio" onclick="wings('<?php echo e($wings->ws_price); ?>','<?php echo e($wings->wings_sauce); ?>')"><?php echo e($wings->wings_sauce); ?>

                    <p class="attrprice">$<?php echo e($wings->ws_price); ?></p>
                  </label>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
              </div>

              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Sauces:</p>
                <div class="mad-toggled-fields hr-type">
                  <?php $__currentLoopData = $sauces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sauces): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <input type="radio" name="sauces" id="radio-sauces<?php echo e($sauces->id); ?>">
                  <label for="radio-sauces<?php echo e($sauces->id); ?>" class="mad-label-radio" onclick="sauces('<?php echo e($sauces->sauce_price); ?>','<?php echo e($sauces->sauce); ?>')"><?php echo e($sauces->sauce); ?>

                    <p class="attrprice"> $<?php echo e($sauces->sauce_price); ?></p>
                  </label>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
              </div>
              <dl role="presentation" class="mad-panels mad-panels--toggles">
                <form id="toppings_data">
                  <?php $__currentLoopData = $toppings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $toppings): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                  <dt class="mad-panels-title">
                    <button id="panel-44-button" type="button" aria-expanded="false" aria-controls="panel-44" aria-disabled="false"><?php echo e($toppings->toppings); ?></button>
                  </dt>
                  <dd id="panel-44" class="mad-panels-definition" style="display: none;">
                    <p class="pizzadata">
                      <a href="javascript:void(0)" onclick="showprice('<?php echo e($toppings->id); ?>','<?php echo e($toppings->toppings_price/2); ?>','<?php echo e($toppings->toppings); ?>','toppingsqty')" id="showprice_<?php echo e($toppings->id); ?>" class="pizzahalf_link topping_type"><img src="<?php echo e(asset('assets_front/images/pizza-left.png')); ?>" alt=""> </a>
                      <a href="javascript:void(0)" onclick="showpricenter('<?php echo e($toppings->id); ?>','<?php echo e($toppings->toppings_price); ?>','<?php echo e($toppings->toppings); ?>')" id="showpricenter_<?php echo e($toppings->id); ?>" class="pizzacircule_link topping_type"><img src="<?php echo e(asset('assets_front/images/pizza-center.png')); ?>" alt=""></a>
                      <a href="javascript:void(0)" onclick="showpriceright('<?php echo e($toppings->id); ?>','<?php echo e($toppings->toppings_price/2); ?>','<?php echo e($toppings->toppings); ?>')" id="showpriceright_<?php echo e($toppings->id); ?>" class="toppings_link topping_type"><img src="<?php echo e(asset('assets_front/images/pizza-right.png')); ?>" alt=""></a>
                      <label class="price-pizzahalf<?php echo e($toppings->id); ?>" style="display: none;" id="qtyleft">$<?php echo e($toppings->toppings_price/2); ?></label>
                      <label class="price-pizzacircule<?php echo e($toppings->id); ?>" style="display: none;">$<?php echo e($toppings->toppings_price); ?></label>
                      <label class="price-pizzaright<?php echo e($toppings->id); ?>" style="display: none;">$<?php echo e($toppings->toppings_price/2); ?></label>
                      <br>
                      <input type="number" value="0" name="toppingsqty[]" id="toppingsqty<?php echo e($toppings->id); ?>" class="toppingsqty" onchange="topsqtych('<?php echo e($toppings->id); ?>','<?php echo e($toppings->toppings_price); ?>')">
                    </p>
                  </dd>
                  <input type="hidden" id="toppings_left_name_<?php echo e($toppings->id); ?>" name="toppings_left_name[]" />
                  <input type="hidden" id="toppings_left_id_<?php echo e($toppings->id); ?>" name="toppings_left_id[]" />
                  <input type="hidden" id="toppings_center_name_<?php echo e($toppings->id); ?>" name="toppings_center_name[]" />
                  <input type="hidden" id="toppings_center_id_<?php echo e($toppings->id); ?>" name="toppings_center_id[]" />
                  <input type="hidden" id="toppings_right_name_<?php echo e($toppings->id); ?>" name="toppings_right_name[]" />
                  <input type="hidden" id="toppings_right_id_<?php echo e($toppings->id); ?>" name="toppings_right_id[]" />
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </form>
              </dl>

              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Crusts:</p>
                <div class="mad-toggled-fields hr-type">
                  <?php $__currentLoopData = $crusts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $crusts): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <input type="radio" name="crusts" id="radio-crusts<?php echo e($crusts->id); ?>">
                  <label for="radio-crusts<?php echo e($crusts->id); ?>" class="mad-label-radio" onclick="crusts('<?php echo e($crusts->crust_price); ?>','<?php echo e($crusts->crust); ?>')"><?php echo e($crusts->crust); ?>

                    <p class="attrprice">$<?php echo e($crusts->crust_price); ?></p>
                  </label>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
              </div>

              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Dippings:</p>
                <div class="mad-toggled-fields hr-type">
                  <?php $__currentLoopData = $dippings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dippings): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <input type="radio" name="dippings" id="radio-dippings<?php echo e($dippings->id); ?>">
                  <label for="radio-dippings<?php echo e($dippings->id); ?>" class="mad-label-radio" onclick="dippings('<?php echo e($dippings->dipping_price); ?>','<?php echo e($dippings->dipping); ?>')"><?php echo e($dippings->dipping); ?>

                    <p class="attrprice">$<?php echo e($dippings->dipping_price); ?></p>
                  </label>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
              </div>

              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Cookings:</p>
                <div class="mad-toggled-fields hr-type">
                  <?php $__currentLoopData = $cookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cookings): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <input type="radio" name="cookings" id="radio-cookings<?php echo e($cookings->id); ?>">
                  <label for="radio-cookings<?php echo e($cookings->id); ?>" class="mad-label-radio" onclick="cookings('<?php echo e($cookings->cooking_price); ?>','<?php echo e($cookings->cooking); ?>')"><?php echo e($cookings->cooking); ?>

                    <p class="attrprice">$<?php echo e($cookings->cooking_price); ?></p>
                  </label>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
              </div>


              <div class="content-element-2">
                <p class="mad-text-color-2 content-element">Quantity:</p>
                <div class="btn-set big-btns">
                  <div class="quantity size-2">
                    <input type="text" value="1" readonly="" name="qty" id="qty">
                    <button type="button" class="qty-plus"><i class="licon-plus"></i></button>
                    <button type="button" class="qty-minus"><i class="licon-minus"></i></button>
                  </div>
                  <button id="add_to_cart_button" class="btn btn-big btn-style-3" onclick="add_to_cart('<?php echo e($product->id); ?>')"><i class="material-icons-outlined">shopping_cart</i><span>Add to
                      Cart</span></button>
                </div>
              </div>
            </div>
           
          </div>
          <div class="col-xl-2">
            <!-- <div class="image-preview-container">
              <div class="image-preview">
                <a href="<?php echo e(asset('storage/media/'.$product->image)); ?>" data-zoom-image="<?php echo e(asset('storage/media/'.$product->image)); ?>" data-fancybox="group">
                  <img id="zoom-image" src="<?php echo e(asset('storage/media/'.$product->image)); ?>" alt="">
                </a>
              </div>
            </div> -->
          </div>
        </div>
        
      </div>
    </div>
  </div>
</div>
<form id="frmAddToCart">
  <input type="hidden" id="Product_name" name="product_name" value="<?php echo e($product->name); ?>" />
  <input type="hidden" id="Product_id" name="product_price" value="<?php echo e($product->product_price); ?>" />
  <input type="hidden" id="wings_name" name="wings_name" />
  <input type="hidden" id="wings_id" name="ws_price" />
  <input type="hidden" id="sauces_name" name="sauces_name" />
  <input type="hidden" id="sauces_id" name="sauce_price" />
  <!-- <input type="hidden" id="toppings_left_name" name="toppings_left_name[]" />
  <input type="hidden" id="toppings_left_id" name="toppings_left_id[]" />
  <input type="hidden" id="toppings_center_name" name="toppings_center_name[]" />
  <input type="hidden" id="toppings_center_id" name="toppings_center_id[]" />
  <input type="hidden" id="toppings_right_name" name="toppings_right_name[]" />
  <input type="hidden" id="toppings_right_id" name="toppings_right_id[]" /> -->
  <input type="hidden" id="crusts_name" name="crusts_name" />
  <input type="hidden" id="crusts_id" name="crust_price" />
  <input type="hidden" id="dippings_name" name="dippings_name" />
  <input type="hidden" id="dippings_id" name="dipping_price" />
  <input type="hidden" id="cookings_name" name="cookings_name" />
  <input type="hidden" id="cookings_id" name="cooking_price" />
  <input type="hidden" id="category_id" name="category_id" value="<?php echo e($product->category_id); ?>" />
  <input type="hidden" id="pqty" name="pqty" />
  <?php echo csrf_field(); ?>
</form>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('assets_front/vendors/monkeysan.accordion.js')); ?>"></script>
<script>
  $(function() {
    $('#add_to_cart_button').prop('disabled', false);
  });

  function topsqtych(id, toppings_price) {
    qt = jQuery('#toppingsqty' + id).val();
    // total = toppings_price * qt;
    // jQuery('#toppings_left_id_' + id).val(total);
    // jQuery('label #qtyleft' + id).html(total);
    // alert(toppings_price * qt);
    id.val = qt;
    // jQuery('.topping_type.active').trigger('click');
    console.log(jQuery('.topping_type.active'));
    jQuery('.topping_type.active').click();
  }

  function showprice(id, toppings_price, toppings) {
    qt = jQuery('#toppingsqty' + id).val();
    if (qt == 0) {
      jQuery('#toppingsqty' + id).val(1);
      qt = 1;
    }
    total = toppings_price * qt;
    jQuery('#toppings_left_id_' + id).val(total);
    jQuery('.price-pizzahalf' + id).html('$' + total);
    jQuery('#toppings_left_name_' + id).val(toppings);
    // jQuery('#toppings_left_id').attr("name", 'toppings_left_id' + toppings);
    jQuery('.price-pizzaright' + id).hide();
    jQuery('.price-pizzacircule' + id).hide();
    jQuery('.price-pizzahalf' + id).show();
    jQuery('#showprice_' + id).css({
      'border': '1px solid black',
      'background-color': '#0080006b',
      'border-radius': '12px'
    });
    jQuery('.topping_type').removeClass('active');
    jQuery('#showprice_' + id).addClass('active');
    jQuery('#showpricenter_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });
    jQuery('#showpriceright_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });

  }

  function showpricenter(id, toppings_price, toppings) {
    qt = jQuery('#toppingsqty' + id).val();
    if (qt == 0) {
      jQuery('#toppingsqty' + id).val(1);
      qt = 1;
    }
    totalcenter = toppings_price * qt;
    jQuery('#toppingsqty' + id).val(qt);
    jQuery('#toppings_center_id_' + id).val(totalcenter);
    jQuery('.price-pizzacircule' + id).html('$' + totalcenter);
    jQuery('#toppings_center_name_' + id).val(toppings);
    // jQuery('#toppings_center_id').attr("name", 'toppings_center_id' + toppings);
    jQuery('.price-pizzaright' + id).hide();
    jQuery('.price-pizzacircule' + id).show();
    jQuery('.price-pizzahalf' + id).hide();
    jQuery('#showpricenter_' + id).css({
      'border': '1px solid black',
      'background-color': '#0080006b',
      'border-radius': '12px'
    });
    jQuery('.topping_type').removeClass('active');
    jQuery('#showpricenter_' + id).addClass('active');
    jQuery('#showpriceright_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });
    jQuery('#showprice_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });
  }

  function showpriceright(id, toppings_price, toppings) {
    qt = jQuery('#toppingsqty' + id).val();
    if (qt == 0) {
      jQuery('#toppingsqty' + id).val(1);
      qt = 1;
    }
    totalright = toppings_price * qt;
    jQuery('#toppingsqty' + id).val(qt);
    jQuery('#toppings_right_id_' + id).val(totalright);
    jQuery('.price-pizzaright' + id).html('$' + totalright);
    jQuery('#toppings_right_name_' + id).val(toppings);
    // jQuery('#toppings_right_id').attr("name", 'toppings_right_id' + toppings);
    jQuery('.price-pizzaright' + id).show();
    jQuery('.price-pizzacircule' + id).hide();
    jQuery('.price-pizzahalf' + id).hide();
    jQuery('#showpriceright_' + id).css({
      'border': '1px solid black',
      'background-color': '#0080006b',
      'border-radius': '12px'
    });
    jQuery('.topping_type').removeClass('active');
    jQuery('#showpriceright_' + id).addClass('active');
    jQuery('#showprice_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });
    jQuery('#showpricenter_' + id).css({
      'border': 'none',
      'background-color': 'snow',
      'border-radius': 'unset'
    });
  }

  function wings(ws_price, wings_sauce) {
    jQuery('#wings_id').val(ws_price);
    jQuery('#wings_name').val(wings_sauce);
    // jQuery('#wings_id').attr("name", 'wings_id' + wings_sauce);
  }

  function sauces(sauce_price, sauce) {
    jQuery('#sauces_id').val(sauce_price);
    jQuery('#sauces_name').val(sauce);
    // jQuery('#sauces_id').attr("name", 'sauces_id' + sauce);
  }

  function crusts(crust_price, crust) {
    jQuery('#crusts_id').val(crust_price);
    jQuery('#crusts_name').val(crust);
    // jQuery('#crusts_id').attr("name", 'crusts_id' + crust);
  }

  function dippings(dipping_price, dipping) {
    jQuery('#dippings_id').val(dipping_price);
    jQuery('#dippings_name').val(dipping);
    // jQuery('#dippings_id').attr("name", 'dippings_id' + dipping);
  }

  function cookings(cooking_price, cooking) {
    jQuery('#cookings_id').val(cooking_price);
    jQuery('#cookings_name').val(cooking);
    // jQuery('#cookings_id').attr("name", 'cookings_id' + cooking);
  }

  function add_to_cart(id) {
    $('#add_to_cart_button').prop('disabled', true);
    var toppings_left_id = jQuery('#toppings_left_id').val();
    var toppings_center_id = jQuery('#toppings_center_id').val();
    var toppings_right_id = jQuery('#toppings_right_id').val();
    var wings_id = jQuery('#wings_id').val();
    var sauces_id = jQuery('#sauces_id').val();
    var crusts_id = jQuery('#crusts_id').val();
    var dippings_id = jQuery('#dippings_id').val();
    var cookings_id = jQuery('#cookings_id').val();

    jQuery('#product_id').val(id);
    jQuery('#pqty').val(jQuery('#qty').val());
    jQuery.ajax({
      url: '/add_to_cart',
      data: jQuery('#frmAddToCart').serialize() + '&' + jQuery('#toppings_data').serialize(),
      type: 'post',
      success: function(result) {
        jQuery('#frmAddToCart')[0].reset();
        jQuery('#toppings_data')[0].reset();
        jQuery('#thank_you_msg').html(result.msg);
        window.location.href = result.redirect;
      }
    })
  }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.pageheader', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Xampp\htdocs\pizzafront\resources\views\front\singalproduct.blade.php ENDPATH**/ ?>