Home › Forums › Ticket Products › Event Tickets Plus › Conflict with Fatal error: Call to undefined function add_to_cart_wooticket_btns
- This topic has 10 replies, 2 voices, and was last updated 10 years, 11 months ago by Barry.
-
AuthorPosts
-
June 14, 2013 at 5:26 am #513261verticaParticipant
Hi, weird one for you:
We got everything working great during development on a different theme. After we copied all the overrides in the /theme/events folder, the wootickets plugin stops working. In fact, it breaks aspects of the page at the time when is brought into the page.
Debugging, it displays this message:
Fatal error: Call to undefined function add_to_cart_wooticket_btns() in /var/www/vhosts/vertica-careers.com/httpdocs/wp-content/themes/Trim/events/single.php on line 101
…which is where the is.
This happens on both the event list and the single event. Swapping back to WP theme and it works fine, but I’ve deactivated all plugins and all javascript files on the TRIM theme and it still happens.
Any ideas why this happens?
June 14, 2013 at 5:58 am #51328BarryMemberIt sounds as if a change you made to your custom events/single.php template is causing a problem (nowhere in the default single events template is add_to_cart_wooticket_btns() called/used) – which would explain why switching to a theme where the same template has not be overriden with the same file would work.
Is this a customization you made by yourself / are you in contact with whomever set up your custom events templates and can you seek help from them, or else restore the original?
June 14, 2013 at 6:22 am #513401verticaParticipantHi Barry,
It was actually yourself who went in and added.changed some code kindly for us:
https://theeventscalendar.com/support/forums/topic/list-ticket-price-on-event-list/#post-46758Not sure if you remember but you got it working. Was there something specific you changed that we need to copy over?
June 14, 2013 at 7:05 am #51345BarryMemberOK, that’s quite a long and involved thread so it’s definitely possible I’m missing something, but I don’t think I edited your custom events/single.php template (and am not seeing references to that in the other thread).
If you can highlight the actual change I suggested please do and I’ll take another look.
June 18, 2013 at 4:53 pm #51606BarryMemberHi! Did you get any further on this one?
June 20, 2013 at 9:34 am #517691verticaParticipantNot yet.
Looking back at the last thread, you fixed the list.php for us (we copied over the changes single.php) – see May 8th entry here: https://theeventscalendar.com/support/forums/topic/list-ticket-price-on-event-list/.It mentioned wrapping the code first:
echo ‘Pricing data: ‘;
var_dump($wootickets_pricing);
tribe_get_ticket_form();
$price_differential = echo ‘Pricing data: ‘;
var_dump($wootickets_pricing);When we’ve brought over the same code into the live site, it no longer works – which is weird. Just wondering if anything else was changed in another file.
The issue is definately connected to as both the event list page and the single page break at this point. We thought it may be a javascript conflict but removing all plugins and deregistering the javascript calls in the theme still made no difference.
Any other ideas what we’re missing here?
June 20, 2013 at 9:35 am #517701verticaParticipantSorry, the code was stripped from above. The php causing the issue is here:
… added to stop it being stripped
June 20, 2013 at 9:35 am #517711verticaParticipantphp add_to_cart_wooticket_btns()
June 20, 2013 at 9:54 am #51774BarryMember(Please use a service such as Pastebin instead of posting code directly in the forum.)
So to bring this back to the error you originally reported:
Fatal error: Call to undefined function add_to_cart_wooticket_btns()
All I can really tell you is that that is not a function provided by the current version of WooTickets or WooCommerce, so essentially you would need to strip that code out or replace it with something that does work.
June 21, 2013 at 1:57 am #518301verticaParticipantOK. I noticed in the working version on cvprofessor that there was a function for add_to_cart_wooticket_btns() which looks like this:
http://pastebin.com/US1wNC3eI added this to the vertica-careers site functions.php but it still doesn’t bring in the add to cart button. We also can’t get the price working either. Here’s our current single.php file:
http://pastebin.com/vnMRz7TYThe code is the same as cvprofessor but for some reason, it just doesn’t work. What are we missing?
Thanks for you help so far.
PhilJune 21, 2013 at 6:24 am #51841BarryMemberHi Phil,
The add_to_cart_wootickets_btn() would indeed need to be in your functions.php file – or some other suitable location – before you can use it.
Please note that however that it will not generate the same WooTickets form as you would normally see when viewing a single event page – it simply creates an add to cart link and so is generally redundant in the context of the events/single.php template (as, if tickets are available, they will be listed in the normal ticket form).
-
AuthorPosts
- The topic ‘Conflict with Fatal error: Call to undefined function add_to_cart_wooticket_btns’ is closed to new replies.