Home › Forums › Ticket Products › Event Tickets Plus › Print tickets for pickup at "Will Call" window.
- This topic has 10 replies, 2 voices, and was last updated 8 years, 6 months ago by
Pete.
-
AuthorPosts
-
October 4, 2017 at 8:37 pm #1359329
Pete
ParticipantHi,
I’m using Event Tickets Plus and WooCommerce to have people make reservations and pre-pay. The payment methods that I am currently being asked to implement are: 1) Pay by check that is snail mailed. 2) Electronic Funds Transfers 3) and the old standby pay-at-the-door! Credit Card will be added once our Treasurer gets into the 20th century! The first two payment methods work fine in that I hold off sending the tickets until the funds arrive then I just “complete” the order and Woo emails the tickets! The pay at the door option is problematic in that I don’t want to email tickets to somebody that hasn’t paid yet! What I’d like to do is print out these tickets and have people pick them up at a “Will Call” or “Box Office” where they get the tickets once they pay. The ticket master in the box office could change the status of the tickets to “completed” and then a uniform check-in process could proceed along with those folks who received their tickets via email.
So my question is: “Is there a way to print out all the tickets that haven’t as yet been paid for?” If not how do other people handle this pay at the door issue?
Thanks,
PeteOctober 5, 2017 at 11:53 pm #1360154Geoff B.
MemberGood evening Pete and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.Is there a way to print out all the tickets that haven’t as yet been paid for?
The short answer is not quite. But I believe we can work around this.
The main issue with that approach is that WooCommerce tickets are typically tied to the user account. In short, that means that if you are creating a ticket to print-off, the customer could see that ticket if they log in to the calendar prior to paying (which is what you want to avoid).
The ideal solution would have been to use a COD type of payment gateway and only complete the purchase once the customer gets there. This would: trigger the email AND enable you to print the ticket on the spot.
What you could do though is use an RSVP ticket for that purpose (which you can rename to your liking).
Here’s how that would work:
- Adapt the following snippet: https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182#file-functions-php
This sends a bcc to the site admin when an RSVP ticket is created. You would only need to remove the customer’s email from the email being sent.
In other words RSVP tickets would only be sent to the site admin not the customer.
- Before the event, print off all these special tickets from the emails received.
Let me know if that helps.
Have a great day!
Geoff B.
October 9, 2017 at 6:24 pm #1361345Pete
ParticipantHi Geof,
Adapting what you suggested I coded up the following and added it to function.php in the child theme. It changes the email address to which the tickets are being sent to if the order payment method is “COD”.
/*
* Filter the get_recipient() function to change the “TO:” email address of tickets that are of payment type ‘cod’
* $recipient = apply_filters( ‘woocommerce_email_recipient_’ . $this->id, $this->recipient, $this->object );
/*add_filter( ‘woocommerce_email_recipient_wootickets’, ‘my_get_recipient’ , 10, 2);
function my_get_recipient($to, $object) {
$order_id =$object->get_id(); // gets the correct order id.
error_log(‘Order ID ‘. $order_id);
/*
* Would like to get the coordinator’s email address here, and set $my_to_email to it.
*/
$my_to_email = ‘[email protected]’;
if ($object->get_payment_method() == ‘cod’ ) { $to = $my_to_email; }
return $to;
}All works fine as is; however, I would really like to retrieve the event coordinator’s email address and use that rather than a hardcoded address. I have the ticket_id but don’t know how to use ticket_id to get coordinator email address.
Any help would be appreciated.
Thanks,
PeteOctober 9, 2017 at 8:45 pm #1361391Pete
ParticipantWhen I said event coordinator in the above I really should have said organizer_email.
October 9, 2017 at 9:33 pm #1361406Geoff B.
MemberGood evening Pete,
I am glad to see you are making some pretty good progress towards the solution.
With that in mind here is another code snippet that should provide you with the required inspiration to complete your work: https://gist.github.com/niconerd/16770b84adb6156aaa77948bf208bacbLet me know how that goes.
Best regards,
Geoff B.October 10, 2017 at 9:05 am #1361570Pete
ParticipantThanks for the additional info. Reviewing the snippet it is obvious to me that I have some terminology mixed up.
The function tribe_tickets_cc_organizer( $order_id = null, $post_id = null, $attendee_order_status = null ) uses the event’s post_id in order to retrieve the organizer’s email address and doesn’t use the order_id for anything. What I have is not the event post_id, I have the order object (in the example below, object_id=3700) which contains a reference to the product_id (in the below example product_id = 3560).
Here is a dump of the variables passed to function tribe_tickets_cc_organizer( $order_id = null, $post_id = null, $attendee_order_status = null )[10-Oct-2017 15:50:25 UTC] Ticket Order ID: [10-Oct-2017 15:50:25 UTC] Ticket Post ID: 3552 [10-Oct-2017 15:50:25 UTC] Ticket Attendee Order Status:Below is an error_log dump of the four variables passed into function tribe_woo_compat_cc ( $attendee_id, $event_id, $order, $product_id ).
[10-Oct-2017 15:50:25 UTC] Attendee_id: 3701 [10-Oct-2017 15:50:25 UTC] Event ID: 3552 [10-Oct-2017 15:50:25 UTC] Order: {"id":3700,"parent_id":0,"status":"pending","currency":"USD","version":"3.1.2","prices_include_tax":false,"date_created":{"date":"2017-10-10 15:50:25.000000","timezone_type":1,"timezone":"+00:00"},"date_modified":{"date":"2017-10-10 15:50:25.000000","timezone_type":1,"timezone":"+00:00"},"discount_total":"0","discount_tax":"0","shipping_total":"0","shipping_tax":"0","cart_tax":"0","total":"24.00","total_tax":"0","customer_id":1,"order_key":"wc_order_59dcec41592c6","billing":{"first_name":"Pete","last_name":"Morelli","company":"SIR Branch 98","address_1":"216 County Down Ct","address_2":"","city":"Roseville","state":"CA","postcode":"95678","country":"US","email":"[email protected]","phone":"9167723257"},"shipping":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":""},"payment_method":"cod","payment_method_title":"Cash on delivery","transaction_id":"","customer_ip_address":"::1","customer_user_agent":"mozilla\/5.0 (windows nt 10.0; win64; x64) applewebkit\/537.36 (khtml, like gecko) chrome\/61.0.3163.100 safari\/537.36","created_via":"checkout","customer_note":"","date_completed":null,"date_paid":null,"cart_hash":"f196827e1d7dbf3bb76669b4a0085613","number":"3700","meta_data":[{"id":5803,"key":"_tribe_tickets_meta","value":{"3560":[{"name-of-attendee":" 56 "}]}}],"line_items":{"44":{}},"tax_lines":[],"shipping_lines":[],"fee_lines":[],"coupon_lines":[]} [10-Oct-2017 15:50:25 UTC] Product ID: 3560So my question is how do I get the event_id/post_id (i.e., 3552 above) given that I only have the order and product_id (respectively 3700 and 3560)?
October 10, 2017 at 11:53 pm #1361926Geoff B.
MemberGood evening Pete,
I am glad we are making progress here.
Just to set expectations before we continue, the scope of our support is mostly to get our customers started on the right track and to help them in case of issues.
We unfortunately do not provide complete support for customization.
With that in mind, let me ask our coding ninjas what they recommend for achieving this.
Hang in there!
Geoff B.
October 11, 2017 at 10:27 pm #1362409Geoff B.
MemberGood evening Pete,
As promised, I asked for a second pair of eyes on this one.
Fair warning, I did not get the answer I was hoping for, but I will still relay it since it is solution-oriented. Perhaps you will find it useful as well.
They could just have the Attendees Report up and use the PDF Tickets extension (possibly also the Duplicate Orders extension to visually help) to print them right there.
The PDF Tickets extension is pending release.
If that’ll take too long (to print each one individually), they could just print ALL the tickets by sending all tickets to a print API like https://developers.google.com/cloud-print/docs/overview (cloud-connect the will call printer) or https://lob.com/ (to print and then mail to the customer)
The obvious downside of this is the wasted printed paper (that you can hopefully recycle).
Let me know if that helps.
Have a great day!
Geoff B.
October 12, 2017 at 8:29 am #1362618Pete
ParticipantGeoff,
Thanks for digging into this deeper than you normally would. I’ll be looking forward to the upcoming release of the PDF Ticket Extension. In the meantime, I have solved this in a not very elegant way by adding the post_id as metadata within the order object. See the below.
/* * Setup to send an email to event organizer when new tickets are generated for an event they are running. * At the same time add meta data to the Ticket object to store the Event_ID which will be used * to get the event organizers email address in function my_get_recipient. * */ add_action( 'event_ticket_woo_attendee_created', 'tribe_woo_compat_cc', 10, 4 ); function tribe_woo_compat_cc ( $attendee_id, $event_id, $order, $product_id ) { $return_value = add_post_meta($order->get_id(), 'post_id', $event_id, true); tribe_tickets_cc_organizer( null, $event_id ); } /* * Filter the get_recipient() function to change the "TO:" email address of tickets that are of payment type 'cod' * These COD tickets will be held at a "Will Call" desk for pickup after payment of fees. */ add_filter( 'woocommerce_email_recipient_wootickets', 'my_get_recipient' , 10, 2); function my_get_recipient($to, $object) { /* * Next line is required as this function is called without paramater data when clicking backend WooCommerce\Settings\Email */ if ($to == '') {return $to;} $order_id =$object->get_id(); $post_id = get_post_meta( $order_id, 'post_id', true) ; $my_to = tribe_get_organizer_email( $post_id, false ); // If there's no valid email for the organizer, use the default will call email! if ( ! is_email( $my_to ) ){ $my_to = '[email protected]';} if ($object->get_payment_method() == 'cod' ) { $to = $my_to; } return $to; }Perhaps this will benefit other users looking to do something similar,
PeteOctober 12, 2017 at 11:34 am #1362832Geoff B.
MemberHey Pete,
This is pretty awesome.
Thank you for sharing!You are welcome back in our support forums any time 🙂
For now, I am going to close this thread.
Have a great week!
Geoff B.
- Adapt the following snippet: https://gist.github.com/cliffordp/4f06f95dbff364242cf54a3b5271b182#file-functions-php
-
AuthorPosts
- The topic ‘Print tickets for pickup at "Will Call" window.’ is closed to new replies.
