Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
K1rsN7 committed Nov 17, 2024
1 parent 8007978 commit 84cccfb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ function getUserOrders($link){
$product_data = $link->query($sql_text . " WHERE p.id_product = " . $id);
$_SESSION['product_id'] = $product_data->fetch_assoc();
$_SESSION['is_header'] = true;
if ($product_data->num_rows === 0) {
// Если товар не найден, загружаем файл 404.php
load_page('./404.php');
exit(); // Завершаем выполнение скрипта
}
load_page('./single-product.php');
} elseif ($page=='cart'){
$_SESSION['all_products'] = $link->query("SELECT * from product");
Expand Down

0 comments on commit 84cccfb

Please sign in to comment.