Community Forums 

Main Content

Shopping Cart Product placement?

    Apr 27 2016 14:19:47

    #1

    smokethisgt

    Join date : 2016-04-27      Posts : 10

    Hello! I'm trying to fix the formatting of the products listed in my shopping cart. For example, I have two drop down options on my web form, Size & Sleeve Length. It adds to the cart correctly however I don't like the format that it's posted. Here are the details:

    HTML:

    <form action="http://ww8.aitsafe.com/cf/add.cfm"; method="post"><input type="hidden" name="userid" value="99999999">


    <input name="product[]" type="hidden" value=" Boy Stacked Monogram">
    <div id="Profont">Size:</div>
    <input type="hidden" name="size" value="Drop Down" />
    <input type="hidden" name="optname1" value="Size" />
    <input type="hidden" name="nocart" />
    <input type="hidden" name="return" value="http://www.mywebsite.com/Cart.htm">;
    <select name="productpr">
    <option value="0-3M Onesie:23">0-3M Onesie</option>
    <option value="3-6M Onesie:23">3-6M Onesie</option>
    <option value="6-12M Onesie:23">6-12M Onesie</option>
    <option value="12-18M Onesie:23">12-18M Onesie</option>
    <option value="12M Shirt:23">12M Shirt</option>
    <option value="18M Shirt:23">18M Shirt</option>
    <option value="2T Shirt:23">2T Shirt</option>
    <option value="3T Shirt:23">3T Shirt</option>
    <option value="4T Shirt:25">4T Shirt</option>
    <option value="5T Shirt:25">5T Shirt</option>
    <option value="6 Shirt:25">6 Shirt</option>
    <option value="8 Shirt:25">8 Shirt</option>
    </select><br><br>

    <input name="product[]" type="hidden">
    <div id="Profont">Sleeve Length:</div>
    <input type="hidden" name="sleeve" value="Drop Down" />
    <input type="hidden" name="nocart" />
    <input type="hidden" name="return" value="http://www.mywebsite.com/Cart.htm">;
    <input type="hidden" name="optname2" value="Sleeve" />
    <select name="product[]">
    <option value="Short Sleeve">Short</option>
    <option value="Long Sleeve">Long</option>
    </select><br><br>

    <input type="submit" value="Add to Cart" name="Cart" class="INDVbutton" />



    </form>


    What currently displays in the Shopping Cart is:
    12M Shirt Boy Stacked Monogram, , Long Sleeve

    Price:$23.00

    Quantity: 1




    What i'd like for it to display is:
    12M Shirt Boy Stacked Monogram, Long Sleeve

    Price:$23.00

    Quantity: 1

    OR

    12M Shirt Boy Stacked Monogram
    Long Sleeve

    Price:$23.00

    Quantity: 1


    Also, what would code would I need if I wanted to add a text field where they could enter Additional Comments?

    I know this is probably something very simple, but i've had issues finding just the right step. Thank you Thank you for your help and time!



    Apr 27 2016 20:31:33

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    Remove this unnecessary code before the sleeve drop down. It is what is putting in the extra comma. <input name="product[]" type="hidden">

    To add a text field for them to enter the monogram you use... <input type="text" size="20" name="product[]">

    You only need 1 nocart and return field. Remove the duplicate

    This does nothing. <input type="hidden" name="size" value="Drop Down" />
    <input type="hidden" name="optname1" value="Size" />

    Same with the ones for the sleeves.

    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.




    Apr 27 2016 21:42:04

    #3

    smokethisgt

    Join date : 2016-04-27      Posts : 10

    Thank you, I was able to solve almost everything! Now in my cart I only have one comma that I cannot get rid of (the one after "initials - fds):

    0-3M Onesie Boy Stacked Monogram, Short Sleeve
    Initials - fds,
    Comments - fdsfsd

    HTML:

    <input type="hidden" name="product[]" value=" Boy Stacked Monogram">
    <select name="productpr">
    <option value="0-3M Onesie:23">0-3M Onesie</option>
    <option value="3-6M Onesie:23">3-6M Onesie</option>
    <option value="6-12M Onesie:23">6-12M Onesie</option>
    <option value="12-18M Onesie:23">12-18M Onesie</option>
    <option value="12M Shirt:23">12M Shirt</option>
    <option value="18M Shirt:23">18M Shirt</option>
    <option value="2T Shirt:23">2T Shirt</option>
    <option value="3T Shirt:23">3T Shirt</option>
    <option value="4T Shirt:25">4T Shirt add $2.00</option>
    <option value="5T Shirt:25">5T Shirt add $2.00</option>
    <option value="6 Shirt:25">6 Shirt add $2.00</option>
    <option value="8 Shirt:25">8 Shirt add $2.00</option>
    </select><br><br>

    <div id="Profont"><b>Sleeve Length:</b></div>
    <select name="product[]" value="">
    <option value="Short Sleeve,">Short</option>
    <option value="Long Sleeve,">Long</option>
    </select><br><br>

    <div id="Profont"><b>Monogram Initials:</b><br>(First, Last, Middle)</div>
    <input type="hidden" name="product[]" value="{br} ," />
    <input type="hidden" name="product[]" value="Initials - ," >
    <input type="text" name="product[]" size="10" placeholder="HKD" maxlength="3">

    <div id="Profont"><b>Additional Comments:</b><br></div>
    <input type="hidden" name="product[]" value="{br} ," />
    <input type="hidden" name="product[]" value="Comments - ," >
    <input type="text" name="product[]" size="10" placeholder="Fabric Color, Special Requests, etc.">

    <input type="submit" value="Add to Cart" name="Cart" class="INDVbutton" />



    Apr 28 2016 00:15:22

    #4

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    <input type="text" name="product[]" size="5" id="thisone" onChange="thisone.value = thisone.value+','">

    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.




    Apr 28 2016 10:44:01

    #5

    GT

    Join date : 2008-09-18      Posts : 3207

    As far as I can see, you are adding the comma...

    <input type="hidden" name="product[]" value="{br} ," />

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

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




    Apr 28 2016 15:37:03

    #6

    smokethisgt

    Join date : 2016-04-27      Posts : 10

    GT said As far as I can see, you are adding the comma...

    <input type="hidden" name="product[]" value="{br} ," />



    GT, after I remove the comma after this break it results in the following:

    0-3M Onesie Boy Stacked Monogram, Short Sleeve
    , Initials - TTT,
    Comments - TEST

    As you can see, now it's added one.



    Apr 28 2016 15:38:20

    #7

    smokethisgt

    Join date : 2016-04-27      Posts : 10

    Debbie Q said <input type="text" name="product[]" size="5" id="thisone" onChange="thisone.value = thisone.value+','">

    Debbie, thanks for the response..

    i'm assuming I add the ID, and OnChange to this line?
    <input type="text" name="product[]" size="10" placeholder="HKD" maxlength="3">

    When I did, nothing changed.



    Apr 28 2016 15:41:05

    #8

    smokethisgt

    Join date : 2016-04-27      Posts : 10

    Nevermind! Debbie's advice worked. I replaced my old line completely with Debbies. Thank you all!!