<!-- //page -->
<!-- Single Page -->
<div class="banner-bootom-w3-agileits">
<div>
<!-- //tittle heading -->
<div class="col-md-5 single-right-left ">
<img src="<?php echo e(url('public/uploads/products')); ?>/<?php echo e($product_images[0]->image_name); ?>" data-imagezoom="true" class="img-responsive" alt="">
</div>
<div class="col-md-7 single-right-left simpleCart_shelfItem">
<div style="padding: 10px">
<h2 class="product-single__title"><?php echo e($products[0]->name); ?></h2>
<h3>£<span id="product_amount"><?php echo e($products[0]->amount); ?></span></h3>
</div>
<form method="get" id="product_form_1330040799303" accept-charset="UTF-8" class="product-form product-form-product-template product-form--hide-variant-labels
" enctype="multipart/form-data" novalidate="novalidate"><div class="bold_qb_grid" data-variant-id="12527035580487"></div><input type="hidden" name="form_type" value="product"><input type="hidden" name="utf8" value="✓">
<input type="hidden" name="secondquantity" id="secondquantity" value="<?php echo e($product_rates[0]->quantity); ?>">
<input type="hidden" name="unit" id="unit" value="<?php echo e($product_rates[0]->unit); ?>">
<input type="hidden" name="amount" id="amount" value="<?php echo e($product_rates[0]->amount); ?>">
<input type="hidden" name="product_id" id="product_id" value="<?php echo e($products[0]->product_id); ?>">
<div class="selector-wrapper js product-form__item">
<input type="hidden" id="hidden_rate_id" value="<?php echo e($rate_id); ?>">
<input type="hidden" id="hidden_amount" value="<?php echo e($hidden_amount); ?>">
<input type="hidden" id="hidden_unit" value="<?php echo e($hidden_unit); ?>">
<input type="hidden" id="hidden_quantity" value="<?php echo e($hidden_quantity); ?>">
<div class="col-md-10">
<select class="form-control" id="product_quantity_unit" data-index="option1">
<?php $__currentLoopData = $product_rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($rate->rate_id); ?>" data-quantity="<?php echo e($rate->quantity); ?>" data-unit="<?php echo e($rate->unit); ?>" data-amount="<?php echo e($rate->amount); ?>" value="<?php echo e($rate->rate_id); ?>"><?php echo e($rate->quantity); ?><?php echo e($rate->unit); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-2">
<div class="product-form__item product-form__item--quantity">
<input type="number" id="Quantity-product-template" name="quantity" value="1" min="1" class="form-control" pattern="[0-9]*">
</div>
</div>
</div>
<div class="product-form__item product-form__item--submit">
<div align="center">
<span id="success_messsage" style="color: #0000ff; font-weight: bold; display: none">Product Added To Cart Successfully</span>
</div>
</div>
<?php if($products[0]->in_stock=='Y'): ?>
<div align="center" class="product-form__item product-form__item--submit">
<button type="submit" name="add" id="AddToCart-product-template" class="btn product-form__cart-submit" style="color: #fff;
background: #1accfd;
text-decoration: none;
position: relative;
border: none;
border-radius: 0;
width: 50%;
margin-top: 10px;
text-transform: uppercase;
padding: 13px;
outline: none;
letter-spacing: 1px;
font-weight: 600;">
<span id="AddToCartText-product-template">Add to cart</span>
</button>
<p id="message1" class="ajaxified-cart-feedback success" style="display: none"><i class="fa fa-check"></i> Added to cart! <a href="<?php echo e(url('view_cart')); ?>">View cart</a> or <a href="<?php echo e(url('/')); ?>" title="Continue shopping">Continue shopping</a>.</p>
</div>
<?php else: ?>
<div align="center" class="product-form__item product-form__item--submit">
<span style="color: #0000ff; font-weight: bold;">Product is Out of Stock</span>
</div>
<?php endif; ?>
</form>
<h3 style="margin-top: 20px"><?php echo e($products[0]->name); ?></h3>
<div class="product-single-w3l" >
<?php echo $products[0]->description; ?>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
<script>
$(document).ready(function(){
var hidden_rate_id=$('#hidden_rate_id').val();
$("#product_quantity_unit option[value="+hidden_rate_id+"]").attr('selected', 'selected');
var hidden_amount=$('#hidden_amount').val();
var hidden_unit=$('#hidden_unit').val();
var hidden_quantity=$('#hidden_quantity').val();
$('#product_amount').text(hidden_amount);
$('#amount').val(hidden_amount);
$('#unit').val(hidden_unit);
$('#secondquantity').val(hidden_quantity);
$('#product_quantity_unit').on('change',function(){
var amount=$(this).find(':selected').data('amount');
var quantity=$(this).find(':selected').data('quantity');
var unit=$(this).find(':selected').data('unit');
$('#product_amount').text(amount);
$('#amount').val(amount);
$('#unit').val(unit);
$('#secondquantity').val(quantity);
});
$('.product-form__cart-submit').on('click',function(e){
e.preventDefault();
var amount= $('#amount').val();
var unit= $('#unit').val();
var secondquantity= $('#secondquantity').val();
var product_id= $('#product_id').val();
var quantity= $('#Quantity-product-template').val();
$.ajax({
type:'POST',
url:'<?php echo e(url("add_to_cart")); ?>',
data:{
"_token": "<?php echo e(csrf_token()); ?>",
'amount':amount,
'unit':unit,
'secondquantity':secondquantity,
'product_id':product_id,
'quantity':quantity
},
success:function(data){
if(data=='Y'){
$("#success_messsage").show("slow").delay(3000).hide("slow");
$('#message1').show();
$.ajax({
'type':'Get',
'url':"<?php echo e(url('cart_count')); ?>",
success:function(response){
// alert(response);
$('#cartcount').text('');
$('#cartcount').text(response)
}
});
}
}
});
}) ;
});
</script>
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]