Announcement

Collapse
No announcement yet.

Adding a quantity box on category page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding a quantity box on category page

    I'd like to add a quantity box above or next to the "Add to Cart" button so the customer can choose how much they want to buy and it doesn't default to 1.

    Something like this:
    https://www.toocutebeads.com/Swarovs...nt_c_4174.html

    I know I have to change the category_0.html file but not sure what to change.

    I think I have to amend this code...

    <div class="action">
    <input type="button" value="[category_buyitlink]" onclick="window.location = 'add_cart.asp?quick=1&amp;item_id=[catalogid]'" class="btn" onmouseover="this.className='btn_over'" onmouseout="this.className='btn'" />

  • #2
    aninam2001

    You can download my code in this thread https://forums.3dcart.com/forum/shop...-are-displayed

    Comment


    • #3
      Toocutebeads Thank you so much!! I will play around with that and see if I can get it to work.

      Comment


      • #4
        aninam2001

        I'm working on replacing the add to cart with a waiting list button at the moment. https://www.toocutebeads.com/Hallowe...ts_c_4297.html Once I clean it up I'll upload for anyone interested as well.

        Comment


        • #5
          Toocutebeads

          OK, so I now have a quantity box, but the "add to cart" button doesn't actually add anything to the cart, I think because I removed the "'add_cart.asp" bit from the code?

          Comment


          • #6
            Check your form against the form in my code.

            Comment


            • #7
              I did, but it's completely different. I even tried using your entire "category" file instead of mine but that didn't work either. Thank you SO much for trying to help!

              I feel like this should be so simple.

              I copied and pasted this code from your file, which give me the quantity box but no command for actually inserting the quantity into the cart.

              <div class="action">



              <div class="addToCartBlock sub-section">
              <div class="qtybox-addcart form-group">
              <!--START: qtybox-->

              <label class="qty-input">
              <input type="hidden" name="item_id" value="[catalogid]" />
              <input type="text" class="form-control" name="qty-[counter]" value="0" onfocus="if
              (this.value==this.defaultValue) this.value=''">
              </label>

              <!--END: qtybox-->
              <!--START: addcartbutton-->
              <input type="submit" id="Add" class="btn btn-default btn-addcart" name="[product_addtocart]" value="ADD +">
              <!--END: addcartbutton-->
              </div></div>

              </div>


              This is my code for adding the quantity to the cart. From what I understand, and I could be wrong, it defaults to 1 (quick=1)?

              <div class="action">
              <input type="button" value="[category_buyitlink]" onclick="window.location = 'add_cart.asp?quick=1&amp;item_id=[catalogid]'" class="btn" onmouseover="this.className='btn_over'" onmouseout="this.className='btn'" />
              </div>


              My thinking therefore is that if I can replace that "quick=1" bit with the quantity entered into the box in your code, it should work like a charm?

              Comment


              • #8
                aninam2001 Can you message me a link to whatever page your testing on?

                Comment


                • #9
                  Toocutebeads I haven't been able to work on the web site in a while but I'm back at it and still struggling with the category page and adding quantities.

                  I replaced my category_0.html with your code exactly and this is what I have:
                  http://twiddletails-com.3dcartstores...ghts_c_37.html

                  The "add" button does absolutely nothing and I'm not sure where it's going wrong. Any suggestions? Thanks in advance!!

                  Comment


                  • #10
                    Originally posted by aninam2001 View Post
                    Toocutebeads I haven't been able to work on the web site in a while but I'm back at it and still struggling with the category page and adding quantities.

                    I replaced my category_0.html with your code exactly and this is what I have:
                    http://twiddletails-com.3dcartstores...ghts_c_37.html

                    The "add" button does absolutely nothing and I'm not sure where it's going wrong. Any suggestions? Thanks in advance!!
                    What theme are you using? I will pop my code into the specific theme and see if I can find whats broken.

                    Comment


                    • #11
                      Toocutebeads It's Swirl Girls. Thank you so much!!

                      Comment


                      • #12
                        aninam2001 I've added the code I used in my previous HTML5 theme. I'm wondering If I caused my current code to stop working with HTML5 when I updated.
                        Attached Files

                        Comment


                        • #13
                          That worked!! Thank you! (I tried switching to a core theme but it's above my paygrade. :()
                          Another question: How can I get the [minimumorder] field to display instead of 0? Itried just replacing value="0" with value=[minimumorder] but that didn't work.

                          Comment

                          Working...
                          X