Support

Home Forums Event Espresso Premium Quantity Button

Quantity Button

Posted: March 10, 2017 at 1:45 pm


Christian Rogers

March 10, 2017 at 1:45 pm

Hello,
A few months ago I had posted about an issue I was having and I am just now circling back to that issue (the old forum was closed). I have a ticket selector that I put on a page for a course that I created. The maximum number of tickets is set to 1 and yet the person still needs to select the “Quantity” radio button. See here for an example: http://www.greatseminarsandbooks.com/cancer-rehabilitation/

Is there a way to fix this issue? I am willing to provide backend access. Thank you again!

Chris


Garth

  • Support Staff

March 13, 2017 at 11:59 am

It appears you’re setting the maximum number of tickets for the entire event to 1. But if you edit an individual ticket, you can set the minimum for that ticket to 1: https://eventespresso.com/features/multiple-ticket-pricing-options/#minimum


Christian Rogers

March 14, 2017 at 12:15 pm

Hey Garth,
I’ve tried a few things since I got your message. I picked an event and set the minimum quantity for each ticket to 1. I also tried the maximum for each ticket. It still forces me to select the quantity radio button on the ticket selector. Any other thoughts? Thanks for the help!

Chris


Lorenzo Orlando Caum

  • Support Staff

March 14, 2017 at 12:38 pm

Hi Chris,

Could you share a link to one of your single event pages on your site?

Here is an example:

example.com/events/my-event/

I’m seeing an issue with one of the critical pages for Event Espresso and we would like to also help you fix that as well.


Lorenzo


Christian Rogers

March 14, 2017 at 1:25 pm

Hi Lorenzo,

I actually don’t utilize the individual event pages. You can see by looking at the below page link that we offer face-to-face courses with multiple locations and times so I have a page that describes the course and then the opportunity register at each location. I use the ticket selector shortcode to do this.

http://www.greatseminarsandbooks.com/cancer-rehabilitation/

Any help you can offer with this and with the critical page issue you mentioned I’d greatly appreciate it.

Chris


Tony

  • Support Staff

March 15, 2017 at 7:38 am

Hi Chris,

Any help you can offer with this and with the critical page issue you mentioned I’d greatly appreciate it.

Can you go to Event Espresso -> General Settings -> Critical Pages

The page and shortcode status should so OK and be green, like this – http://take.ms/pDEMA

It looks like the transactions page has not been created or has been removed.

In regards to the ticket selector radio button, do all of your events only have a single ticket?


Christian Rogers

March 15, 2017 at 12:44 pm

Hi Tony,

So the transactions page was okay. The cancel/return page was not, so I fixed that issue.

As for the ticket selector/quantity issue – each event has three tickets. The first is for an early bird price, the second a regular price, and the third a late fee price. Each of the three prices have a timeslot that butts up against each other. I’m not sure that helps you diagnose.

Thanks,

Chris


Tony

  • Support Staff

March 16, 2017 at 3:52 pm

Thank you, it does help and that’s the issue.

Event Espresso will currently only auto select the ticket if it’s the only ticket within the event the other tickets within the event are preventing the radio button from being checked by default.

The easiest way to work around this is to use some custom jQuery to set the radio button to checked if there is only one of them:

https://gist.github.com/Pebblo/fd0526ccb9047511af2d1302fe39e23a

You can add that to a Custom Functions Plugin on your site.

However whilst testing this out on your site through Chrome’s console, I noticed your actually loading versions of jQuery on the page, http://code.jquery.com/jquery-latest.min.js is included twice and then the version of jQuery released with WP core (which is the one you want to keep).

I’m not sure how those additional version are being added although its likely from the theme, possibly within header.php and footer.php but you’ll need to investigate that further and remove those to prevent issues further down the line.


Christian Rogers

April 15, 2017 at 10:26 am

I have an event with multiple ticket options that span different lengths of time (early bird, regular price, late fee price). They are only allowed to register themselves. And thus, I’d like to have the quantity button auto selected. I had a topic on this last month that closed and received the below message on how to fix this. I have since removed the second Jquery loading, and created a plugin with the custom code that was suggested. It is still not working. Any help would be appreciated.

———————————————————–

