How to get order total in my payment method

I am trying to add a custom payment method to my wordpress project. In my plugin within the process_payment function i used this code for getting cart total amount.

$cart_tot=$woocommerce->cart->get_cart_total();

This out put the total as follows at the mysql.

<span class="amount">&pound;250</span>

But i want to get the integer value only. Is this possible? If so how to do this?

Answers


$woocommerce->cart->cart_contents_total

use

  global $woocommerce;

and then you can get the content with

  $woocommerce->cart->cart_contents_total

Need Your Help

Generate random integers from /dev/random

r random

This is not homework. I would like to generate a random integer sequence (50 digits between 0:9) from /dev/random in R. I have a hardware entropy key.

Inserting date into MySQL database using a PreparedStatement

java jdbc prepared-statement

I want to update the string date into MySQL database using prepared statement. I have tried a lot and always got error java.util.Date cannot parse into java.sql.Date or vise versa. I didn't import