Forum Replies Created
-
AuthorPosts
-
Vivianne
ParticipantHi Brian
I posted my complete coding on June 11th.
Here again:add_action( 'init', 'wootickets_stop_sending_email' ); function wootickets_stop_sending_email() { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( (class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' )) AND ($chosen_shipping == 'international_delivery') ) { $woo = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); remove_filter( 'woocommerce_email_classes', array( $woo, 'add_email_class_to_woocommerce' ) ); add_action( 'woocommerce_email_after_order_table', array( $woo, 'add_tickets_msg_to_email' ) ); } }If I delete this part, which I need to define which emails shouldn´t be sent, I get the error:
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0];Do you have the whole picture now?
You pointed me in the direction with these two code snippets (your first answer in this thread).
Any idea why I get an error?Vivianne
ParticipantI get an Error 500 – Server Error.
The debug file doesn´t say anything about my function.If I delete this part from my function, I don´t get the backend error.
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0];But without it, I cannot define, which shipping method I mean.
Any idea?
Vivianne
ParticipantThanks for your code snippets.
I added following code to my functions.php:add_action( 'init', 'wootickets_stop_sending_email' ); function wootickets_stop_sending_email() { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( (class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' )) AND ($chosen_shipping == 'international_delivery') ) { $woo = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); remove_filter( 'woocommerce_email_classes', array( $woo, 'add_email_class_to_woocommerce' ) ); add_action( 'woocommerce_email_after_order_table', array( $woo, 'add_tickets_msg_to_email' ) ); } }It works in the frontend, but I can´t load my backend anymore. It only shows a white page.
Do you see an error I can´t find?Vivianne
ParticipantThis reply is private.
Vivianne
ParticipantThanks a lot!
Now it works perfectly! 🙂Vivianne
ParticipantIt works now! You are amazing!
Thanks a lot!You are right with your sidenote:
I removed it in my try & error status to get it working. 😉
It´s back there now.Vivianne
ParticipantI was able to add all the details to my cart, checkout and overview-page.
In the emails this method doesn´t work. It adds the page-title instead of the event-title and the actual date/time instead of date/time of the event.Could you help me once more?
I added this code to the file email-order-items.php in the woocommerce folder.$event = tribe_events_get_ticket_event( $cart_item['product_id'] ); echo '<br><span class="name">'. tribe_get_events_title( $event->ID ) . '</span>'; echo '<br><span class="date">'. tribe_get_start_date( $event->ID ) . '</span>'; echo '<br><span class="venue">'.tribe_get_venue( $event->ID ).', <span>'. tribe_get_city( $event->ID ). '</span></span>';Vivianne
ParticipantI tried your code and I was able to add the title. (After changing tribe_events_get_event_ticket to tribe_events_get_ticket_event)
Trying to go for the rest now… 😉-
This reply was modified 10 years ago by
Vivianne.
Vivianne
ParticipantI found a solution!
In my custom.js I added following code:$( tribe_ev.events ).on('tribe_ev_ajaxSuccess', function() { customJS(); });And I added my code which needs to be loaded after the Ajax Call in the customJS-var.
Vivianne
ParticipantI tried to understand all you have written, but I cannot figure out, how this special code would look like.
Could you make an example please?
We need to go live next week and I am stuck here with this request of the client.Vivianne
ParticipantI understand that you cannot support further more in this case.
But can you tell me where this ajax call is written which reloads the event list?Vivianne
ParticipantThis reply is private.
Vivianne
ParticipantI found an interesting topic here:
http://stackoverflow.com/questions/16062899/jquery-doesnt-work-after-content-is-loaded-via-ajaxIf I want to try this solution I need to have the possibility to access the ajax call for the filtering of the event list. Where can I find that?
Do you think this could fix the problem?
Vivianne
ParticipantThis reply is private.
Vivianne
ParticipantI have to try this.
When we decided for the plugins we thought something like this is included as a standard.
I guess there are a lot of people who need this exact details in the emails etc.I will get back to you if I am stuck.
Thanks a lot for the first input.
-
This reply was modified 10 years ago by
-
AuthorPosts
