I want to add a condition that only allows a user to see the check_out.php page if they are logged in and have products in their cart.
if (!$obj_user->login) {
//redirect to the sign up page e.g
header(“Location:” . BASE_URL . “signup.php”);
}
if ($obj_cart->items) {
$aaa = $this->quantity;
$result = $itemID > $aaa;
header(“Location:” . BASE_URL . “check_out.php”);
} else {
header(“Location:” . BASE_URL . “product.php”);
}
How code can be done ?
thanks