close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Add to Cart Problems...

Thread began 7/06/2009 8:20 am by vito374252 | Last modified 7/06/2009 11:50 am by vito374252 | 5578 views | 20 replies |

vito374252

Multiple Add to Cart Problems...

Hi

I'm trying to add multiple items to my cart, but nothing happens when I hit the add to cart button on the site. Here is the URL: counsellors_Results.php

Here is the filter:
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: counsellorsAddSelected;
//Searchpage: ;
//Form: ;
$WADbSearch2_DefaultWhere = "AND counsellorID = 0";
if (!session_id()) session_start();
if (isset($_POST["AddToCartBtn_x"])) {
$WADbSearch2 = new FilterDef;
$WADbSearch2->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch2->addComparisonFromList("counsellorID","ATCCheck","AND","=",1);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch2_counsellors_Results"]=$WADbSearch2->whereClause;
}
}
else {
$WADbSearch2 = new FilterDef;
$WADbSearch2->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch2_counsellors_Results"]) && $_SESSION["WADbSearch2_counsellors_Results"] != "") {
$WADbSearch2->whereClause = $_SESSION["WADbSearch2_counsellors_Results"];
}
else {
$WADbSearch2->whereClause = $WADbSearch2_DefaultWhere;
}
}
else {
$WADbSearch2->whereClause = $WADbSearch2_DefaultWhere;
}
}
$WADbSearch2->whereClause = str_replace("\\''", "''", $WADbSearch2->whereClause);
$WADbSearch2whereClause = '';
?>

Here is the form:
<form method="post" name="add_to_cart" id="add_to_cart">
<table width="800">
<tr>
<td width="638">Click the <strong>Book Personal Assessment Now</strong> button to add all selected counsellors to the shopping cart.</td>
<td width="150"><input type="image" name="AddToCartBtn" id="AddToCartBtn" src="images/counselling/book-pa-now.gif" /></td>
</tr>
</table>
<table class="WADAResultsTable" border="0" cellpadding="0" cellspacing="0">
<tr>
<th class="WADAResultsTableHeader">Counsellor Name:</th>
<th class="WADAResultsTableHeader">Town:</th>
<th class="WADAResultsTableHeader">County/Country:</th>
<th class="WADAResultsTableHeader">Counsellor Bio:</th>
<th class="WADAResultsTableHeader">Professional Body:</th>
<th class="WADAResultsTableHeader">Ongoing Fees/Session:</th>
<th class="WADAResultsTableHeader">Type of Therapy:</th>
</tr>
<?php do { ?>
<tr class="<?php echo $WARRT_AltClass1->getClass(true); ?>">
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['first_name']); ?>

<input name="ATCCheck[]" id="ATCCheck[]" type="checkbox" value="<?php echo $row_counsellorsAddSelected['counsellorID']; ?>" />
<span class="WADAResultsTableCellname"> Include this counsellor in your booking.</span></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['town']); ?></td>
<td class="WADAResultsTableCell"><?php echo $row_WADAcounsellors['county_country']; ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['bio']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['professional_body']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['fees_session']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAcounsellors['type_of_therapy']); ?></td>
</tr>
<?php } while ($row_WADAcounsellors = mysql_fetch_assoc($WADAcounsellors)); ?>
</table>
</form>

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

That either means your recordset is not filtered correctly, or it means your add to cart is not set up correctly.

Does the value of <?php echo($WADbSearch2->whereClause); ?> look correct?

Sign in to reply to this post
Did this help? Tips are appreciated...

vito374252

The value is AND ((counsellorID = 0))

Sign in to reply to this post

Ray BorduinWebAssist

That seems wrong, so the problem is in creating the correct search query based on the checkboxes. If you view the source code on the completed page, do the checkboxes have the correct values? Which did you check when you got that where clause returned?

Sign in to reply to this post
Did this help? Tips are appreciated...

vito374252

Same thing, source code says AND ((counsellorID = 0)), and that doesn't matter which checkbox I check

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a url where I can view the page?

Sign in to reply to this post
Did this help? Tips are appreciated...

vito374252

yeah, ...rs_Results.php. Do you need more code from my side?

Also, do you think that the fact that theis page is the result of a search from another page is causing a problem?

Sign in to reply to this post

Ray BorduinWebAssist

Possibly...if you are overwriting it or something. That url doesn't seem to work it looks like some of the characters were replaced so I can't browse it.

Sign in to reply to this post
Did this help? Tips are appreciated...

Ray BorduinWebAssist

Ok I was able to veiw the page.

The problem is with your checkboxes... they look like:

<input name="ATCCheck[]" id="ATCCheck[]" type="checkbox" value="" />


notice the value is blank. That is why it isn't working... maybe a bad recordset column reference.

Sign in to reply to this post
Did this help? Tips are appreciated...

vito374252

I've attached a .zip file with the search page and the results page

Attached Files
Search.zip
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...