fix cart
This commit is contained in:
parent
4a4a660433
commit
723dd58e71
1 changed files with 15 additions and 17 deletions
|
|
@ -183,7 +183,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['remove_coupon'])) {
|
|||
// Re-validate coupon from session if present
|
||||
if (empty($applied_coupon) && isset($_SESSION['cart_coupon_code'])) {
|
||||
$coupon_code = $_SESSION['cart_coupon_code'];
|
||||
if ($db) {
|
||||
$safe_code = mysqli_real_escape_string($db, $coupon_code);
|
||||
$coupon_query = "SELECT * FROM {$table_prefix}billing_coupons
|
||||
WHERE code = '$safe_code' AND is_active = 1";
|
||||
|
|
@ -199,7 +198,6 @@ if (empty($applied_coupon) && isset($_SESSION['cart_coupon_code'])) {
|
|||
unset($_SESSION['cart_coupon_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate discount
|
||||
if ($applied_coupon && $coupon_discount_percent > 0) {
|
||||
|
|
@ -233,8 +231,8 @@ $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https:
|
|||
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
|
||||
$siteBase = $protocol . $host;
|
||||
|
||||
// Close database connection if opened
|
||||
if ($db) mysqli_close($db);
|
||||
// Close database connection
|
||||
mysqli_close($db);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue