Here’s what’s going on with the code below:
When this code is being used, it allows me to add tickets to my cart… no problem.
However, if I try to add tickets to another event, it replaces the tickets currently in the cart with the new event ticekts only allowing for one event in the cart at a time.
If I remove this code and try to add a ticket, it redirects me to the cart but the cart is always empty.
Working on this locally with the code active gives me a 502 bad gateway error when trying to add products to the cart.
Working with this on the provided staging url, it won’t allow products to be added to the cart.
On the staging url provided, I have the code in place so you can see how it overwrites the events in the cart when you try to add a different event.
I really need a fix for this, we’re suppose to go live with this over the weekend.
Thank you.
// -----------------------------------------------------------------------------
// The code below this comment should be added to the theme's functions.php file
// -----------------------------------------------------------------------------
// MEMORY SIZE EXHAUSTED ISSUE
// Compatibility fix to help run WooCommerce Tickets 3.9 with WooCommerce 2.3.x
if ( class_exists( 'TribeWooTickets' ) ) {
// Form reference to ticket processing callback
$wootickets = TribeWooTickets::get_instance();
$callback = array( $wootickets, 'process_front_end_tickets_form' );
// Switch to a later action
remove_action( 'init', $callback );
add_action( 'wp_loaded', $callback );
}