close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Quantity field and Weight dynamic select list don't pass data to cart.

Thread began 5/10/2016 9:20 am by tmcbinc99963 | Last modified 5/13/2016 10:24 am by Ray Borduin | 3195 views | 9 replies |

tmcbinc99963

Quantity field and Weight dynamic select list don't pass data to cart.

I've added a quantity field and dynamic select list to an existing DataAssist product results page, but can't get any data to pass to the eCart page.

Also, I need for only the product(s) that have entered values to show up on the eCart page.

Shows 'cart is empty'.

Files attached.

Sign in to reply to this post

Ray BorduinWebAssist

Since you have your form fields in a repeated region, you will need to make sure they are named uniquely. Do that by appending the productID column from the database to each like:

name="“eCart1_1_Quantity<?php echo($row_WADAProd['ID']); ?>"

Then, since you are adding more than one item at a time you would have to remove the "Add to Cart Button" server behavior and instead use "Get Cart Contents from Recordset" which can be used to add more than one row at a time.

When you bind the values in that interface you will refer to the form elements with the appended productID so that you can get the appropriate setting for each. It will automatically ignore any rows whose quantity is not set or is set to zero.

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

tmcbinc99963

Added the following to each form input:

name="“eCart1_1_Quantity<?php echo($row_WADAProd['ID']); ?>"
name="“eCart1_1_Weight<?php echo($row_WADAProd['ID']); ?>"

Deleted the Add to Cart server behavior

Opened the Get from Recordset server behavior and changed bindings to:

<?php echo($row_WADAProd['ID']); ?>"
<?php echo($row_WADAProd['ID']); ?>"

Same result as before: cart is empty

Files attached.

Sign in to reply to this post

Ray BorduinWebAssist

Your form field names have extra quotes in them...
name="“eCart1_1_Quantity<?php echo($row_WADAProd['ID']); ?>"
should be:
name="eCart1_1_Quantity<?php echo($row_WADAProd['ID']); ?>"

Then the corresponding binding should look like:
<?php echo($_POST['eCart1_1_Quantity'.$row_WADAProd['ID']]); ?>

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

tmcbinc99963

Removed the extra "

Opened the 'eCart Get From Recordset' server behavior and replaced the binding for both quantity and weight.

Still says 'cart is empty'

Files attached

Sign in to reply to this post

Ray BorduinWebAssist

You have your form action set to post directly to the RequestforQuote.php page. You need to submit to the current page and redirect to the RequestforQuote.php page after it adds to the cart.

Change your form action to: action=""

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

tmcbinc99963

You mentioned changing the action in an earlier post, but it returned the following error message, both then and now:

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/websitename.com/Connections/ProductsDb.php:9) in /Applications/MAMP/htdocs/websitename.com/Prod_results.php on line 190

When you say 'redirect to RequestforQuote.php page' do you mean add a link to the submit button? This change has been made to the attached files.

Sign in to reply to this post

Ray BorduinWebAssist

This implies there is an error message generated on line 9 of /ProductsDb.php, or there is a blank line of code there that needs to be removed.

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

tmcbinc99963

It looks like there's a conflict with the eCart redirect 'header' line and the ProductDb.php file. Both lines of code are cited in the error message.

<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
if (function_exists("rel2abs")) $eCart1->redirStr = rel2abs($eCart1->redirStr,dirname(__FILE__));
header("Location: ".$eCart1->redirStr);
die();
}
?>

ProductsDb.php file attached, with others.

Sign in to reply to this post

Ray BorduinWebAssist

You can't redirect a page after an error has been written. My guess is that your database connection is failing on line 9 which is causing an error message and then the redirect error is just a symptom. Are you sure your database information is correct and your database server is up and running?

Sign in to reply to this post
Did this help? Tips are appreciated...
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...