Book Now button
-
Hello,
I just noticed the ‘Read More’ and ‘Book Now’ buttons don’t work. They just refresh the page rather than going to the Eventbrite page.
Is this a known bug?
- This topic was modified 5 years, 10 months ago by businesscloudinc.
- This topic was modified 5 years, 10 months ago by businesscloudinc.
-
Hi, no it is not a known issue, you can see here on the demo site that it does work. https://widget-for-eventbrite-api.demo.fullworks.net/
It could be an issue specific to your sites, such as a plugin that does things with external links. Normal advice would be to, after backing up or on a test server, to disable all plugins except this one and switch the theme to default, see if it works and then revert back one by one to identify the culprit.
If you do find a plugin that causes this issue please let me know.
Hmm, no luck. The only link related plugins I have are Really Simple SSL and Redirect but I tried disabling both as well as other plugins and no luck.
The weird part is I haven’t added any new plugins and the buttons used to work before.
What version of plugin?
What version of WordPress?
What version of PHP?Can you share the url?
What version of plugin? – Version 2.7.3
What version of WordPress? – Version 5.0.3
What version of PHP? – Version 7.1Can you share the url? – https://questcanada.org/events/
I have added a bit of jQuery as a workaround for now but if you hover over the button, you’d see the event URL is wrong.
I have investigated your issue further.
First can you confirm that you have not created a custom template for widget.php ( which you could have done ) ?
From what I can see the href is missing on the button <a class=”button … but not on the title ( you can se you can click on that ) which is generated from the same function call and data but has no button class.
As I suspect your theme or a plugin is using javascript to remove the href on class=button I tried turning off javascript in my browser – but your theme doesn’t run at all without javascript at all as it has a pre-loader, so I can’t prove that point.
I cant really do much more to debug what is happening on your site without direct access, but if I did I would create a custom template for widget.php and change the button class ( first removing it ) to prove or not that something is hijacking the href.
Creating a custom template is simply a matter of copying templates/widget.php into a folder widget-for-eventbrite-api in your child theme or if you don’t have a child theme, directly in wp-content and editing that file.
Thank you for taking the time to troubleshoot. I did create a custom template in order to test and as per your suggestion, I tried changing/removing the button class, however, neither seems to do the trick. Essentially the code I tried was:
if ( $data->args['booknow'] ) : ?> <div class="eaw-booknow"> <?php printf( '<a href="%1$s" %3$s>%2$s</a>', esc_url( eventbrite_event_eb_url(($data->args['tickets'])?'#tickets':'')), $data->args['booknow_text'], ( $data->args['newtab'] ) ? 'target="_blank"' : '' ); ?></div><?php endif;
as well as
if ( $data->args['booknow'] ) : ?> <div class="eaw-booknow"> <?php printf( '<a href="%1$s" class="eaw-button" %3$s>%2$s</a>', esc_url( eventbrite_event_eb_url(($data->args['tickets'])?'#tickets':'')), $data->args['booknow_text'], ( $data->args['newtab'] ) ? 'target="_blank"' : '' ); ?></div><?php endif;
As you can see, the function that delivers the url is
eventbrite_event_eb_url
And that works a few lines above in the title.
You could simplify the template all the way down if you like.
Apart from turning off all plugins and switching themes to default ( after cloning into a staging environment ) there is not much more I can add.
p.s. I’m still seeing class=button – have you caching that needs to be cleared?
Are you sure your template is in a correct location and being picked up ( but some extra text like
echo "xxDebugxx";
temporarily.Yes, I cleared caching and in my testing, the class got removed. Right now the class should be “eaw-button”
I’m at a bit of a loss as what to suggest without direct access.
You could try simplifying
printf( '<a href="%1$s" class="eaw-button" %3$s>%2$s</a>', esc_url( eventbrite_event_eb_url(($data->args['tickets'])?'#tickets':'')), $data->args['booknow_text'], ( $data->args['newtab'] ) ? 'target="_blank"' : '' );
into just first
printf( '<a href="https://google.com" class="eaw-button">GOOGLE</a>');
Which then if the link to Google disappears you know for definite it is something in your setup
If it doesn’t disappear you could try a simplified version of the button – very similar to the ‘title’ link that works and uses the same function.
printf( '<a href="%1$s" class="eaw-button">TEST</a>', esc_url(eventbrite_event_eb_url());
Any progress?
I haven’t had a chance to test as there are no upcoming events right now. I will give your suggestion a try asap and report back.
Thanks!
- The topic ‘Book Now button’ is closed to new replies.