Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

mga ka Symb help when updating multiple products quantity

CHROMO01251

Recruit
Basic Member
Messages
12
Reaction score
0
Points
16
Sir/ maam pa help need po ng tulong about sa code

Here's the code ung problema pag nag uupdate ako ng multiple products quantity ung subtotal nagiging zero paano poba ma separate un kc isang products lng po ang na uupdate nya salamat sa sasagot

<div id="products_box" style="margin-top: 15px";>
<!--Getting Products and Categories for displaying-->

<form action="" method="post" enctype="multipart/form-data" style="margin-left:10px;">
<center><table align="center" width="700" >

<tr align="center">
<th>Remove</th>
<th>Product (S)</th>
<th>Quantity</th>
<th>Total Price</th>
</tr>

<?php

$total = 0;

global $con;

$ip = getIp();


$sel_price = "select * from cart where ip_add='$ip'";

$run_price = mysqli_query($con, $sel_price);


while($p_price=mysqli_fetch_array($run_price)){

$pro_id = $p_price['p_id'];

$pro_price = "select * from products where product_id='$pro_id'";

$run_pro_price = mysqli_query($con, $pro_price);


while($pp_price = mysqli_fetch_array($run_pro_price)){

$product_price = array($pp_price['product_price']);
$product_title = $pp_price['product_title'];

$product_image = $pp_price['product_image'];
$single_price = $pp_price['product_price'];

$values = array_sum($product_price);
$total += $values;








?>

<tr>
<td>    <input type="checkbox" name="remove[]" value="<?php echo $pro_id;?>"/></td>
<td style="font-size:12px;"><?php echo $product_title; ?><br>
<img src=" admin_area/product_images/<?php echo $product_image;?>" width="40" height="40" /></td>
<td><input type="text" size="4" name="qty" value="<?php echo $_SESSION['qty'];?>"/></td>
<?php
if(isset($_POST['update_cart'])){

$qty = $_POST['qty'];

$update_qty = "update cart set qty='$qty'";

$run_qty = mysqli_query($con, $update_qty);

$_SESSION['qty']=$qty;

$total = $total*$qty;
}


?>



<td>    <?php echo "₱" ." ". $single_price ;?></td>
</tr>






<?php } } ?>

<tr align="right">

<td colspan="5"><b>Sub Total:</b></td>
<td><?php echo "₱" .$total;?></td>

</tr>
 
Back
Top Bottom