• Resolved maddie121

    (@maddie121)


    Hi all,

    I am trying to use the cashback feature of the TeraWallet plugin together with WCMp plugin, but I am having a big issue. The cashback triggers both for the parent order and the suborders which means that it doubles the cashback amount that users get. The correct behaviour would be for the cashback to trigger only for the Parent order. The suborders are a feature designed by WCMp plugin which creates suborders for vendors so they can see what orders they got.

    I’ve seen that Woo wallet supports WC marketplace, is there a code that I can use to block the cashback for the suborders only?

    Many thanks

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

    (@subratamal)

    @maddie121 Thanks for reporting this issue. We will fix this in our next update. For now, you can use the bellow code in the theme functions.php file to fix this.

    add_filter('process_woo_wallet_general_cashback', 'process_woo_wallet_general_cashback_callback', 10, 2);
    if (!function_exists('process_woo_wallet_general_cashback_callback')) {
        /**
         * 
         * @param Bool $process_cashback
         * @param WC_Order $order
         * @return boolean
         */
        function process_woo_wallet_general_cashback_callback($process_cashback, $order) {
            if ($order->get_parent_id('edit')) {
                return false;
            }
            return $process_cashback;
        }
    
    }
    Thread Starter maddie121

    (@maddie121)

    That’s great, thank you for the fast response. Much appreciated!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cashback incompatible with WCMp’ is closed to new replies.