Created
June 8, 2021 01:04
-
-
Save sibelius/2ef1113f18be041f6b986a77ff81b934 to your computer and use it in GitHub Desktop.
save get amount in cents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function get_amount($total) | |
{ | |
return absint( | |
wc_format_decimal((float) $total * 100, wc_get_price_decimals()) | |
); // In cents. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment