• Hi there,

    I would like to hook a custom action on woocommerce_payment_complete but the hook does not fire after a successful payment.

    Any tip?
    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @ezoulou

    Could you share a sample of the code you are using? I will pass it to our developers so we can take a closer look and help you resolve this.

    Looking forward to your response.

    Kind Regards,

    Krystian

    Thread Starter ezoulou

    (@ezoulou)

    Thanks for your quick response.

    Here is the code I use in a plugin :

    // DOES work backend

    add_action('woocommerce_order_status_completed','chronopost_return_check');

    // SHOULD work frontend

    add_action('woocommerce_payment_complete', 'chronopost_return_check');

    function chronopost_return_check($order_id) {

    ...

    }

    Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @ezoulou

    It looks like this might be a bug on our end. The woocommerce_payment_complete hook should work, but in this case, it may not be triggering as expected.

    As a workaround, we recommend using one of the woocommerce_order_status_ hooks, similar to how you’ve implemented it for woocommerce_order_status_completed. If the action needs to occur when the payment is captured, woocommerce_order_status_processing could be a good alternative.

    In the meantime, I will log this issue for our developers so they can investigate and potentially include a fix in an upcoming update.

    Let me know if you have any further questions.

    Kind Regards,

    Krystian

    Thread Starter ezoulou

    (@ezoulou)

    Thanks for your honest answer.

    I already did try alternative hooks like woocommerce_order_status_processing or woocommerce_order_status_completed but without success.
    Will try again and get back to you.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.