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

    (@subratamal)

    @jadolyo You can use the WooCommerce filter to automatically complete an order.

    woocommerce_payment_complete_order_status

    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    @subratamal hello

    You mean in the plugin code I need to add that line?

    Plugin Author Subrata Mal

    (@subratamal)

    @jadolyo Add this code in the theme functions.php file.

    add_filter('woocommerce_payment_complete_order_status', 'woocommerce_payment_complete_order_status_callback', 10, 1);
    if(!function_exists('woocommerce_payment_complete_order_status_callback')) {
    	function woocommerce_payment_complete_order_status_callback($status) {
    		$status = 'completed';
    		return $status;
    	}
    }
    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    Hello @subratamal

    Thank you for your support, This code will work with Tera wallet only or all payment methods?

    All payments plugins are working fine, I need it with Tera wallet only.

    Plugin Author Subrata Mal

    (@subratamal)

    @jadolyo Please use the attached updated code.

    add_filter('woocommerce_payment_complete_order_status', 'woocommerce_payment_complete_order_status_callback', 10, 2);
    if(!function_exists('woocommerce_payment_complete_order_status_callback')) {
    	function woocommerce_payment_complete_order_status_callback($status, $order_id) {
            $order = wc_get_order($order_id);
            if('wallet' === $order->get_payment_method('edit')){
    		    $status = 'completed';
            }
    		return $status;
    	}
    }
    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    Hi @subratamal

    Thank you very much for your updated code, It’s working fine.

    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    Hi @subratamal

    another question.

    Is it working with all products or virtual products only? I need it with virtual only.

    Plugin Author Subrata Mal

    (@subratamal)

    @jadolyo It will work for all product types.

    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    Hi @subratamal

    Okay, Thank you for your great support.

    mdzubair2022

    (@mdzubair2022)

    hi,
    I am using terrawallet for a few months I want to make some custom settings for users like:

    1. when user completes payment for wallet top-up I want their orders will be completed automatically,but orders with wallet balance will go to processing order status.

    2. i want to add cashback of tk 50 when the user topup 1000 or more

    please help me I am waiting for your reply.

    Thread Starter Ahmed Jadelrab

    (@jadolyo)

    Hi @mdzubair2022

    If you are planning to use the multi-currency system on your website I advise you to not rely on Terawallet, It doesn’t support multi-currency and you will have too many issues with your customers if they add funds to your website when you add another currency.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Need completed status when it’s virtual product’ is closed to new replies.