• Resolved 3p1demicz

    (@3p1demicz)


    Hello,

    I would like to use the PHP function to output only the number without the currency symbol.
    Can you help me please?

    When I use the alg_wc_get_left_to_free_shipping( “%amount_left_for_free_shipping% ” );
    It always outpusts “currency symbol” “numnber” or “number” “currency symbol” depending on the woocommerce settings, probably.

    I need it to output only the number.

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @3p1demicz,

    I will have to add this to the plugin, should be easy to do… Meanwhile you can use a workaround, something like this:

    
    $raw_amount = str_replace( '€', '', strip_tags( alg_wc_get_left_to_free_shipping( '%amount_left_for_free_shipping%' ) ) );
    

    You need to replace € with your currency symbol.

    Hope that helps and please let me know if you have any questions.

    • This reply was modified 4 years, 10 months ago by Algoritmika.
    • This reply was modified 4 years, 10 months ago by Algoritmika.
    • This reply was modified 4 years, 10 months ago by Algoritmika.
    Plugin Author Algoritmika

    (@algoritmika)

    Hi again, @3p1demicz,

    As promised, we’ve just released new plugin v1.3.1, where I’ve added “raw” placeholders for each amount. So now to get just the amount left to free shipping without currency symbol etc., you need to use %amount_left_for_free_shipping_raw%, for example (you may also want to round it):

    
    $raw_amount = round( alg_wc_get_left_to_free_shipping( '%amount_left_for_free_shipping_raw%' ), 2 );
    

    Please let me know if something is not working as expected. And if you like the plugin, please consider leaving me a rating.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP function to show without currency symbol’ is closed to new replies.