Support

Home Forums Event Espresso Premium Ticketing Selector Error

Ticketing Selector Error

Posted: November 6, 2019 at 2:34 pm


GGS

November 6, 2019 at 2:34 pm

I get this when I go to ticketing.

Fatal error: Method EventEspresso\modules\ticket_selector\TicketSelectorStandard::__toString() must not throw an exception, caught ArgumentCountError: Too few arguments to function tw_output_details_before_the_ts(), 1 passed in /home/gagensoc/public_html/new/new/website/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /home/gagensoc/public_html/new/new/website/wp-content/plugins/event-espresso-core-reg/modules/ticket_selector/DisplayTicketSelector.php on line 0

here is the website page where WP Debug showing: https://ighr.gagensociety.org/courses/prototype-methods-and-sources-test/

I didn’t happen over the Spring in 2019…


Josh

  • Support Staff

November 6, 2019 at 2:55 pm

Hi,

The error message indicates something to do with a “tw_output_details_before_the_ts” function, which isn’t a function provided in EE4 core. Can you find the code that has the tw_output_details_before_the_ts() function and post its contents here? It may be in a separate plugin installed on your site.


GGS

November 6, 2019 at 3:01 pm

How/where would I look?


GGS

November 6, 2019 at 3:08 pm

I believe this is the problem in the template Funtions (I added a while back):
//Output details just after the ticket selector, the function has the Event ID ($EVT_ID)
//and EE_Event object $event available for use.
function tw_output_details_before_the_ts( $EVT_ID, $event ) {
echo “<h3>Discounts Available. Use The Codes During Checkout<br>FOR COURSES ONLY</h3><p>Early Bird Code (Before May 16) – <b>ERLYBRD19</b></p><p>GGS Member – <b>(Use your GGS registered email address as a coupon code – COURSE USE ONLY!!!Other uses will be corrected and billed)</b></p><p>GGS Single Membership + Course Registration – <b>SNGLCLS19</b></p><p>GGS Family Membership + Course Registration – <b>MMBRCLS19</b></p>” ;
}
add_action( ‘AHEE__ticket_selector_chart__template__before_ticket_selector’, ‘tw_output_details_before_the_ts’, 10, 2 );


GGS

November 6, 2019 at 3:12 pm

It was the last line. Can this be altered for the newer version?

add_action( ‘AHEE__ticket_selector_chart__template__before_ticket_selector’, ‘tw_output_details_before_the_ts’, 10, 2 );


Josh

  • Support Staff

November 6, 2019 at 3:21 pm

Actually I’m not sure how that code would have worked, ever. The AHEE__ticket_selector_chart__template__before_ticket_selector action hook passes one argument, and your code has two.

Here’s what you can do to fix:
Change
function tw_output_details_before_the_ts( $EVT_ID, $event ) {
to
function tw_output_details_before_the_ts( $event ) {

then change
add_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', 'tw_output_details_before_the_ts', 10, 2 );
to:
add_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', 'tw_output_details_before_the_ts', 10 );


GGS

November 6, 2019 at 3:36 pm

That fixed everything I got from Github last year!

The support post ‘Ticketing Selector Error’ 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