hey guys trying work on. when user updates quantity on product supposed multiply quantity unit price of product. apparently, can work single product, if more that, turns 0 when try update quantity. here code please help.
<tr align="left"> <th width="62"><input type="checkbox" name="remove[]" value="<?php echo $pro_id; ?>"/></th> <th width="155"> <img src="admin_area/product_images/<?php echo $product_image; ?>" width="60" height="60" /><br> <?php echo $product_title; ?> <br><br> </th> <th width="61"><?php echo $product_size; ?></th> <th width="62"><?php echo $product_paper; ?></th> <th width="67"><?php echo $product_grammage; ?></th> <th width="60"><?php echo $product_finish; ?></th> <th width="96"><?php echo $product_sides; ?></th> <th width="76"><?php echo $product_print; ?></th> <th width="105"><input type="text" size="6" name="qty" value="<?php $_session['qty']; ?>" /></th> <?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; } ?> <th width="112"><?php echo "ugx" . $single_price; ?></th> </tr> <?php } } ?> </table> <table width="217" border="0" align="right" class="layoutcarttotal"> <tr> <td colspan="2"><h2><b>sub total:</b></h2></td> <td ><h2><?php echo "ugx" . $total; ?></h2></td> </tr> <tr> <td><input type="submit" name="update_cart" class="mybutton" value="update order" /></td> <td><input type="submit" name="continue" class="mybutton" value="continue shopping" /></td> <td><input type="submit" name="checkout" class="mybutton" value="place order" /></td> </tr>
Comments
Post a Comment