woocommerce_account_orders

My Account > Orders template.

Description

woocommerce_account_orders( (int) $current_page ); 

Parameters (1)

0. $current_page (int)
Current page number.

Usage

  1. if ( !function_exists( 'woocommerce_account_orders' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4. // Current page number. 
  5. $current_page = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = woocommerce_account_orders($current_page); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-template-functions.php  
  1. function woocommerce_account_orders( $current_page ) { 
  2. $current_page = empty( $current_page ) ? 1 : absint( $current_page ); 
  3. $customer_orders = wc_get_orders( apply_filters( 'woocommerce_my_account_my_orders_query', array( 'customer' => get_current_user_id(), 'page' => $current_page, 'paginate' => true ) ) ); 
  4.  
  5. 'myaccount/orders.php',  
  6. array( 
  7. 'current_page' => absint( $current_page ),  
  8. 'customer_orders' => $customer_orders,  
  9. 'has_orders' => 0 < $customer_orders->total,  
  10. );