close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

variation on Multiple item add to cart interface

Thread began 11/23/2010 6:34 am by CraigR | Last modified 11/23/2010 4:23 pm by Jason Byrnes | 1652 views | 9 replies |

CraigRBeta Tester

variation on Multiple item add to cart interface

I managed to find an ecart 3 archived file on adding multiple items to the cart with a single 'add to cart' button

i have attempted to adapt the tutorial to suit my needs, as i am attempting to simultaneously add a number of colour options to my cart for a single itemID.

using the 'ecart get from recordset' server behavior, i have managed to get this working, in so far as I can add several options of a single item to the cart in one click.

in the tutorial, the quantity field is set to '1'.

how do i go about using a quantity field for each of my options in my cart form, so that customer entered quantities are added to the cart array ?

i have added the fields to the form , but i cannot add the values from the fields to the array.

Sign in to reply to this post

Jason ByrnesWebAssist

set the quantity filed name to contain the ID from the recordset:

<input name="quantity_<?php echo $row_RsName['ID']; ?>" id="quantity_<?php echo $row_RsName['ID']; ?>" type="text" value="1" />



then modify the quantity for the get contents from recordset to use the ID column to:
$cartNameCart_itemQuantity = floatval("".((isset($_POST["quantity_".$row_RsName['ID']."]))?$_POST["quantity".$row_RsName['ID']."]:"") ."");

Sign in to reply to this post

CraigRBeta Tester

nearly there...

thanks Jason, getting closer.

i pasted your code, got a typo error and changed it (hopefully correctly) so it worked..

$cartNameCart_itemQuantity = floatval("".((isset($_POST["quantity_".$row_RsName['ID'].""]))?$_POST["quantity".$row_RsName['ID'].""]:"") ."");

i checked the page in firebug, and the id is correctly appended to the quantity field in each case, but the cart only updates the entered value from the first quantity field

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of the page please .

Sign in to reply to this post

CraigRBeta Tester

ok, here you go

thanks Jason

Attached Files
newaddtocart_JB.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change:
$rainbowcart_itemQuantity = floatval("".((isset($_POST["quantity_".$row_rsitemcolors['FirstNumberID'].""]))?$_POST["quantity_".$row_rsitemcolors['FirstNumberID'].""]:"") ."");


to:
$rainbowcart_itemQuantity = floatval("".((isset($_POST["quantity_".$row_rsaddselected['ItemID'].""]))?$_POST["quantity_".$row_rsaddselected['ItemID'].""]:"") ."");

Sign in to reply to this post

CraigRBeta Tester

that doesn't work.

if i try this, nothing is added to the cart, so quantity must be zero

the itemid is constant throughout, the firstnumberID is the ID given to the checkbox and the quantity field

Sign in to reply to this post

Jason ByrnesWebAssist

ok, then you will need to edit the rsaddselected recordset ti include the FirstNumberID column and change the code to:


$rainbowcart_itemQuantity = floatval("".((isset($_POST["quantity_".$row_rsaddselected['FirstNumberID'].""]))?$_POST["quantity_".$row_rsaddselected['FirstNumberID'].""]:"") ."");

Sign in to reply to this post

CraigRBeta Tester

thats it !
sorted.

have a great holiday !

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear it's working.

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...