Ticket quantity +/- buttons

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21910

    I’m trying to add some +/- buttons next to the ticket quantity field on the booking form. The default spinner on some browsers is not very easy to see. I created the buttons with a few lines of javscript and got to make them edit the field value. Where I’m having trouble having that new value processed.

    Clicking on + will increment the “quantity” field by 1, but the form still acts like the value didn’t change. So if there was 1 ticket and I click on +, the field will change to 2, but the form will act like the value is still 1.

    Is there some function or ajax event that I need to tap into on my script?

    Nicolas Gauthier-Pin
    #21915

    Hi Nicolas,

    The default spinner on some browsers is not very easy to see

    • The only spinner I’m aware of is next to the ‘book now’ button, and I don’t see how that’s relevant to your question…

    There is a JavaScript API for this:

    //eventorganiserpro.eoCart.increase_ticket_quantity( ticket_id )
    //eventorganiserpro.eoCart.decrease_ticket_quantity( ticket_id )
    

    but it is not currently documented. The most straightforward solution might be to trigger a JavaScript change event when altering the value (this is typically only triggered in response to a user action, and not when you alter the value of the field directly).

    Stephen Harris
    #21945

    By spinner I mean the little up/down buttons on the ticket quantity selector field. They’re automatically added by each browser to any input of type “number”.

    Anyway, I did exactly what you suggested and it worked great, thanks!

    Nicolas Gauthier-Pin
    #21953

    Ah, I see – I had in mind a ‘loading’ spinner (icon).

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.