Viewing File: /home/webrbaew/kitothecandytea.com/includes/cart_window.php


	<!-- Start offCanvas minicart -->
	<div class="offCanvas__minicart" tabindex="-1">
		<div class="minicart__header ">
			<div class="minicart__header--top d-flex justify-content-between align-items-center">
				<h3 class="minicart__title"> Shopping Cart</h3>
				<button class="minicart__close--btn" onclick="close_minicart()" aria-label="minicart close btn">
					<svg class="minicart__close--icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M368 368L144 144M368 144L144 368"></path></svg>
				</button>
			</div>
		</div>
		<form method="post">
			<?php 
			$date_added = date('Y-m-d');
			$ip_address = $_SESSION['ip_address'];
			$check_existance = mysqli_query($con,"select * from cart where cust_ip = '$ip_address' and date_added = '$date_added'");
			if(mysqli_num_rows($check_existance)>0){
				$get_minicart_items = mysqli_query($con,"select cart.*,p.* from cart inner join product p on cart.prod_id = p.product_id where cust_ip = '$ip_address' and date_added = '$date_added'");
				$mini_total_price = 0;
				while($minicart_items = mysqli_fetch_array($get_minicart_items)){
					$mini_total_price += $minicart_items['product_price']*$minicart_items['quantity'];
			?>
			<div class="minicart__product cart_row_<?php echo $minicart_items['product_id'];?>">
				<div class="minicart__product--items d-flex">
					<div class="minicart__thumbnail">
						<a href="product-details.php?id=<?php echo $minicart_items['product_id'];?>"><img src="images/product_images/<?php echo $minicart_items['product_image'];?>" alt="prduct-img"></a>
					</div>
					<div class="minicart__text">
						<h4 class="minicart__subtitle"><a href="product-details.php?id=<?php echo $minicart_items['product_id'];?>"><?php echo $minicart_items['product_title'];?></a></h4>
						<div class="minicart__price">
							<span class="current__price">$<?php echo number_format($minicart_items['product_price'],2);?></span>
						</div>
						<div class="minicart__text--footer d-flex align-items-center">
							<input type="hidden" class="" id="prod_id_<?php echo $minicart_items['product_id'];?>" value="<?php echo $minicart_items['prod_id'];?>" name="prod_id[]">
							<div class="quantity__box minicart__quantity">
								<button type="button" class="quantity__value decrease" aria-label="quantity value" value="Decrease Value">-</button>
								<label>
									<input type="number" class="quantity__number" id="quantity_<?php echo $minicart_items['product_id'];?>" name="quantity[]" value="<?php echo $minicart_items['quantity'];?>">
								</label>
								<button type="button" class="quantity__value increase" aria-label="quantity value" value="Increase Value">+</button>
							</div>
							<button class="minicart__product--remove remove_cart_item" total_price="<?php echo $minicart_items['product_price']*$minicart_items['quantity'];?>" id="remove_cart_item_<?php echo $minicart_items['product_id'];?>" aria-label="minicart remove btn">Remove</button>
						</div>
					</div>
				</div>
			</div>
				<?php }?>
			<div class="minicart__amount mb-15" style="border-bottom: 1px solid #e4e4e4;">
				<div class="minicart__amount_list d-flex justify-content-between">
					<span>Sub Total:</span>
					<span><b>$<?php echo number_format($mini_total_price,2);?></b></span>
				</div>
				<div class="minicart__amount_list d-flex justify-content-between">
					<span>Total:</span>
					<span><b>$<?php echo number_format($mini_total_price,2);?></b></span>
				</div>
			</div>
			<div class="minicart__button d-flex justify-content-center mb-15">
				<a class="variant__buy--now__btn primary__btn" href="checkout.php"><center>PROCEED TO CHECKOUT</center></a>
			</div>
			<div class="minicart__button d-flex justify-content-center">
				<a class="variant__buy--now__btn primary__btn" href="cart.php" style="background:black !important;"><center>VIEW CART</center></a>
			</div>
		</form>
		<?php }else{?>
		<p style="margin-top: 100px;text-align: center;color: red;">No item in the cart</p>
		<?php }?>
	</div>
	<!-- End offCanvas minicart -->
Back to Directory File Manager