• Resolved valehero

    (@valehero)


    How can I get user credits (only the amount in digits) without the HTML code?

    I tried this:
    woo_wallet()->wallet->credit($user_id, $amount, $details);

    But it outputs:
    <span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>23.71</span>

    I need it to output: 23.71

    How can I do that?

    Thank you for helping.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter valehero

    (@valehero)

    UPDATE: I tried:

    $credits = woo_wallet()->wallet->get_wallet_balance($user_id);
    echo $credits;

    to get the HTML output above.

    Plugin Author Subrata Mal

    (@subratamal)

    Use woo_wallet()->wallet->get_wallet_balance($user_id, 'edit');

    Thread Starter valehero

    (@valehero)

    Exactly what I needed.

    Adding the 'edit' did the trick.
    Thank you so much.

    Plugin Author Subrata Mal

    (@subratamal)

    Great! Could you please do me a BIG favour and give it a 5-star rating to help us spread the word and boost our motivation?

    • This reply was modified 5 years, 9 months ago by Subrata Mal.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to get user credits without HTML?’ is closed to new replies.