Thank you, it does help and that’s the issue.
Event Espresso will currently only auto select the ticket if it’s the only ticket within the event the other tickets within the event are preventing the radio button from being checked by default.
The easiest way to work around this is to use some custom jQuery to set the radio button to checked if there is only one of them:
https://gist.github.com/Pebblo/fd0526ccb9047511af2d1302fe39e23a
You can add that to a Custom Functions Plugin on your site.
However whilst testing this out on your site through Chrome’s console, I noticed your actually loading versions of jQuery on the page, http://code.jquery.com/jquery-latest.min.js is included twice and then the version of jQuery released with WP core (which is the one you want to keep).
I’m not sure how those additional version are being added although its likely from the theme, possibly within header.php and footer.php but you’ll need to investigate that further and remove those to prevent issues further down the line.


Josh

  • Support Staff

April 17, 2017 at 6:05 pm

Hi there,

I merged your two topics about this. It looks to me like you still have two copies of jQuery loading on the same page. Do you see the errors in the console on your webpage?

Uncaught Error: Bootstrap's JavaScript requires jQuery
    at bootstrap.min.js:6

Here’s a screenshot of the source of your webpage, along with some recommendations:

https://www.evernote.com/l/AAR8cPaGpYFGHLk4TODG7vOmW8b6aYKKQqA

In summary, there two copies of the jQuery library loading (there should be only one). Then there are 3 copies of the bootstrap.js file loading (again, only should be one).


Christian Rogers

April 26, 2017 at 2:30 pm

Hey Josh,
I looked at it and I think the reason why I did this was because I was not able to get the menu’s to work. This was definitely a mistake on my part. Do you know how I can work around this? I was able to eliminate one bootstrap load.


Josh

  • Support Staff

April 26, 2017 at 3:00 pm

You still have 3 copies of bootstrap loading, and that may be the problem.

The way forward is you remove all of the duplicates. Loading script libraries more than once is not a solution to a problem. If you have a script that loads before a required library loads, then you delay that script. WordPress has a built in system that handles this and it will be worth your while to learn that system and use it. Here are some references that you can get up and running with:

http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/

https://developer.wordpress.org/themes/basics/including-css-javascript/


Christian Rogers

May 12, 2017 at 6:51 am

Hey Josh,
I think I have taken care of the issue. I have enabled wp_enqueue and have gotten rid of the redundancy. The plugin that Tony suggested to automatically select the Quantity button still does not work. So, to rehash the overall problem, we have an event with three tickets (early bird, regular and late fee). They are offered at different points in time.

I have stated on each event page that customers cannot change the quantity (they can only register themselves). Thus, I want the quantity button to be already selected so they just have to hit “Register”.

Let me know if there are any other options. Thanks!

Chris


Josh

  • Support Staff

May 12, 2017 at 9:42 am

Hi Chris,

The code isn’t even loading on the page when I view source, so it’s not a case where it’s not working, it’s just not there. Are you including the ticket selectors via shortcodes directly in a template or or they included within the page content?


Christian Rogers

May 15, 2017 at 4:31 am

Hi Josh,

I followed the steps to create the plugin and it is showing as active on the plugins page. I added the ticket selector shortcode in each page (i.e. [ESPRESSO_TICKET_SELECTOR event_id=6388]). So, what your saying is that the plugin is not loading, correct?

Thanks for the help!

Chris


Tony

  • Support Staff

May 15, 2017 at 5:45 am

Correct, my code isn’t loading on that page.

The JS I provided works, you can see this if add it to Chrome console, it checks the radio buttons – http://take.ms/zrAYn

However, the code I provided uses wp_add_inline_script() to add the JS to the page, and it is tied to the ‘ticket_selector.js’ file which is the JavaScript file loaded for the Ticket selector.

ticket_selector.js is not loading on the page you linked to, so therefore neither will my code.

I added the ticket selector shortcode in each page (i.e. [ESPRESSO_TICKET_SELECTOR event_id=6388]).

How are you adding the shortcodes to the page?


Christian Rogers

May 15, 2017 at 6:06 am

Hey Tony,

Okay, this provides some clarity. I have been using the Custom Fields plugin to create some additional fields which show up on the post edit page. On the actual post page template I have a shortcake for each of the custom fields. I then put the shortcode for each specific event in a specific custom field on the post page. Does that make sense as to how I add it?

Chris


Josh

  • Support Staff

May 15, 2017 at 6:47 pm

Hi Chris,

It makes sense why the scripts aren’t loading because the Ticket Selector shortcode is intended to be used from within the post content section of the page. You’ll need to manually enqueue the ticket selector scripts since they will not load automatically when the shortcode is not within post content editor.

You can add the following to your custom page template to make that happen:

wp_enqueue_script('ticket_selector');


Christian Rogers

May 18, 2017 at 5:41 am

Thanks guys! It is fixed!

The support post ‘Quantity Button’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso