• Resolved sander105

    (@sander105)


    I’m using this get_rates() function to get the current tax rate from woocommerce, But i get an this error:

    code:

    
    $tax_rate = round( reset( WC_Tax::get_rates() )['rate'] );
    print_r($tax_rate);
    

    error:
    > Only variables should be passed by reference

    What variable should be passsed?

Viewing 1 replies (of 1 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @sander105

    Without seeing your full code it would be difficult to guess, but the error itself means that you are not passing an actual variable. You are passing a function that returns an array.

    Please let us know what exactly you would like to achieve, and also provide us with a link to the code you are using so we can take a closer look. You can add your code to https://gist.github.com

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘woocommerce get standard tax rate’ is closed to new replies.