• Resolved agonzo12

    (@agonzo12)


    First off, thank you for this brilliant plugin, I just have one request.

    I am administering a few stores that each have their own shop manager and would like to allow them the give their customers store credit for that site only. Currently when a customer receives store credit they are able to use it at any of the other sites in the network as well.

    Thank you!

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

    (@subratamal)

    Hi @agonzo12,

    Please use below code to theme function.php file to seperate balance for each site in WP multisite.

    add_filter('woo_wallet_transactions_query_args', 'woo_wallet_transactions_query_args_callback');
    function woo_wallet_transactions_query_args_callback($args){
        $args['where'] = array(
            array(
                'key' => 'blog_id',
                'value' => $GLOBALS['blog_id']
            )
        );
        return $args;
    }

    Thank you.

    Thread Starter agonzo12

    (@agonzo12)

    Thank you for your response @subratamal,

    When I add this snippet to my functions.php all balances go to zero and aren’t affected by crediting or debiting. For example after a $10 credit it will say “Thank you for using your wallet. $10.00 has been credited to your wallet. Current wallet balance is $0.00”. After removing the snippet all of the transactions take effect on all sites.

    Plugin Author Subrata Mal

    (@subratamal)

    @agonzo12,
    Sorry for delayed response, Please use below updated code.

    add_filter('woo_wallet_transactions_query_args', 'woo_wallet_transactions_query_args_callback');
    
    function woo_wallet_transactions_query_args_callback($args) {
        array_push($args['where'], array(
            'key' => 'blog_id',
            'value' => $GLOBALS['blog_id'])
        );
        return $args;
    }
    Thread Starter agonzo12

    (@agonzo12)

    @subratamal

    Thank you, this works perfectly.

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

The topic ‘Separate balances on multisite’ is closed to new replies.