• Resolved danardf

    (@danardf)


    Hi
    I’d like to know what I can use to do something before woocommerce_order_status_completed

    Indeed, I need to generate a license when the payment is done, and before Woocommerce is sending the email.
    woocommerce_order_status_completed works fine but I generate the license after this event and there is no license in the email after payment.

    What will be the hook to use please?


Viewing 11 replies - 1 through 11 (of 11 total)
  • Stef

    (@serafinnyc)

    Sounds like something isn’t coded right or is conflicting if the license isn’t being sent in the order completed email. Have you customized this at all? How are you attaching the license to the product and is this a virtual product or physical?

    Thread Starter danardf

    (@danardf)

    I added my custom php code in my plugin.

    add_action( 'woocommerce_order_status_completed', 'add_license', 1);

    Calling add_license when triggered, that’s it.

    Thread Starter danardf

    (@danardf)

    Anyway, the goal is to generate the license only if the customer paid it. So, when the ordring is completed.

    Thread Starter danardf

    (@danardf)

    For your information, I don’t use any WP plugins to generate it. I coded it.

    Stef

    (@serafinnyc)

    So any custom coding is not supported in this forum. You are better off posting that in StackExchange or something like that. However, that being said, why wouldn’t you simply use the download ability to send the license thru that. I’m not sure what the license is, a jpg, a pdf what have you, but again not sure why you’re custom coding this when it’s pretty much built in already.

    Thread Starter danardf

    (@danardf)

    I’ve got my reason, The license is customized. So….
    However, I tried to use WP licenses, but it’s not the good one for my projects.

    • This reply was modified 7 months ago by danardf.
    Thread Starter danardf

    (@danardf)

    Anyway, whatever the methode to call, license or not. I just need to do something just before the ordering is completed or the product is paid.

    • This reply was modified 7 months ago by danardf.
    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hello @danardf,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter danardf

    (@danardf)

    Thanks for your reply.

    I think to send the invoice again with the license, because so far, the license is not present for the last one.
    That will be enough I think
    The goal is to include this information by email.

    I will test it, but I think that should be good.

    Thread Starter danardf

    (@danardf)

    I will let you know.

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hello @danardf,

    This sounds like a plan.

    I’ll mark this thread as resolved now. If you have any further questions, feel free to reach out.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Do something before woocommerce_order_status_completed’ is closed to new replies.