<?php echo $__env->make('User.layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php echo $__env->yieldContent('body'); ?>

<?php echo $__env->make('User.layouts.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<script type="text/javascript">
	shopping_cart();
	placeorder_show();
	totalcartprice();
	totalcartqunt();
	totalcartamount();
	totalcartamounts();
	
	 $('#loading').hide();

	function AddCart(product_id)
	{
		var Quantity = $("#Quantity-"+product_id).val();
		// var size = $("#size-"+product_id).val();
		// var color = $("#color-"+product_id).val();
		var size = $('#size').val();
		var color = $('#color').val();

		$.ajax({
			headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>" },
			url: '<?php echo e(url("add_to_cart")); ?>',
			type:'POST',
			data:{product_id:product_id,Quantity:Quantity,size:size,color:color},
			beforeSend:function(){
				 $('#cartbutton').hide();
				 $('#loading').show();
			},
			success: function(data)
			{
				UIkit.notification({
					message: '<i class="fa fa-shopping-basket"></i>&nbsp;&nbsp;&nbsp;Product Added To Shopping Cart',
					pos:     'bottom-center',
					timeout:  2000,
					status: 'primary',
				});
				shopping_cart();
				totalcartprice();
				totalcartqunt();
				totalcartamount();

				$('#loading').hide();
				$('#cartbutton').show();
			}
		});
	}


	function shopping_cart()
	{
		
		$.ajax({
			headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>" },
			url: '<?php echo e(url("shoppingcart_view")); ?>',
			type:'POST',
			data:{},
			success: function(data)
			{
				$("#cartshow").html(data);
			}
		});
	}


	function placeorder_show()
	{
		
		$.ajax({
			headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>" },
			url: '<?php echo e(url("placeorder_show")); ?>',
			type:'POST',
			data:{},
			success: function(data)
			{
				$("#placeordershow").html(data);
			}
		});
	}

	function delete_product(product_id)
	{
		
		$.ajax({
			headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>" },
			url: '<?php echo e(url("delete_product")); ?>',
			type:'POST',
			data:{product_id:product_id},
			success: function(data)
			{
				UIkit.notification({
					message: '<i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;Product Remove To Shopping Cart',
					pos:     'bottom-center',
					timeout:  2000
				});

				shopping_cart();
				placeorder_show();
				totalcartprice();
				totalcartqunt();
				totalcartamount();
			}
		});
	}


	function totalcartprice()
	{
		$("#cartprice").load( "<?php echo e(url('totalprice')); ?>" );
	}
	function totalcartqunt()
	{
		$("#cartqunt, .cartqunt").load( "<?php echo e(url('totalcartqunt')); ?>" );
	}
	function totalcartamount()
	{
		$("#cartamount, .cartamount").load( "<?php echo e(url('totalcartamount')); ?>" );
	}

	function totalcartamounts()
	{
		$("#cartamounts").load( "<?php echo e(url('totalcartamounts')); ?>" );
	}




</script>
<?php /**PATH D:\xampp\htdocs\office\standardbdonline_without_reg\resources\views/User/layouts/master.blade.php ENDPATH**/ ?>