Get (logged in) users previous order details
Gettings ome info about a logged in users previous orders programatically
the ‘wp’ action hooks is only for demonstration purposes. you will probably want to use another action or filter hook as required
/* change wp hook to whatever is appropriate */
add_action('wp', 'my_custom_loggedin_customer');
function my_custom_loggedin_customer(){
if( is_user_logged_in()){
$user_id = get_current_user_id();
$user_data = WPPIZZA()->db->get_customers($user_id);
/* do something with $user_data['results_set'] */
}
}