Hi Dani
Thanks for replying.
1. Following my posting to the forum, I made several more attempts, before realising that I could still proceed to the bindings panel, even though it wasn't being populated by the look-up (the original problem).
2. So I clicked on the lightning bolts to add the bindings from the database (DB).
Clicking OK produced an Add to Cart button for the Resources (henceforth 'catalogue') page.
However, first of all, it was treating all the rows the same (i.e. they all had the same value passed to the shopping cart (shopping-cart.php), then I realised that I must have had the option for "Add static item to cart" (even though I'd added the dynamic bindings).
So I reopened the Server Behaviour and made sure that "Look up item ID from recordset" was selected, and double-checked the bindings.
3. Now the catalogue page passed the correct the values to the shopping cart. However, as the 'catalogue' page wasn't redirecting to the shopping cart page after adding an item to the cart, I manually entered the URL to this row:
$ATC_RedirectAfter = "../shop/shopping-cart.php";
4. Now the catalogue page reloads, but seems to lose the recordset values (i.e. ProductName, ProductShortDesc & ProductPrice). It seems that only by clicking on the Add to Cart button for a second time are values are added to the cart, and then they're only from the second DB row!
There's something wrong somewhere!
I've attached screenshots of the General tab (after the OP error message comes up) and of the Bindings tab.
In the code, the bindings now show (if I've got this right!):
<?php
// WA eCart AddToCart
if (isset($_POST["eCart3_1_ATC"]) || isset($_POST["eCart3_1_ATC_x"])) {
$ATC_itemID = $_POST["eCart3_1_ID_Add"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "../shop/shopping-cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_romeroRecordset1) && $totalRows_romeroRecordset1 > 0) {
$row_romeroRecordset1 = WAEC_findRecordMySQL($romeroRecordset1, "", $ATC_itemID);
if ($row_romeroRecordset1) {
$ATC_itemName = "".$row_romeroRecordset1['ProductName'] ."";// column binding
$ATC_itemDescription = "".$row_romeroRecordset1['ProductShortDesc'] ."";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["eCart3_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_romeroRecordset1['ProductPrice'] ."");// column binding
mysql_data_seek($romeroRecordset1, 0);
$row_romeroRecordset1 = mysql_fetch_assoc($romeroRecordset1);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCart3->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCart3->redirStr == "") {
$eCart3->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 ($eCart3->redirStr != "") {
header("Location: ".$eCart3->redirStr);
}
?>
and the Form part:
<form name="eCart3_1_ATC_<?php echo $row_romeroRecordset1['ProductID']; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="eCart3_1_ID_Add" value="<?php echo $row_romeroRecordset1['ProductID']; ?>" >
<input type="text" name="eCart3_1_Quantity_Add" value="1" size="4" >
<input type="image" src="../../WA_eCart/Images/Desert Spice/Btn1_EN_addtocart.gif" border="0" value="Add to Cart" name="eCart3_1_ATC" alt="Add to shopping basket">
</form>
Thanks again!
Alistair