close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Add to Cart not going to cart.php

Thread began 9/19/2012 6:52 am by Joe Lowery | Last modified 9/20/2012 9:49 am by Joe Lowery | 10334 views | 5 replies

Jason ByrnesWebAssist

It doesn't look like the recordsets on your page are working correctly.

If i view source of the page and look at the code for the first gift box:

php:
<form id="threePForm" name="muirhead_1_ATC_" method="POST"  action="/dev/gift-boxes.php">

      <input type="hidden" name="muirhead_1_ID_Add" value="" >
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <th>&nbsp;</th>
      <th>&nbsp;</th>
      <th>&nbsp;</th>
      <th>Quantity</th>
      </tr>
    <tr id="buttons">
      <td><input type="submit" id="atc" name="muirhead_1_ATC" value="Add to Cart" class="button" /></td>
      <td><input type="submit" id="checkout" name="muirhead_Checkout_1" value="Checkout" class="button" /></td>
      <td><input type="submit" id="continueShopping" name="continueShopping" value="Continue Shopping" class="button lastOne" /></td>
      <td><input class="quantityField" name="muirhead_1_Quantity_Add" type="text" value="1" /></td>
      </tr>
    </table>
  </form>



the iD element does not have a value:
<input type="hidden" name="muirhead_1_ID_Add" value="" >

in the original PHP code, the ID is coming from the recordset. Double check that your record sets are defined properly.


For the checkbox selection, you would need to define a new column in your cart object. in the add to cart button behavior, set the new option column to be updatable from a checkbox. You can then add the additional checkboxs to the page using the same name as the fisrt one created by the eCart Add to cart behaivor, make sure the name ends with [] so that all selected items will be passed as an array.

you can then add the following code at line 1 to convert the array to a comma seperated list:

php:
<?php

if($_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $key => $val) {
        if(
is_array($_POST[$key])) $_POST[$key] = implode(", "$_POST[$key]);
    }
}
?>

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