Community Forums 

Main Content

Using quantity discount feature

    Sep 03 2010 20:46:58



    Join date : 2008-09-18      Posts : 67

    I followed the instructions I found in another post for adding a script to your page so that the discountpr tallies up the cumulative sum of all the items and calculates the appropriate discounts (and I can't find that post -- hence this new post!)

    I have used the add.cfm and checked that my form tag is closed, yet it's not working and I get the "your cart is empty" message. Here is the draft of that page:

    When you purchase a total of 25, or more, of any combination of molds, the price is $13.50 each. If you buy LESS than 25 molds, the price is $17 each. I can't see what I'm doing wrong -- any help would be greatly appreciated! Thanks!

    Sep 03 2010 22:04:36


    Debbie Q

    Join date : 2008-09-18      Posts : 4998

    I don't have time to test this out but with a quick look I see that the second line of the item has something written inside the brackets making it not be included in the tally. Yours just has product[] for both lines. Test it and see if that is the problem.

    <input type="text" name="product[]" size="2" onKeyUp="tally(this)">Number of boxes of 'Foil Light - Standard'
    <input type="hidden" name="product[Standard]" value="Foil Light Standard">

    Debbie Q

    Mal's Support:
    GT's Forms and examples:
    Helpful java scripts:
    Shipping help documents:

    My Create-A-Book Publishing -
    Personalized Books, Music CDs and Gifts for all ages and occasions.

    Please help me out and share my site on your networks.

    Sep 03 2010 22:57:14



    Join date : 2008-09-18      Posts : 67

    Hmmm, no, that made no difference. So for each product (I've only done the top 2 in this manner) I have:

    <FORM action=""; method="post" >
    <input type="hidden" name="userid" value="69243506" />
    <input type="hidden" name="return" value="">;
    <input type="hidden" name="qty">
    <INPUT TYPE="HIDDEN" NAME="discountpr" VALUE="24,17.00:1,13.50:0,13.50">

    <INPUT TYPE="TEXT" NAME="product[]" size="2" onKeyUp="tally(this)"><span class="descriptions">Kudos Angels Gather</span>
    <INPUT NAME="product[Kudos Angels Gather]" TYPE="HIDDEN" id="product[Kudos Angels Gather]" VALUE="Kudos Angels Gather">

    <INPUT TYPE="TEXT" NAME="product[]" size="2"onKeyUp="tally(this)"><span class="descriptions">Kudos Baby Cow</span>
    <INPUT NAME="product[Kudos Baby Cow Mold]" TYPE="HIDDEN" id="product[Kudos Baby Cow Mold]" VALUE="Kudos Baby Cow Mold">

    Plus this script in the head section of the page:

    <script type="text/javascript">
    function tally(that){
    if ("product[]")>-1){result += that.form.elements.value-0;}
    }that.form.qty.value = result;

    --- and a closing form tag at the end of it. I really can't see what's missing, but it still says "your cart is empty". Help!

    Sep 04 2010 07:29:17



    Join date : 2008-09-18      Posts : 3235

    I see you've introduced 180 errors into that page:

    Your google style sheet is throwing the tables out, making the page around 5 miles wide.

    I see you've modified the script and haven't followed other form examples.

    I've spent two hours and rebuilt your page.

    If you'd like to make a donation through the Mal's forms page, I'll give you the URL to your new working page.

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

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