Skip to content

Commit

Permalink
Updating The load404Page() & creating loadProductNotFoundPage()
Browse files Browse the repository at this point in the history
  • Loading branch information
p-nforshifu-234 committed May 26, 2023
1 parent e02701f commit 823fb1f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 9 additions & 1 deletion assets/php/functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,19 @@ function loadPage(string $pathToFile)
function load404Page()
{

$dir = "../NFSFU-ECOMM\page-not-found.php";
$dir = "page-not-found.php";
loadPage($dir);

}

function loadProductNotFoundPage()
{
$dir = 'product-not-found.php';
loadPage($dir);
exit;
}


function getContentsFromAFile( string $filePath )
{

Expand Down
6 changes: 2 additions & 4 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

if ( $checkIfRecordExist != 1 )
{
$dir = '../NFSFU-ECOMM/product-not-found.php';
loadPage($dir);
loadProductNotFoundPage();
exit;
}

Expand All @@ -37,8 +36,7 @@
if ( $count === 0 )
{

$dir = '../NFSFU-ECOMM/product-not-found.php';
loadPage($dir);
loadProductNotFoundPage();
exit;
}

Expand Down
6 changes: 2 additions & 4 deletions product-details-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
if ( $checkIfRecordExist != 1 )
{

$dir = '../NFSFU-ECOMM/product-not-found.php';
loadPage($dir);
loadProductNotFoundPage();
exit;

}
Expand All @@ -74,8 +73,7 @@
)
{

$dir = '../NFSFU-ECOMM/product-not-found.php';
loadPage($dir);
loadProductNotFoundPage();
exit;

}
Expand Down

0 comments on commit 823fb1f

Please sign in to comment.