Double Tickets Being Sent

Home Forums Ticket Products Event Tickets Plus Double Tickets Being Sent

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1150286
    wineschool
    Participant

    Since the last update of Event Tickets 4.2.3 (not pro) the system has been sending double the amount of tickets the customer is purchasing. Help!

    #1150321
    wineschool
    Participant

    This reply is private.

    #1150383
    Geoff B.
    Member

    Good evening Keith and welcome back!

    Thank you for reaching out to us and for the system information.

    We are sorry to hear about the tickets being sent multiple times to your customer. Yikes!
    I would love to help you with this topic.

    Could you please send me a copy of your Divi child theme in a .zip file link (via Dropbox or Google Drive) so that I can run some tests on my end ?

    Additionally, since this not a systematic occurence, would you mind sharing some additional information on these 3 events:

    1. On these dates, was that the case for all customers or just 1 ?
    2. Is there anything in common between these customers ? (same product, payment gateway, similar tickets)

    Best regards,

    Geoff B.

    #1151189
    wineschool
    Participant

    Geoff,

    I checked the times and dates of the orders, and there were other orders on those days. This is definitely not systematic.

    I have been looking through these orders, and I did find something that they had in common. Each of these three ticket orders had a validation error from Paypal.

    From Woocommerce:

    Validation error: PayPal IPN response from a different email address (******@********.com). Order status changed from Processing to On Hold.

    The error didn’t stop the orders from being process, but is this the possible culprit?

    #1151202
    Geoff B.
    Member

    Good evening Keith,

    It looks like you might be on to something.

    Here’s what I suggest:

    1. This type of error usually suggests that there is an issue either with your WooCommerce Paypal gateway setting OR that the email you have on file there does not / no longer matches the one found in your actual Paypal account. I would make sure that all is good on that end.
    2. Could you please send me a copy of your WordPress theme / child theme in a .zip file link (via Dropbox or Google Drive) so that I can run some tests on my end ? I suspect there is some kind of snippet in there that tries to turn the ticket orders to “Complete” automatically. The reason I bring this up is because tickets are not sent until the order status is “Complete”.

    Hang in there and have a good week-end,

    Geoff B.

    #1152899
    wineschool
    Participant

    I’ll send the files if you still want, but I think I found the culprit. I
    have been auto-completing all woocommerce orders with a snippet in my
    functions.php file. Should I remove it or edit it?

    /**
    * Auto Complete all WooCommerce orders.
    */
    add_action( ‘woocommerce_thankyou’,
    ‘custom_woocommerce_auto_complete_order’ );
    function custom_woocommerce_auto_complete_order( $order_id ) {
    if ( ! $order_id ) {
    return;
    }

    $order = wc_get_order( $order_id );
    $order->update_status( ‘completed’ );
    }

    #1152949
    Geoff B.
    Member

    Good evening Keith,

    Kudos on finding the most likely culprit.

    What you choose to do with the snippet is really up to you.
    When the payments don’t fail, it should work fine.

    But it is not the most robust solution.

    Perhaps you could add a conditional to that snippet so that it only triggers after the PayPal Payment has in fact been validated.

    I bumped into this article which has a similar approach to this: https://www.skyverge.com/blog/how-to-set-woocommerce-virtual-order-status-to-complete-after-payment/

    I believe that should get you started on the right track to tweak the snippet.

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1154609
    wineschool
    Participant

    Here is my current solution. I am listing it here for other users. Instead of forcing the sale to complete, I have changed my tickets (and all products) to be virtual and downloadable by default.

    The upside of this is to let woocommerce complete the orders automatically. This seems to fix the paypal issue. I don’t know why, but so far it is working well.

    To do this, I put the following snippet in the theme’s functions.php file:

    function cs_wc_product_type_options( $product_type_options ) {
    $product_type_options[‘virtual’][‘default’] = ‘yes’;
    $product_type_options[‘downloadable’][‘default’] = ‘yes’;
    return $product_type_options;
    }
    add_filter( ‘product_type_options’, ‘cs_wc_product_type_options’ );

    This is the simplest solution, and I hope the most robust.

    #1155214
    Geoff B.
    Member

    Good evening Keith,

    This is great. Thank you again for sharing.

    I am glad this seems to fix the Paypal issue.
    To be fully transparent, I am not exactly sure why you had the issue in the first place.

    But it seems likely that the initial snippet caused the order to temporarily go to “complete” (which triggered the ticket email). The failed Paypal transaction the reverted the order status to a different status. In turn, the original snippet kicked in again, which resent the ticket as the order was set to “complete” for a second time.

    So, in my humble opinion, the safest approach would be to ensure that payment is complete prior to firing the “Auto Complete” snippet.

    But, as with all things, there are many ways to do things.
    The important part is that it works! 🙂

    For now, I am going to close this thread, but you are welcome in our forums any time.

    Cheers,

    Geoff B.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Double Tickets Being Sent’ is closed to new replies.