Community Forums 

Main Content

Discounts, radio buttons, and multiple prices.....oh my!!

    Oct 09 2009 20:32:41

    #1

    Drake

    Join date : 2009-06-19      Posts : 52

    Hello!

    I am wanting to have items in my cart that have options to choose by radio buttons, different pricing depending on option, and discounts for buying in quantity. The code below handles the first and 3rd goal beautifully. I just need help incorporating the second goal. Any advice is appreciated.

    <form action="http://ww10.aitsafe.com/cf/add.cfm"; method="post" target="cart1"/>
    <INPUT TYPE="HIDDEN" NAME="userid" VALUE="C1152207">
    <input name="return" type="hidden" value="http://widgetsRus.com">;


    <INPUT TYPE="HIDDEN" NAME="product[]" VALUE="Certified Widjets, 1 lb.">
    <input type="radio"NAME="product[]" value="Red"> Red<br>
    <input type="radio"NAME="product[]" value="Green"checked> Green

    <INPUT TYPE="HIDDEN" NAME="discountpr" VALUE="9,2.00:20,1.50:0,1.25">
    <input type="hidden" name="units" value="1">
    Quantity: <input type="text" name="qty" value="1" size="2"/>
    <input type="submit" name="Submit" value="Order Widgets" onclick="alert('Widgets have succesfully been added to your cart.');" />
    </form>



    Oct 10 2009 05:28:33

    #2

    GT

    Join date : 2008-09-18      Posts : 3212

    This might be neater:
    <form action="http://ww10.aitsafe.com/cf/add.cfm";; method="post" target="cart1"/>
    <input type="hidden" name="userid" value="C1152207">
    <input name="return" type="hidden" value="http://widgetsRus.com">;
    <input type="hidden" name="discountpr" value="9,2.00:20,1.50:0,1.25">
    <input type="hidden" name="units" value="1">

    <input type="radio" name="product[]" value="Certified Widjets, 1 lb, Red"> Red<br>
    <input type="radio" name="product[]" value="Certified Widjets, 1 lb, Green"> Green<br>
    Quantity: <input type="text" name="qty" value="1" size="2"/><br>
    <input type="submit" name="Submit" value="Order Widgets" onclick="alert('Widgets have succesfully been added to your cart.');" />
    </form>

    To have different prices means different form type and discounts, you'll need to use addmulti.cfm

    hih.

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

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




    Oct 10 2009 07:34:57

    #3

    Alan

    Join date : 2008-09-18      Posts : 2956

    I don't think the beauty runs to the third goal if you are wanting the combined quantity of red and green widgets to affect the price.

    Take a look at the comments in https://www.mals-e.com/viewtopic.php?id=6629&mid=6629&fid=2

    There's an example at http://www.stoner.org.uk/mals/discountpr-expanded.html that may help - at present it isn't liking your userid and server number.

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