Community Forums 

Main Content

Sub Products with Options

    Mar 05 2013 04:39:41

    #1

    Lynn Greene

    Join date : 2011-07-25      Posts : 20

    Hello!
    I have an item with sub items with options.

    Specifically, I have:
    1 each 4 oz skin care (with no options)
    3 each 1/2oz skin cream (each with 3 options)

    The code that I have doesn't work as I want it to; I understand why it doesn't work but need some help to get it to work. I currently have:

    <input type="hidden" name="product[]" value="4oz Skin Care">
    <input type="hidden" name="product[]" value="1/2oz Skin Cream">
    &nbsp; &nbsp; - Please choose your 1<sup>st</sup> fragrance:
    <INPUT type="radio" NAME="product[]" value="Fragrance Free" checked>Fragrance Free
    <INPUT type="radio" NAME="product[]" value="Musk">Musk
    <INPUT type="radio" NAME="product[]" value="Original Scent">Original Scent<BR>
    &nbsp; &nbsp; - Please choose your 2<sup>nd</sup> fragrance:
    <INPUT type="radio" NAME="product[]" value="Fragrance Free" checked>Fragrance Free
    <INPUT type="radio" NAME="product[]" value="Musk">Musk
    <INPUT type="radio" NAME="product[]" value="Original Scent">Original Scent<BR>
    &nbsp; &nbsp; - Please choose your 3<sup>rd</sup> fragrance:
    <INPUT type="radio" NAME="product[]" value="Fragrance Free" checked>Fragrance Free
    <INPUT type="radio" NAME="product[]" value="Musk">Musk
    <INPUT type="radio" NAME="product[]" value="Original Scent">Original Scent<BR>

    The variations are being applied to the 4oz skin care, and not to each of the 3 1/2oz skin creams.

    Any ideas or suggestions are appreciated.

    Lynn Greene
    The Cornice Store
    www.cornicestore.com




    Mar 05 2013 06:35:32

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    I would consider making the 4oz jar its own product, using addmulti:

    <input type="hidden" name="product1" value="4oz Skin Care">
    4oz Skin Care quantity: <input type="text" size="1" name="qty1" value="">
    <input type="hidden" name="price1" value="9.99">

    Then have the 1/2oz product, here's the two together:

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

    <form action="http://ww12.aitsafe.com/cf/addmulti.cfm"; method="post">
    <input type="hidden" name="userid" value="E9120065">

    <p><input type="hidden" name="product1" value="4oz Skin Care">
    4oz Skin Care quantity: <input type="text" size="1" name="qty1" value="">
    <input type="hidden" name="price1" value="9.99"></p>

    <p>1/2oz Skin Care quantity: <input type="hidden" name="qty2" value="1">
    <input type="hidden" name="price2" value="9.99">
    <br>
    &nbsp; &nbsp; - Please choose your 1<sup>st</sup> fragrance:
    <input type="radio" name="product2[1/2oz Skin Cream Fragrance Free]" value="1/2oz Skin Cream Fragrance Free" onselect="tally(this)">Fragrance Free
    <input type="radio" name="product2[1/2oz Skin Cream Musk]" value="1/2oz Skin Cream Musk" onselect="tally(this)">Musk
    <input type="radio" name="product2[1/2oz Skin Cream Original Scent]" value="1/2oz Skin Cream Original Scent" onselect="tally(this)">Original Scent<br>
    &nbsp; &nbsp; - Please choose your 2<sup>nd</sup> fragrance:
    <input type="radio" name="product2[1/2oz Skin Cream Fragrance Free]" value="1/2oz Skin Cream Fragrance Free" onselect="tally(this)">Fragrance Free
    <input type="radio" name="product2[1/2oz Skin Cream Musk]" value="1/2oz Skin Cream Musk" onselect="tally(this)">Musk
    <input type="radio" name="product2[1/2oz Skin Cream Original Scent]" value="1/2oz Skin Cream Original Scent" onselect="tally(this)">Original Scent<br>
    &nbsp; &nbsp; - Please choose your 3<sup>rd</sup> fragrance:
    <input type="radio" name="product2[1/2oz Skin Cream Fragrance Free]" value="1/2oz Skin Cream Fragrance Free" onselect="tally(this)">Fragrance Free
    <input type="radio" name="product2[1/2oz Skin Cream Musk]" value="1/2oz Skin Cream Musk" onselect="tally(this)">Musk
    <input type="radio" name="product2[1/2oz Skin Cream Original Scent]" value="1/2oz Skin Cream Original Scent" onselect="tally(this)">Original Scent<br>
    </p>

    <p><input type="submit" value="Place Your Order"></p>
    </form>

    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 05 2013 08:16:21

    #3

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    I agree with GT about the multi product but I think I would consider using a drop down menu for the fragrences. Maybe something like this.

    <form action="http://ww12.aitsafe.com/cf/addmulti.cfm"; method="post">
    <input type="hidden" name="userid" value="E9120065">
    <p><input type="checkbox" size="1" name="qty1" value="1">
    <input type="hidden" name="product1" value="4oz Skin Care">
    4oz Skin Care
    <input type="hidden" name="price1" value="9.99"></p>
    <p><input type="checkbox" name="qty2" value="1">
    <input type="hidden" name="product2[]" value="3 - 1/2oz Skin Care">
    3 bottles 1/2oz Skin Care
    <input type="hidden" name="price2" value="9.99">
    <p>
    <select name="product2[]" size="1">
    <option selected value="">Choose 1st fragrance</option>
    <option value="Fragrance Free">Fragrance Free</option>
    <option value="Musk">Musk</option>
    <option value="Original Scent">Original Scent</option>
    </select>
    <br>
    <select name="product2[]" size="1">
    <option selected value="">Choose 2nd fragrance</option>
    <option value="Fragrance Free">Fragrance Free</option>
    <option value="Musk">Musk</option>
    <option value="Original Scent">Original Scent</option>
    </select>
    <br>
    <select name="product2[]" size="1">
    <option selected value="">Choose 3rd fragrance</option>
    <option value="Fragrance Free">Fragrance Free</option>
    <option value="Musk">Musk</option>
    <option value="Original Scent">Original Scent</option>
    </select>
    <p><input type="submit" value="Place Your Order"></p>
    </form>

    Debbie Q

    Mal's Support: www.mals-e.com/support.php
    GT's Forms and examples: www.malsforms.com
    Helpful java scripts: www.gemasana.com/mals
    Shipping help documents: www.stoner.org.uk/mals

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

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




    Mar 05 2013 12:49:13

    #4

    Lynn Greene

    Join date : 2011-07-25      Posts : 20

    THank you for your help - I now have it working as I would like it to.

    Lynn Greene
    The Cornice Store
    www.cornicestore.com