• Resolved minovec

    (@minovec)


    Hello,
    I love your plugin, very good work!

    I’d like to ask you, is any change to help me? I need to debit customer money from his wallet after order checkout imediattely (regardless of the order status) – I didn’t allow order change in customer account page.

    Thank you very much

    Milan from Czechia

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    Hi @minovec,

    Thanks for reaching out to our support forum. Is that you want to debit amount from customer wallet for partial payment?

    Thank and Regards,
    Subrata Mal

    Thread Starter minovec

    (@minovec)

    yes, it is

    Regards
    Milan

    Plugin Author Subrata Mal

    (@subratamal)

    @minovec,

    Please use below code snippet to themes function.php file.

    add_action('woocommerce_checkout_order_processed', 'process_woo_wallet_partial_payment', 40, 1);
    
    function process_woo_wallet_partial_payment($order_id) {
        $order = wc_get_order($order_id);
        if (get_post_meta($order_id, '_via_wallet_payment', true) && !get_post_meta($order_id, '_partial_pay_through_wallet_compleate', true)) {
            $transaction_id = woo_wallet()->wallet->debit($order->get_customer_id(), get_post_meta($order_id, '_via_wallet_payment', true), __('For order payment #', 'woo-wallet') . $order->get_id());
            if ($transaction_id) {
                $order->add_order_note(sprintf(__('%s paid through wallet', 'woo-wallet'), wc_price(get_post_meta($order_id, '_via_wallet_payment', true))));
                update_wallet_transaction_meta($transaction_id, '_partial_payment', true, $order->get_id());
                update_post_meta($order_id, '_partial_pay_through_wallet_compleate', $transaction_id);
            }
        }
    }

    Thanks and Regards,
    Subrata Mal

    Thread Starter minovec

    (@minovec)

    Thank you so much

    Regards

    Milan

    Plugin Author Subrata Mal

    (@subratamal)

    @minovec,

    Could you please consider posting a review of our plugin? In addition to providing feedback, reviews can help other users to know who we are and what our plugin does.

    Cheers!!!

    Thread Starter minovec

    (@minovec)

    Hello again,

    other one issue is there.

    If customer has enough abount in his waller, and he did checkout, order status was set to payd, what is ok, but total amount has not been increase
    (

    WC_Order Object
    (
        [status_transition:protected] => 
        [data:protected] => Array
            (
                [parent_id] => 0
                [status] => payd
                [currency] => CZK
                [total] => 452.40
                ....

    )

    When customer processed payment from wallet as partial payment, that total was increased.

    • This reply was modified 8 years ago by minovec.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Debit after checkout immediately’ is closed to new replies.