empty security code when auto complete order

Home Forums Ticket Products Event Tickets Plus empty security code when auto complete order

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #999760
    mpinkster
    Participant

    We have used your system for some time with no problems. But now we updated the site for the new event. Also updated wordpress to latest and your plugins also. Since the new updates we have the following issue:

    We use the following code to autocomplete orders when success page shown:
    /**
    * 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’ );
    }

    This works, tickets are send as they used to be before updates.
    However the securitycode is not present in the ticket mail. Also when printing the array object we see no security_code.

    Array ( [event_id] => 5550 [ticket_name] => Azelo Live Earlybird [holder_name] => Mark Pinkster [order_id] => 5615 [ticket_id] => 5616 [security_code] => )

    When we open the order now and trigger the tickets status. The ticket mail is resend and now with security code present.
    Also when not autocomplete but in woocommerce click the complete button in orders list the tickets are complete send.

    Can anyone tell me whats going wrong here?

    • This topic was modified 8 years, 8 months ago by mpinkster.
    • This topic was modified 8 years, 8 months ago by Geoff.
    • This topic was modified 8 years, 7 months ago by George.
    #999934
    Geoff
    Member

    Hi @mpinkster! Thanks for reaching out and sorry for the trouble here with the ticket emails.

    Just to make sure I understand: is it the ticket email where you’re seeing issues or the order confirmation/receipt? I’d be interested in seeing a screenshot of the email(s) if you are able to share that with me.

    Oh, and one more thing: you mentioned updating WordPress, The Events Calendar, WooCommerce Tickets and WooCommerce Tickets. Will you please let me know what versions of those you were running before and what version numbers they are all running now? Just want to get a sense of what combination worked for you before and what combination is not working.

    Thanks!
    Geoff

    #999939
    mpinkster
    Participant

    This reply is private.

    #999951
    Geoff
    Member

    Thanks for the extra info, Mark! I really appreciate it.

    Where was the security code coming from prior to the update? I’m pretty sure that wasn’t part of WooCommerce Tickets 3.9.3 so I’m wondering if WooCommerce or another plugin was providing that.

    If so, I would also wonder whether that plugin has changed since the latest updates. Both WooCommerce and The Events Calendar/WooCommerce Tickets updates were significant and it’s very possible that any custom function your were using or that was being provided by another plugin is no longer compatible with the latest version of the plugins.

    Let me know how you were getting the security code in the ticket email and we can go from there.

    Thanks!
    Geoff

    #999965
    mpinkster
    Participant

    Hi Geoff,

    The security code was always provided by Woocommerce Tickets. I however use the provided ticket number by Woocommerce Tickets in a img tag with barcode.php as follows:

    <img style="border: 1px solid #666;" src="http://www.xxxxxxxxx.xx/barcode.php?barcode=<?php echo $ticket['security_code']; ?>&width=220&height=50"></td>

    Here the variable $ticket[‘security_code’]; is empty on auto proces. The manual proces this one is populated with the according code generated by Woocomerce Tickets.

    I only override the email.php file at file at [your-theme]/tribe-events/tickets/email.php
    The only changes I made to that is css styling and the use of the security code to set a barcode image representing the generated ticket security code. The code was always present in all versions we used.

    When using the original file from your script this missing code is also happening. On manual process we see the number, on auto process this one is missing.

    • This reply was modified 8 years, 8 months ago by mpinkster.
    • This reply was modified 8 years, 8 months ago by mpinkster.
    #1000124
    Geoff
    Member

    Hi @mpinkster and thanks for following up!

    I guess where I’m not quite following is where the barcode image being generated came from. The security number itself has been a part of WooCommerce tickets, but the use of a barcode image has not and that is where I wonder if the disconnection is coming from. Are you able to clarify that a little more for me?

    Thanks for your help!

    Geoff

    #1000130
    mpinkster
    Participant

    Hi Geoff,

    The barcode image is created on the fly by a php script which is called from the src attribute on the image tag. I send the security code to that script as a query parameter by echoing it in the src string on that image tag.

    It is absolutely not a plugin for wordpress or woocomnmerce. Every time the ticket is shown this image request to that barcode.php script creates the image on the fly.

    Hope this clears up your questionmarks 🙂

    The problem is the missing codevalue from woocommerce tickets core.

    Regards
    Mark

    #1000516
    Geoff
    Member

    Ah, that’s MUCH clearer–thanks for that–and cool customization. 🙂

    Are you able to share your email template code with us in a gist? We did update a number of functions between 3.9 and 3.10 and I want to make sure your custom email template in the tribe-events folder of your theme isn’t still calling them in 3.11.

    Thanks again!
    Geoff

    #1000533
    mpinkster
    Participant

    Hi Geoff,

    Thanks for the compliment 🙂

    Is it better for you to have ftp access to the site and a admin login?
    It’s in test environment so perhaps a better solution? Because the problem exists also when using the core email.php template.

    Regards,
    Mark

    • This reply was modified 8 years, 7 months ago by mpinkster.
    #1000614
    Geoff
    Member

    Good question! I unfortunately cannot log in to any part of your site or server, per our terms. But if you’re able to share the code as Gists on Github, that would give me a chance to look things over.

    In the meantime, here are the overviews of everything that changed in recent releases since the last version you had installed (3.9):

    I’ll help you check for deprecated instances in your templates if you’re able to share the code, but thought you might at least appreciate having the changelogs in case you are able to spot something as well.

    By the way, we are in the middle of taking volunteers for testing a new feature that includes QR codes in ticket emails. Please sign up if you’re interested–you seem to be a prime candidate for helping us test given your custom barcode. 🙂

    Geoff

    #1000662
    mpinkster
    Participant

    This reply is private.

    #1000946
    George
    Participant

    Hey Mark,

    I’m helping take a look at things and have some ideas related to these issues on your site. Before exploring those ideas, however, I’m curious if you can first run a test here that I think will be very useful:

    Can you just temporarily remove your custom auto-completing function for WooCommerce, then one you mentioned in your very first post for this thread? The more specific procedure I have in mind here is this:

    1. Keep a var_dump() of the array in your email template, so we can see the output of $ticket and look for $ticket[‘security_code’]

    2. Remove (just temporarily, for testing!) your custom auto-complete function for WooCommerce.

    3. Do a test purchase of some tickets – some free tickets, whatever – and then manually “complete” the order in the WooCommerce “Orders” screen of your wp-admin.

    4. Check them email that is sent after doing this manual order completion – is the security code present in this email at all?

    This is a useful test to run through. Let us know what you find!

    And also, just quickly before wrapping up my post: thanks for your patience with this thread 🙂 This issue is interesting, but it’s also a bit complex because there are a few moving parts here that could be causing the lack of security code. Thanks for working with us and being polite and such thus far, hopefully we can iron this out!

    Cheers,
    George

    #1001196
    mpinkster
    Participant

    This reply is private.

    • This reply was modified 8 years, 7 months ago by mpinkster.
    #1001577
    George
    Participant

    Hey Mark,

    Thanks for testing this out! It seems that we’ve at least now isolated the issue to the auto-completion code itself.

    I’m aware that this is a snippet that is found on the WooCommerce site itself, so it’s not necessarily “bad” or “broken” code, but I’m trying to figure out exactly why it’s preventing the security code from being generated.

    I have one idea which relies on the the third argument of the very update_order() method you’re using already. Basically, in your custom code where you have this:


    $order->update_status( 'completed' );

    Change it to this and run the same tests to see if the security code is genereated:


    $order->update_status( 'completed', '', true );

    This will change the $manual argument, the third one, from its default state of “false” to “true”. Let us know what you find by doing this!

    Thank you,
    George

    #1001608
    George
    Participant

    Sorry Mark, I actually don’t think my above solution will help here at all – sorry about the mixup!

    It’s still true that we’ve at least boiled down the source of things to be the auto-completion of orders. I’m just not sure why this is causing things to break.

    I’m going to reach out to some of our awesome developers and see if they can weigh in, here. Stay tuned!

Viewing 15 posts - 1 through 15 (of 21 total)
  • The topic ‘empty security code when auto complete order’ is closed to new replies.