N
N
Never Mind2017-08-04 22:24:44
WordPress
Never Mind, 2017-08-04 22:24:44

How to apply this function correctly? To display data in your Woocommerce account?

There is a site on Woocommerce, you need to withdraw the entire amount spent in the client's personal account. How to apply this function correctly?

* Get total spent by customer.


    function wc_get_customer_total_spent( $user_id ) {
        $customer = new WC_Customer( $user_id );


        return $customer->get_total_spent();
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2017-08-05
@Punkie

echo wc_get_customer_total_spent( get_current_user_id() );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question