The error is a page failure/not found due to not being able to parse the queryString value.
The ProdId starts by existing on the Product Detail page.
Then the Checkout page link/checkout behavior fires on any $_POST (which I will change as I want to remain on the Product page after adding a product - as shown in attached image).
Once the value exists on the Display (Order summary page) it is retained and passed to the checkout page where the error causes a failure.
Checkout code:
<?php
//WA eCart Trigger Redirect Check Out
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (true) {
$eCart1->UpdateCart();
$eCart1->cartAction = "CheckOutUpdate";
}
$Redirect_redirStr="display.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") === false) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}
$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Checkout";
}
?>
Add to cart code:
<?php
// WA eCart AddToCart
if (isset($_POST["eCart1_1_ATC"]) || isset($_POST["eCart1_1_ATC_x"])) {
$ATC_itemID = $_POST["eCart1_1_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "";
$ATC_RedirectIfIn = "";
if (isset($totalRows_rsProduct) && $totalRows_rsProduct > 0) {
$row_rsProduct = WAEC_findRecordMySQL($rsProduct, "ProductID", $ATC_itemID);
if ($row_rsProduct) {
$ATC_itemName = "".$row_rsProduct['ProductName'] ."";// column binding
$ATC_itemDescription = "".$row_rsProduct['ProductShortDesc'] ."";// column binding
$ATC_itemThumbnail = "".$row_rsProduct['ProductImage'] ."";// column binding
$ATC_itemWeight = floatval("".$row_rsProduct['ProductWeight'] ."");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_rsProduct['ProductPrice'] ."");// column binding
mysql_data_seek($rsProduct, 0);
$row_rsProduct = mysql_fetch_assoc($rsProduct);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCart1->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCart1->redirStr == "") {
$eCart1->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>