Trouble adding item from Recordset...
I have got the dynamic portion of the script working so it adds the product. But when I set up the scipt to redirect on add it doesn't go anywhere, so you have to click on the "view cart" button to actually view the cart...
any suggestions?
see code below...
<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?>
<?php
$eCart1->GetContent();
?>
<?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 = "shopping-cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_LabTest) && $totalRows_LabTest > 0) {
$row_LabTest = WAEC_findRecordMySQL($LabTest, "LID", $ATC_itemID);
if ($row_LabTest) {
$ATC_itemName = "".$row_LabTest['LabTitle'] ."";// column binding
$ATC_itemDescription = "";// column binding
$ATC_itemWeight = floatval("".$row_LabTest['LabWeight'] ."");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_LabTest['LabPrice'] ."");// column binding
mysql_data_seek($LabTest, 0);
$row_LabTest = mysql_fetch_assoc($LabTest);
}
}
$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_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'];
}
}
}
?>