• Resolved ifelixfix

    (@ifelixfix)


    Hello
    I wish to send funds vendors automatically after a number of days after the delivery is marked as “ship”.

    Because your “Withdrawal Locking Period” option only allows automatic sending after the order has been placed by a customer. I would like it to be sent after the seller indicates that the order is send.

    Is it possible ?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Same need for me.

    @ifelixfix @matthieuh Yes, its possible. using the follows action hook, you have to call process payment for related order commission –
    do_action( 'wcmp_vendors_vendor_ship', $order_id, $vendor_term_id );

    Thread Starter ifelixfix

    (@ifelixfix)

    Sorry, i’m new in wordpress, but where do i paste the action hook ?

    @ifelixfix @matthieuh add follows code snippet in your active theme’s functions.php –

    function pay_vendor_after_shipped( $order_id, $vendor_term_id ) {
        global $WCMp;
        $commissions = ( get_post_meta( $order_id, '_commission_ids', true ) ) ? get_post_meta( $order_id, '_commission_ids', true ) : array();
        $commissions_processed = get_post_meta( $order_id, '_commissions_processed', true );
        if ( $commissions_processed == 'yes' && $commissions ){
            $vendor = get_wcmp_vendor_by_term( $vendor_term_id );
            $payment_method = get_user_meta( $vendor->id, '_vendor_payment_mode', true );
            if ( $payment_method && $payment_method != 'direct_bank' ) {
                if ( array_key_exists( $payment_method, $WCMp->payment_gateway->payment_gateways ) ) {
                    $WCMp->payment_gateway->payment_gateways[$payment_method]->process_payment( $vendor, $commissions );
                }
            }
        }
    }
    add_action( 'wcmp_vendors_vendor_ship', 'pay_vendor_after_shipped', 99, 2 );
    Thread Starter ifelixfix

    (@ifelixfix)

    Ok I’ll try and come back to you for the result, thanks

    Thread Starter ifelixfix

    (@ifelixfix)

    Sorry,
    I’m coming back to you because the code you gave me doesn’t work. When I do a test of an order, the seller receives his commission even if he didn’t ship the product. Can you help me please ? Thank you

    @ifelixfix can you tell me which payment method are you using. Please double check that your Commission Disbursement is enabled or not and if you are using any instant split payments modules for vendor or not.

    Thread Starter ifelixfix

    (@ifelixfix)

    I only use Stripe as a payment method for the whole site: for the customers and for my sellers. (No paypal or other). The commission disbursement is activated. And I don’t use Stripe Split Payment, because Because I don’t want the sellers’ commission to be unblocked directly to the order, but only after they mention that the order has been shipped

    @ifelixfix, can you please get in touch with us over our forum, so we can help you out: https://wc-marketplace.com/support-forum

    Looking forward to your co-operation regarding the same.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Withdrawal Vendor after shipping’ is closed to new replies.