ok if I add that to the code, the page doesn't load. Just dies with filter:
I have not changed the name of the button and the main product is added to the cart. Now just the accessory items are not added with it.
Is there any kind of training recipe for add multiple items to cart. I am so close on this, but am getting frustrated that I am getting no where.
Here is my filter at the beginning of the page.
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: AddToCartItems;
//Searchpage: ;
//Form: ;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if (isset($_POST["WA_Store_Cart_1_ATC_x"])) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
//comparison list additions
$WADbSearch1->addComparisonFromList("pn","addtocartmodel","AND","=",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_ProductsDetail"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_ProductsDetail"]) && $_SESSION["WADbSearch1_ProductsDetail"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_ProductsDetail"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
Here is recordset:
$MMColParam_AddToCartItems = "-1";
if (isset($_POST['addtocartmodel[]'])) {
$MMColParam_AddToCartItems = (get_magic_quotes_gpc()) ? $_POST['addtocartmodel[]'] : addslashes($_POST['addtocartmodel[]']);
}
mysql_select_db($database_localhost, $localhost);
$query_AddToCartItems = sprintf("SELECT CartItems.pn, CartItems.brand_name, CartItems.color_code, CartItems.medium_description, CartItems.thumbnail, CartItems.Price FROM CartItems WHERE %s = CartItems.pn", GetSQLValueString($MMColParam_AddToCartItems, "text"));
setQueryBuilderSource($query_AddToCartItems,$WADbSearch1,false);
$AddToCartItems = mysql_query($query_AddToCartItems, $localhost) or die(mysql_error());
$row_AddToCartItems = mysql_fetch_assoc($AddToCartItems);
$totalRows_AddToCartItems = mysql_num_rows($AddToCartItems);