• Resolved scoobynko

    (@scoobynko)


    Hi,

    I have my own widget in functions.php to calculate how much need to be spend to get free shipping in mini cart.

    I want to calculate this in two currencies – your shortcode work very well, but:

    1. php function (alg_convert_price) get me only html code ??
    2. I need only number for calculate
    3. I need after that number and currency (to style my own result)

    Its posibble to do something like this?

    Thank you very much.

    • This topic was modified 6 years, 8 months ago by scoobynko.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,
    Sorry for the delay.

    alg_convert_price() accepts some arguments. If you use ‘format_price’ as no you can get the number as you want. e.g

    alg_convert_price( array(
    'format_price'=>'no'
    ) );

    I don’t know if I got exactly your last question, but if you just want to format the final result you can use the function provided by WooCommerce itself, like:

    wc_price( $price, array( 'currency' => 'USD' ) );

    Thread Starter scoobynko

    (@scoobynko)

    Thank you I figure out same solution ??

    ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get only number from shortcode’ is closed to new replies.