• Resolved brothersvapes

    (@brothersvapes)


    Good day,

    I was wondering if there is a way (via shortcode or other) to display only the wallet balance? I don’t want the entire widget as it appears in the Account page.

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

    (@subratamal)

    @brothersvapes,

    You can use woo_wallet()->wallet->get_wallet_balance(get_current_user_id()) function to display current user wallet balance.

    Thanks and Regards,
    Subrata Mal

    Thread Starter brothersvapes

    (@brothersvapes)

    Unfortunately I can not get that code to work. Any other suggestions? Perhaps a shortcode derivative?

    Plugin Author Subrata Mal

    (@subratamal)

    function woo_wallet_balance_callback($atts) {
        $atts = shortcode_atts(array(
            'id' => get_current_user_id()
                ), $atts, 'woo-wallet-balance');
        ob_start();
        echo woo_wallet()->wallet->get_wallet_balance($atts['id']);
        return ob_get_clean();
    }
    
    add_shortcode('woo-wallet-balance', 'woo_wallet_balance_callback');

    Thanks and Regards,
    Subrata Mal

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

The topic ‘Balance shortcode’ is closed to new replies.