-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdatecartqty.php
81 lines (63 loc) · 3.17 KB
/
updatecartqty.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
$cid = $_GET['caid'];
$pid = $_GET['pid'];
if(isset($_POST['UpcartDone']))
{
$upcartqty = mysqli_real_escape_string($NepdevJDLight->Protects(),$_POST['upcartqty']);
$cartkoid = mysqli_real_escape_string($NepdevJDLight->Protects(),$_POST['cartkoid']);
//$Totalprice =
$productpricecart = mysqli_real_escape_string($NepdevJDLight->Protects(),$_POST['productpricecart']);
$Totalprice = $upcartqty*$productpricecart;
$SuccessUpCartQty = $NepdevJDLight->NepdevUpdateProCartQty($cartkoid,$Totalprice,$upcartqty);
if($SuccessUpCartQty==true)
{
echo "<script>alert('Success Update Cart'); window.location='index.php?Products=cart';</script>";
}
else
{
echo "<script>alert('Cant Update Cart');</script>";
}
}
?>
<div class="container">
<div class="check-sec">
<div class="col-md-12 cart-items">
<h1>My Shopping Bag</h1>
<?php
$sid = session_id();
///display cart info from cart
$SuccessCartDis = $NepdevJDLight->NepdevDisCartsPage($cid,$sid);
$SuccessCartFetch = $SuccessCartDis->fetch_assoc();
/////display cart info from products ////
$SuccessCartDetail = $NepdevJDLight->NepdevDisCartsById($pid);
$SuccessCartDetailFetch =$SuccessCartDetail->fetch_assoc();
?>
<form method="post">
<input type="hidden" name="cartkoid" value="<?php echo $SuccessCartFetch['id']; ?>">
<input type="hidden" name="productpricecart" value="<?php echo $SuccessCartFetch['Price']; ?>">
<div class="cart-header">
<div class="close">
<input type="submit" name="UpcartDone" value="Update">
</div>
<div class="cart-sec simpleCart_shelfItem">
<div class="cart-item cyc">
<img src="meadmin/pro_img/<?php echo $SuccessCartDetailFetch['ProImage']; ?>" class="img-responsive" alt=""/>
</div>
<div class="cart-item-info">
<h3><a href="single.html"><?php echo strtoupper($SuccessCartDetailFetch['ProName']); ?></a><span>For: <?php echo strtoupper($SuccessCartDetailFetch['ProCat']); ?></span></h3>
<ul class="qty">
<li><p>Qty : <input type="number" name="upcartqty" value="<?php echo $SuccessCartFetch['p_qty']; ?>" min="1"> </p></li>
<li><p>Per Piece:<?php echo $SuccessCartDetailFetch['ProNewPrice']; ?> </p></li>
<li><p>SubTotal for <?php echo strtoupper($SuccessCartDetailFetch['ProName']) ?> Rs: <?php $CartQty = $SuccessCartFetch['p_qty']*$SuccessCartDetailFetch['ProNewPrice']; echo $CartQty; ?></p></li>
</ul>
</div>
<div class="clearfix"></div>
</div>
</div>
<?php ?>
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>