• Resolved gmasterpos

    (@gmasterpos)


    please how can i display wallet balance (wallet balance) in my account page is there shortcode to use?

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

    (@subratamal)

    @gmasterpos,

    I am posting this for other users reference as I have already sent you this code via email.

    Please use below code to theme function.php file to create mini wallet shortcode.

    function woo_mini_wallet_callback() {
        if (!function_exists('woo_wallet') || !is_user_logged_in()) {
            return '';
        }
        ob_start();
        $title = __('Current wallet balance', 'woo-wallet');
        $mini_wallet = '<a class="woo-wallet-menu-contents" href="' . esc_url(wc_get_account_endpoint_url(get_option('woocommerce_woo_wallet_endpoint', 'woo-wallet'))) . '" title="' . $title . '">';
        $mini_wallet .= '<span class="woo-wallet-icon-wallet"></span>';
        $mini_wallet .= woo_wallet()->wallet->get_wallet_balance(get_current_user_id());
        $mini_wallet .= '</a>';
        echo $mini_wallet;
        return ob_get_clean();
    }
    add_shortcode('woo-mini-wallet', 'woo_mini_wallet_callback');
Viewing 1 replies (of 1 total)
  • The topic ‘woowallet’ is closed to new replies.