|
DIR: /home/magicrsz/public_html /home/magicrsz/public_html/ |
| Current File : /home/magicrsz/public_html/checkout.php |
<?php
include("header.php");
$total=0;
$query="SELECT * from temp_cart where user_id='$user_id'";
$rec=db::getRecords($query);
$sub_total="0";
?>
<!--Page Header Start-->
<section class="page-header">
<div class="page-header-bg" style="background-image: url(assets/images/backgrounds/checkout.jpg)">
</div>
<div class="container">
<div class="page-header__inner">
<ul class="thm-breadcrumb list-unstyled">
<li><a href="index.php">Home</a></li>
<li><span>/</span></li>
<li>Shop</li>
</ul>
<h2>Checkout</h2>
</div>
</div>
</section>
<!--Page Header End-->
<!--Start Checkout Page-->
<section class="checkout-page">
<div class="container">
<div class="section-title text-center">
<!-- <span class="section-title__tagline">What We’re Doing</span>-->
<h2>Please add expected delivery time and all required information to make delivery a pleasant experience for all. Place orders 6 hours in advance to ensure prompt delivery.</h2>
<div class="section-title__icon">
<img src="assets/images/icon/section-title-icon-1.png" alt="">
</div>
<form class="checkout row box-shadow1" action="" id="form" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-xl-6 col-lg-6">
<div class="billing_details ship_different_address">
<div class="billing_title ship_different_address_title">
<h2>Checkout Details <span class="fa fa-check"></span></h2>
</div>
<div class="billing_details_form ship_different_address_form">
<div class="row bs-gutter-x-20">
<div class="col-xl-6">
<div class="billing_input_box">
<input type="text" name="fname" value="" placeholder="First Name" required="">
</div>
</div>
<div class="col-xl-6">
<div class="billing_input_box">
<input type="text" name="lname" value="" placeholder="Last Name" required="">
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="billing_input_box">
<input type="text" name="address" value="" placeholder="Address" required>
</div>
</div>
</div>
<div class="row bs-gutter-x-20">
<div class="col-xl-6">
<div class="billing_input_box">
<input type="text" name="city" value="" placeholder="Town / City" required="">
</div>
</div>
<div class="col-xl-6">
<div class="billing_input_box">
<input name="postcode" type="text" placeholder="Post Code" required>
</div>
</div>
</div>
<div class="row bs-gutter-x-20">
<div class="col-xl-6">
<div class="billing_input_box">
<input name="email" type="email" placeholder="Email Address" required>
</div>
</div>
<div class="col-xl-6">
<div class="billing_input_box">
<input type="tel" name="phone" required="" placeholder="Phone Number">
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="ship_different_input">
<textarea placeholder="Notes About Order" name="note"></textarea>
</div>
</div>
</div>
<div class="checkout__payment" style="margin-top:20px;">
<h3>Note</h3>
<p class="mb-3">The delivery of single orders is not profitable for us, Get £50 of free Magik Nectar Twists by connecting us with your favorite local shop. That way you will have an always ready, always fresh supply of Magik Nectar at your local shop. Your £50 supply will be spread over a one month period. Thank you for helping to spread the word about Magik Nectar.</h6>
<a class="mb-2" href="tel:+447737336298">+447737336298</a>
<div style="margin-top:10px">
<input type="radio" id="stripe" name="payment_method" value="2" checked required>
<label for="stripe">Stripe Payment</label>
<br>
<input type="radio" id="paypal" name="payment_method" value="1">
<label for="paypal">Paypal Payment <img src="assets/images/shop/paypal-1.jpg" alt=""></label>
</div>
</div><!-- /.checkout__payment -->
</div>
</div>
</div>
<div class="col-xl-6 col-lg-6">
<h2 style="margin-top:100px;">Your Order</h2>
<div class="order_table_box">
<table class="order_table_detail">
<thead class="order_table_head">
<tr>
<th>Product</th>
<th class="right">Price</th>
</tr>
</thead>
<tbody>
<?php
if($rec!=NULL)
{
$count=0;
foreach($rec as $rec2)
{
$count++;
$product_id=$rec2['product_id'];
$query="SELECT * from product where id='$product_id'";
$product=db::getRecord($query);
$sub_total=$sub_total + $rec2['total'];
?>
<tr>
<td class="pro__title"><?php echo $product['name']; ?> <?php echo $rec2['size']; ?> x <?php echo $rec2['quantity'];?></td>
<td class="pro__price">£<?php echo $rec2['total'];?> GBP</td>
</tr>
<?php
}
}else{
?>
<tr><td class="text-center">Your Cart Empty!</td></tr>
<?php
}
?>
<tr>
<td class="pro__title">Total</td>
<td class="pro__price">£<?php echo $sub_total; ?> GBP</td>
</tr>
</tbody>
</table>
</div>
<input type="text" name="total_amount" value="<?php echo $sub_total; ?>" hidden>
<!-- ////////////////////////////////////////////////////// -->
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="lc" value="GBP" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" />
<input type="hidden" name="first_name" value="Customer's First Name" />
<input type="hidden" name="last_name" value="Customer's Last Name" />
<input type="hidden" name="payer_email" value="customer@example.com" />
<input type="hidden" name="item_number" value="123456" />
<!-- ////////////////////////////////////////////////////// -->
<div class="text-left mt-5 d-flex justify-content-center">
<?php
if($sub_total > 0){
?>
<button class="thm-btn w-100 text-center" onclick="payment_type()" type="submit" name="final_checkout">Place Order <i class="icon-right-arrow"></i></button>
<?php
}
else
{
?>
<a href="shop.php" class="thm-btn w-100 text-center">Continue Shoping <i class="icon-right-arrow"></i>
</a>
<?php
}
?>
</div><!-- /.text-right -->
</div>
</div>
</form>
<div class="your_order">
<div class="row">
<div class="col-xl-6 col-lg-6">
</div>
<div class="col-lg-6">
</div><!-- /.col-lg-6 -->
</div>
</div>
</div>
</section>
<!--End Checkout Page-->
<?php
include("footer.php");
?>
<script>
function payment_type() {
var test = $('input[name="payment_method"]:checked').val();
if (test == 2) {
$("#form").submit(function(e) {
this.action = "Stripe/index.php";
});
}
if (test == 1) {
$("#form").submit(function(e) {
this.action = "Paypal/payments.php";
});
}
}
</script> |