WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › get (logged in) users previous order details
Viewing 1 post (of 1 total)
- AuthorPosts
- 12 May, 2015 at 12:19 am #9799
if you need to get some info about a logged in users previous orders you can do/add the following as to where required (as of wppizza 2.11.8.14)
/**add and instanciate the class*/ require_once(WPPIZZA_PATH.'classes/wppizza.user.details.inc.php'); $userdetails=new WPPIZZA_USER_DETAILS(); /*set the user id - in this case "1112" */ $userdetails->setUserId(1112); /*** get details as needed ***/ /*get a total count of all completed orders of this user*/ $ordercount=$userdetails->getUserOrderCount(); /*do something with $ordercount*/ /*get an array of all gateways the user has used when ordering */ $gateways=$userdetails->getUserOrderGateways(); /*do something with $gateways*/ /**get total order value of all orders of this user*/ $total=$userdetails->getUserOrderTotal(); /*do something with $total*/
- AuthorPosts
Viewing 1 post (of 1 total)
- The topic ‘get (logged in) users previous order details’ is closed to new replies.