PDA

View Full Version : Multiple Item Add to Cart Interface


KevinK303762
03-19-2009, 02:28 PM
I am trying to implement a multiple item add to cart interface on a quick order entry page, but cannot find the old technote nor any other information or tutorials on how to accomplish this with eCart 4.

I would like the customers to be able to enter up to 20 item numbers and select a quantity to purchase for each from a respective drop-down.

If you would be able to point me in the right direction or be able to provide any resources to utilize it would be greatly appreciated.

Best Regards,
Kevin

carlene
03-25-2009, 03:56 PM
I'm also trying to implement a adding multiple items to cart interface. My problem is the tutorial only gives a checkbox solution. I need them to be able to add quantities as this is a site for a wholesale manufacturer.

Is there a solution for that? Plus I did go through the tutorial once and I an error in the SQL.

I don't know why this isn't a wee bit easier as this is a very common thing...urgh.

Ray Borduin
03-26-2009, 06:54 AM
We don't have a specific user interface to support this functionality. It would require some level of hand coding to accomplish, but it has been done many times so it is possible.

Do your product options come from a database? Are you getting it to display properly and you just need to get the add to cart functionality? If not, concentrate on that first. Once you have the display created getting the add to cart working shouldn't be too difficult with a little hand coding.

The exact steps depend on your database design if any and the final form structure you are trying to support, and that has to be done outside of the cart, so my suggestion would be to get the page looking the way you want, then post the url of the page and a description of the database and I can try to direct you in how to get the add to cart working.

KevinK303762
03-26-2009, 07:22 AM
I am not really displaying any data from the database for this page. Basically I want to have a form with text fields for item numbers with corresponding quantity dropdown boxes. What I would like to happen is that when a user clicks the add to cart button, any text fields populated with item numbers are validated against the database (which is DB2 by the way) and valid items are then added to the shopping cart along with the quantity specified for each one. The following page is purely for testing and development purposes, but helps to show what I am trying to accomplish. http://204.250.9.205/Categories.asp and go to quick order entry on the tabbed panel object. I was hoping to utilize DataAssist in some fashion for this, but unfortunately it does not support DB2 databases. My main issue at this point is being able to filter or create a new recordset of the user entered item numbers from the text fields. I can hard code a recordset with one item number and successfully add that to the cart with the corresponding quantity, but beyond that I am kind of stumped. Thanks!!

Ray Borduin
03-26-2009, 07:34 AM
So the step you are actually getting stuck on is filtering your recordset to return multiple results. Normally you could use DataAssist Search to do this, but that isn't working because you have a DB2 database.

So... hate to say it, but in some cases you need to write a little code.

You need to create a where clause from the submitted fields so you can filter your recordset. Once your recordset is filtered you would probably loop through that recordset and have to loop back through the form to get the corresponding quantity and most likely store the values in an array.

Then you can loop through that array and add items to the cart. This will require some knowledge of SQL and ASP scripting to pull off.

KevinK303762
03-26-2009, 12:50 PM
Thank you Ray for the assistance.

sandy170299
04-21-2009, 12:35 PM
Ray, I'd like to take this one step further. This is my scenario. If I have a list of items, filtered by category, that contain checkboxes, I can then check all of the checkboxes that apply, loop through an array, and write the array contents to a database. Those items are connected to a user by a session variable. This is working fine and I've done this many times before.

My question is, how do I grab those items and add those items that are in the database to a shopping cart? I'm not sure how to start with that one.

Thanks!
Sandy

Ray Borduin
04-21-2009, 12:49 PM
If you can get them into a recordset then you can use the "Add to cart from Recordset" server behavior to add them all to the cart. So it just becomes a matter of how to return all of the results into a recordset, possibly filtering by the user session variable you used when inserting.

sandy170299
04-21-2009, 12:54 PM
Yup - the records have already been inserted into the database. It's really that easy? Cool!!! Thanks, Ray!