The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Increase quantity button

Hi there !

I use a select field for 'quantity', with predefined values (from 1 to 10). I discussed this a while back here:

When the quantity increases, it displays a set of custom fields that correlate to the quantity:

I need to add a button that increases the quantity when clicked, baring in mind i'm using a select field rather than a number field like the default foxy cart templates.

I put together a quick proof of concept; whilst the value in my select dropdown field changes, the cart is not re-rendered (the totals still reflect the previous value).

What's the best way to go about this ?
  • fc_adamfc_adam FoxyCart Team

    Thanks for providing a detailed overview and whispering a link to your site.

    This one had me stumped for quite a while, but I managed to narrow it down to some sort of conflict with a javascript file included on your checkout (s.all.min.js). If I used your checkout template on my own test store without that javascript file included, then running jQuery code like this worked fine:
    You'll need to review the code that is included within that file to try to work out which code is causing the issues with the select change event.

    I hope that helps!
  • Hi @fc_adam - thanks for the quick response!

    I'm loading jQuery inside s.all.min.js. When I removed this, all works fine. So thanks for the hat tip!

    Quick question - whilst this works if you click on the #button first, if you click on the quantity select field first, then the #button, the jQuery doesn't run.

    Is this my jQuery or something todo with FC javascript ?


  • Ahh, it's my jQuery that is the problem. This works fine:

    $(document).on('click', '#button', function(){

    Thanks again for your help.
  • fc_adamfc_adam FoxyCart Team

    I'm glad you got it sorted! Nice one.
Sign In or Register to comment.