function ajax_delete_product() { $productID = 0; if (isset($_POST['productID'])) { $productID = $_POST['productID']; $total = delete_cart($productID); if ($total) { echo number_format($total, 0) . '-' . get_count_product(); } else { echo '0'; } die; } }
if ($_SESSION['member'] == "") { header('location:?url=login'); } else { cek_stok(); } break; case 'update_cart': if (@$_GET['token'] == md5(@$_SESSION['member'])) { update_cart(@mysql_real_escape_string($_POST)); } else { echo "Legal Action"; } break; case 'delete_cart': if (@$_GET['token'] == md5(@$_SESSION['member'])) { delete_cart(@mysql_real_escape_string($_GET['id'])); } else { echo "Legal Action"; } break; case 'finish': if (@$_GET['token'] == md5(@$_SESSION['member'])) { finish_shop(is_array($_POST)); } else { echo "Legal Action"; } break; case 'next': if ($_SESSION['member'] == "") { header('location:index.php'); } else {
while ($row_prod = mysql_fetch_assoc($res_prod)) { $i++; $number = $row_prod[pPrice] * $row_prod[pQuantity]; $price = number_format($number, 2, '.', ''); echo '<tr style="background:#fff;"> <td>' . $i . '</td> <td>' . $row_prod['pName'] . '</td> <td>' . $row_prod['pQuantity'] . '</td> <td>$' . $row_prod['pPrice'] . '</td> <td>$' . $price . '</td></tr>'; } if ($row_ord = mysql_fetch_assoc($res_ord)) { echo '<tr style="font-weight:bold"><td colspan="3">Order Total: $' . $row_ord['totalprice'] . '</td><td colspan="3" style="text-align:right;">Order ID: ' . $lastorderid . '</td></tr>'; } unset($_SESSION['cart']); delete_cart(); write_cart(); } else { echo "<tr><td><br/></td></tr>"; echo "<tr style='background:#FFFFFF'><td>No Previous Orders.</td></tr>"; } ?> <tr><td colspan="5"><input type="button" value="Finish" onclick="window.location='home.php'"> </td></tr> </table> </div> </div>
$taxcost = getTaxCost($totalcost); $reduce = 0; //default if ($obj2->isApplyDiscount($totalcost) == true) { $reduce = $obj2->getReduction() * -1; $taxcost = getTaxCost($totalcost - $obj2->getReduction()); } $finalcost = $totalcost + $shipcost + $taxcost + $reduce; if ($payment_amount < $finalcost * 1.005 + 0.1 and $payment_amount > $finalcost * 0.995 - 0.1 and $payment_currency == 'USD') { //reset gift point if it has been used: if ($obj2->isApplyDiscount($totalcost) == true) { $obj2->resetPoints(); } update_shopipn($id, $txn_id); update_store_status($id); delete_cart($id); $query = "SELECT expired_date FROM membership_ipn WHERE user_id = '{$id}'"; $result = mysql_query($query); if (mysql_num_rows($result) != 0) { $row = mysql_fetch_assoc($result); $expired_date = strtotime($row['expired_date']); $today = strtotime(date("Y/m/d")); if ($expired_date > $today) { $obj2->addPoints($totalcost + $reduce); } } //select all the items from the cart and save the id upc hnd_qty, from the cart store into shop table and //remove all the cart items from the cart. update information for store. //add information into database. credit! //email also //update premium
break; case 'get_cart': include_once __DIR__ . '/orders/get_cart.php'; $responseArray['response'] = get_cart($values); $responseArray['status'] = 'success'; $responseArray['message'] = 'Here is your cart'; break; case 'update_cart_header': include_once __DIR__ . '/orders/update_cart.php'; $responseArray['response'] = update_cart_header($values); $responseArray['status'] = 'success'; $responseArray['message'] = 'Cart successfully updated'; break; case 'delete_cart': include_once __DIR__ . '/orders/delete_cart.php'; $responseArray['response'] = delete_cart($values); $responseArray['status'] = 'success'; $responseArray['message'] = 'Successfully deleted cart'; break; case 'delete_cart_detail': include_once __DIR__ . '/orders/delete_cart.php'; $responseArray['response'] = delete_cart_detail($values); $responseArray['status'] = 'success'; $responseArray['message'] = 'Successfully deleted cart line'; break; case 'submit_order': include_once __DIR__ . '/orders/submit_order.php'; $responseArray['response'] = submit_order($values); $responseArray['status'] = 'success'; $responseArray['message'] = 'Order successfully submited'; break;