Public Ticket #3590875

Order approval for subaccounts and payment

Closed
Comments
1 Ticket
Thomas Løvdahl started the conversation 3 years ago on February 22, 2024 at 9:17pm

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

2,762
KingsPlugins replied 3 years ago on February 23, 2024 at 8:44am

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:

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://b2bkingplugin.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

Sign In