Community Forums 

Main Content

How to get cart to read the quantity in the qty field?

    Oct 28 2016 21:23:41

    #1

    MB

    Join date : 2008-09-18      Posts : 56

    The html for a 6-product cart is below. The value of qty is set to "1". The cart's prices and product information are contained in a js file.

    With the qty set to "1", the end-result of the cart is the quantity of the order shown during checkout is "1" and not the summary of the units being ordered, let's say 200. While this is generally fine, this method does not allow us to use Mals cart-settings to discount based on the number of products being ordered. We have fiddled with adjusting the "qty" to value="" but the result is "your cart is empty".

    We don't know if the adjustment is in the html or the js.

    Thank you for any advice.

    <div id="007" class="cart hidden">
    <div id="div1" class="unhidden">
    <form name="op1" action="https://ww4.aitsafe.com/cf/add.cfm"; method="post">
    <input name="product" value="" type="hidden" />
    <input name="noqty" type="hidden" />
    <input name="userid" value="12345678" type="hidden" />
    <input name="return" value="theurl.com/returnpage.html" type="hidden" />
    <input name="qty" type="hidden" value="1" />
    <input type="hidden" name="units" />
    <input name="price" type="hidden" value="" />
    <div class="hd3">Choose Your Products</div>
    <div class="ct7">
    <div class="ct6">
    <div class="ct4">
    <div class="ct3"><img src="/123/001.jpg" alt="Black"/></div>
    <div class="ct2">Black</div>
    <div class="ct1">
    <input type="text" size="4" name="qty1" id="i1" value="" />
    </div>
    </div>
    <div class="ct4">
    <div class="ct3"><img src="/123/002.jpg" alt="White"/></div>
    <div class="ct2">White</div>
    <div class="ct1">
    <input type="text" size="4" name="qty2" id="i2" value="" />
    </div>
    </div>
    <div class="ct4">
    <div class="ct3"><img src="/123/003.jpg" alt="Green"/></div>
    <div class="ct2">Green</div>
    <div class="ct1">
    <input type="text" size="4" name="qty3" id="i3" value="" />
    </div>
    </div>
    </div>
    <div class="ct5">
    <div class="ct4">
    <div class="ct3"><img src="/123/004.jpg" alt="Royal blue"/></div>
    <div class="ct2">Royal blue</div>
    <div class="ct1">
    <input type="text" size="4" name="qty4" id="i4" value="" />
    </div>
    </div>
    <div class="ct4">
    <div class="ct3"><img src="/123/005.jpg" alt="Red"/></div>
    <div class="ct2">Red</div>
    <div class="ct1">
    <input type="text" size="4" name="qty5" id="i5" value="" />
    </div>
    </div>
    <div class="ct4">
    <div class="ct3"><img src="/123/006.jpg" alt="Navy blue"/></div>
    <div class="ct2">Navy blue</div>
    <div class="ct1">
    <input type="text" size="4" name="qty6" id="i6" value="" />
    </div>
    </div>
    </div>
    </div>
    </form>
    </div>
    </div>



    Oct 29 2016 02:54:35

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4994

    If it is a 6 product form than shouldn't you be using addmulti.cfm instead of add?

    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.




    Oct 29 2016 10:00:26

    #3

    GT

    Join date : 2008-09-18      Posts : 3207

    You as Debbie has said, are using a single product form - add.cfm and not addmulti.cfm.

    You are using two qty1 inputs...
    <input name="qty" type="hidden" value="1" />
    <input type="text" size="4" name="qty1" id="i1" value="" />

    You have no price1 value or a price2 etc value.

    You have no product1 value or a product2 etc value.

    If the colors are only options to the main product, use product[] <-- square brackets...

    If the colors have an additional cost, you need to use addmulti and number each product / price / qty values.

    Not sure that you've read Mals faqs...

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

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