Community Forums 

Main Content

Shopping cart multiple items in cart

    Oct 23 2017 12:05:56

    #1

    Bacchus

    Join date : 2014-12-04      Posts : 57

    I'm using the following in one Form <FORM METHOD="POST" ACTION="http://ww8.aitsafe.com/cf/add.cfm">; and <INPUT TYPE="HIDDEN" NAME="product[]" VALUE=name of the product>

    then adding these selections:
    <select name="product[]">
    <OPTION VALUE= SELECTED>Make a Selection of the Glass
    and
    <SELECT name="productpr">
    <OPTION VALUE= SELECTED>Select Imprint, Engrave, Price
    It all works adding to cart up to this point.
    The problem enters trying to use the below, a checkbox, adds a fixed cost into the shopping cart. This works on other pages but does not work in the Form I'm creating:
    <input type="hidden" name="product3" value="One Time Artwork Die Set Up Charge "> <input type="hidden" name="price3" value="40.00">
    <input type="checkbox" name="qty3" value="1" >

    This will not load to the shopping cart with the other objects and if adding it to cart alone i'm getting an error message: Price Not Set.
    When it does work correctly it adds as a second item in the shopping cart.

    Can someone see what's missing or incorrect?
    URL is: http://www.aoweb.com/glassengrave.html

    Bacchus




    Oct 23 2017 20:26:02

    #2

    Alan

    Join date : 2008-09-18      Posts : 2944

    You need addmulti.cfm if you have multiple products. All need a numeric suffix.

    Alan
    Some shipping help documents are available at www.stoner.org.uk/mals/




    Oct 24 2017 09:40:37

    #3

    Bacchus

    Join date : 2014-12-04      Posts : 57

    Alan said You need addmulti.cfm if you have multiple products. All need a numeric suffix.

    Thanks Alan for putting me on the right path. I had tried addmulti.cfm earlier but something was still not right, so experimented with the other. However with this configuration everything worked: <form action="http://ww8.aitsafe.com/cf/addmulti.cfm"; method="post">
    <INPUT TYPE="HIDDEN" NAME="productpr1" VALUE=" " >
    <select name="product1[]"></select>
    <SELECT name="productpr1"> </SELECT>
    <textarea name="product1[]" rows="3" cols="60"></TEXTAREA>
    I'm still not clear on the uses of [] - where it does belong and when it doesn't. But as usual, when it works, stop fiddling.

    Bacchus




    Oct 28 2017 09:53:53

    #4

    Alan

    Join date : 2008-09-18      Posts : 2944

    I think if you code productpr[] the statement will be ignored.

    productpr's name will come before any product names, regardless of the statement sequence.

    If you have multiple product statements you should use product[] on all, whether or not you also have productpr.

    One product without [] is fine, with one productpr

    E&OE!

    Alan
    Some shipping help documents are available at www.stoner.org.uk/mals/