Comments Thomas Løvdahl started the conversationFebruary 22, 2024 at 9:17pmHello!Regarding order approval of order placed by subaccount.Is it possible to automatically pay the order using the only payment method (invoice) when the order is approved by the main account?Thomas 2,217WebWizards repliedFebruary 23, 2024 at 8:44amHi Thomas,Thank you for purchasing our plugin,I understand you'd like that when the Approve button is clicked, that should also automatically pay for the order, to avoid an unnecessary step.We could achieve something similar to that, by replicating the effects of the invoice gateway.You could add the following PHP code snippet to the site to achieve it: add_action('b2bking_after_approve_order', function($order){ $order->update_status( 'on-hold', esc_html__( 'Awaiting invoice payment.', 'b2bking' ) ); }, 10, 1); A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/It will set the order to the "on hold" status, similar to how the invoice gateway works.Please let me know if that can solve it for you,Kind regards,StefanThomas Løvdahl repliedFebruary 23, 2024 at 9:54amThank you, this worked perfectly :) 2,217WebWizards repliedFebruary 23, 2024 at 10:11amGlad to hear that : ) If there's anything else I can help with, please let me know. Also, if you have a minute, I would really appreciate it if you considered leaving a quick rating for the plugin - it's a big help to us. Sign in to reply ...
Hello!
Regarding order approval of order placed by subaccount.
Is it possible to automatically pay the order using the only payment method (invoice) when the order is approved by the main account?
Thomas
Hi Thomas,
Thank you for purchasing our plugin,
I understand you'd like that when the Approve button is clicked, that should also automatically pay for the order, to avoid an unnecessary step.
We could achieve something similar to that, by replicating the effects of the invoice gateway.
You could add the following PHP code snippet to the site to achieve it:
A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
It will set the order to the "on hold" status, similar to how the invoice gateway works.
Please let me know if that can solve it for you,
Kind regards,
Stefan
Thank you, this worked perfectly :)
Glad to hear that : ) If there's anything else I can help with, please let me know.
Also, if you have a minute, I would really appreciate it if you considered leaving a quick rating for the plugin - it's a big help to us.