Community Forums 

Main Content

Need help with products in the cart!

    Mar 18 2009 14:41:32



    Join date : 2008-09-18      Posts : 29


    I have 25 products in my shopping cart. These are donation items, so the customer inputs his own $ amount next to each item.

    Currently, all 25 items are being passed to the shopping cart when the order is submitted. Even if the customer selects one of the items, the rest of the products appear in the shopping cart with a $ value of $0.00.
    Is there any way for only the product purchased to appear in the cart and not the rest of the items?

    Here's my code for one of the products (it's the same for all):

    <INPUT size=8 name=price24>
    <input type="hidden" name="product24[]" value="Product 24">
    <input type="hidden" name="qty24" value="1">
    <input type="hidden" name="units24" value="0">

    Thanks in advance for any help on this!


    Mar 18 2009 14:56:24



    Join date : 2008-09-18      Posts : 488

    Your issue is that you set the quantity to 1 for each product. You could make quantity a checkbox, text input, or drop down. Since it will be either 0 or 1, I would opt for a checkbox.

    If you want to get fancy, you could use a javascript to change quantity to 1 if the price is greater than 0. That would allow you to leave the quantity hidden.

    Mar 18 2009 16:39:42



    Join date : 2008-09-18      Posts : 29

    Thank you!
    I think leaving the quantity hidden would work best in this scenario. But I'm not javascript savvy... Would it be too much trouble to send me the code? and where on the page should it be placed?

    thanks so much!

    Mar 18 2009 17:44:57



    Join date : 2008-09-18      Posts : 488

    Honestly, since I would have to write it and I don't have any use for it myself, it is too much trouble.

    Mar 19 2009 08:36:00



    Join date : 2008-09-18      Posts : 3246

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.

    Mar 19 2009 10:12:34



    Join date : 2008-09-18      Posts : 2986

    Looking at it another way you could give everything a hidden price of 1 and the value they entered would be the quantity. If there's no qty then no cart entry.

    <input type="hidden" name="price24" value="1" />
    <input type="hidden name="product24" value="Donation to product24" />
    <input type="hidden" name="units24" value="0">
    <input type="text" name="qty24" />

    Maybe not so pretty but has the advantage that the customer can amend the donation in the cart more easily when it is the quantity than when it is the price.

    Product ----------------- Quantity Price Amount
    Donation to product24 -- 36 -- 1.00 --- 36.00

    Or even change the product to
    Dollars for product24

    Some shipping help documents are available at

    Mar 19 2009 10:46:31



    Join date : 2008-09-18      Posts : 510


    I use this coding for Top Up payments which are similar to making donations.

    Obviously alter the ?? and YOUR info to suit.

    <form style="display:inline; margin-top:0px; margin-bottom:0px;" method="POST" action="http://ww??">
    <input type="hidden" name="userid" value="YOUR ID">
    <input type="hidden" name="product[]" value="Top Up Payment">
    <INPUT type="hidden" name="return" value="www.YOUR URL/YOUR URL PAGE.html">
    <INPUT size=8 name=price>
    <INPUT type="submit" value= Pay-Now > <INPUT type="reset" value= Reset >

    Please either Share or Like my Facebook

    Mar 19 2009 21:50:38



    Join date : 2008-09-18      Posts : 29

    Thank you all! I will give this a try!