Order loop
For loop type woo_order
, here are the available query arguments and fields.
Query arguments
-
billing_address_1
- Billing address 1Type: string
-
billing_address_2
- Billing address 2Type: string
-
billing_city
- Billing cityType: string
-
billing_company
- Billing companyType: string
-
billing_country
- Billing countryType: string
-
billing_email
- Billing emailType: string
-
billing_first_name
- Billing first nameType: string
-
billing_last_name
- Billing last nameType: string
-
billing_phone
- Billing phoneType: string
-
billing_postcode
- Billing postcodeType: string
-
billing_state
- Billing stateType: string
-
cart_tax
- Cart taxType: number
-
count
- Limit number of results, or -1 for allType: number
-
currency
- Currency used in orderType: string
-
customer_id
- User IDType: number, string
-
discount_tax
- Discount taxType: number
-
discount_total
- Total discountType: number
-
exclude
- Exclude product ID(s)Type: array
-
order
- OrderDefault:
desc
Type: string -
order_id
- Order ID(s)Type: number, array
-
orderby
- Order by fieldDefault:
name
Type: string -
parent
- Parent product ID(s)Type: number
-
parent_exclude
- Exclude parent product ID(s)Type: array
-
payment_method
- Slug of payment method usedType: string
-
payment_method_title
- Full title of payment method usedType: string
-
prices_include_tax
- Prices include taxType: string
-
shipping_address_1
- Shipping address 1Type: string
-
shipping_address_2
- Shipping address 2Type: string
-
shipping_city
- Shipping cityType: string
-
shipping_company
- Shipping companyType: string
-
shipping_country
- Shipping countryType: string
-
shipping_email
- Shipping emailType: string
-
shipping_first_name
- Shipping first nameType: string
-
shipping_last_name
- Shipping last nameType: string
-
shipping_phone
- Shipping phoneType: string
-
shipping_postcode
- Shipping postcodeType: string
-
shipping_state
- Shipping stateType: string
-
shipping_tax
- Shipping taxType: number
-
shipping_total
- Shipping totalType: number
-
status
- StatusDefault:
completed
Type: string -
total
- Order totalType: number
-
type
- Order TypesDefault:
shop_order
Type: string -
user
- User ID, name, or "current"Type: number, string, array
Fields
-
billing_address_1
- Billing address 1
-
billing_address_2
- Billing address 2
-
billing_city
- Billing city
-
billing_company
- Billing company
-
billing_country
- Billing country
-
billing_email
- Billing email
-
billing_first_name
- Billing first name
-
billing_last_name
- Billing last name
-
billing_phone
- Billing phone
-
billing_postcode
- Billing postcode
-
billing_state
- Billing state
-
cancel_endpoint
- Helper method to return the cancel endpoint
-
cancel_order_url
- Generates a URL so that a customer can cancel their (unpaid - pending) order
-
cart_hash
- Get cart hash
-
cart_tax
- Gets cart tax amount
-
checkout_order_received_url
- Generates a URL for the thanks page (order received)
-
checkout_payment_url
- Generates a URL so that a customer can pay for their (unpaid - pending) order. Pass "true" for the checkout version which does not offer gateway choices
-
created_via
- Get created via
-
currency
- Gets order currency
-
customer_id
- Customer ID
-
customer_ip_address
- Get customer ip address
-
customer_note
- Get customer note
-
customer_user_agent
- Get customer user agent
-
date_completed
- Date completed
-
date_created
- Date created
-
date_modified
- Date modified
-
date_paid
- Date paid
-
discount_tax
- Get discount_tax
-
discount_to_display
- Get the discount amount (formatted)
-
discount_total
- Get discount_total
-
formatted_billing_address
- Get a formatted billing address for the order
-
formatted_billing_full_name
- Get a formatted billing full name
-
formatted_order_total
- Gets order total - formatted for display
-
formatted_shipping_address
- Get a formatted shipping address for the order
-
formatted_shipping_full_name
- Get a formatted shipping full name
-
has_billing_address
- Returns true if the order has a billing address
-
has_free_item
- Returns true if the order contains a free product
-
has_shipping_address
- Returns true if the order has a shipping address
-
id
- ID
-
is_paid
- Returns if an order has been paid for based on the order status
-
item_count
- Gets the count of order items of a certain type
-
item_count_refunded
- Gets the count of order items of a certain type that have been refunded
-
items
- Return an OrderItem Loop of items within this order
-
needs_payment
- Checks if an order needs payment, based on status and order total
-
needs_processing
- See if the order needs processing before it can be completed
-
order_item_totals
- Get totals for display on pages and in emails
-
order_key
- Get order key
-
order_number
- Gets the order number for display (by default, order ID)
-
payment_method
- Gets the payment method
-
payment_method_title
- Get payment method title
-
prices_include_tax
- Gets prices including tax
-
refunds
- Get order refunds
-
remaining_refund_amount
- How much money is left to refund
-
remaining_refund_items
- How many items are left to refund
-
shipping_address_1
- Billing address 1
-
shipping_address_2
- Billing address 2
-
shipping_address_map_url
- Get a formatted shipping address for the order
-
shipping_city
- Billing city
-
shipping_company
- Billing company
-
shipping_country
- Billing country
-
shipping_email
- Billing email
-
shipping_first_name
- Billing first name
-
shipping_last_name
- Billing last name
-
shipping_method
- Gets formatted shipping method title
-
shipping_phone
- Billing phone
-
shipping_postcode
- Billing postcode
-
shipping_state
- Billing state
-
shipping_tax
- Get shipping_tax
-
shipping_total
- Get shipping_total
-
status
- Status
-
subtotal
- Gets order subtotal
-
subtotal_to_display
- Gets subtotal - subtotal is shown before discounts, but with localised taxes
-
tax_totals
- Get taxes, merged by code, formatted ready for output
-
total
- Gets order grand total. incl. taxes. Used in gateways
-
total_qty_refunded
- Get the total number of items refunded
-
total_refunded
- Get amount already refunded
-
total_shipping_refunded
- Get the total shipping refunded
-
total_tax
- Get total tax amount
-
total_tax_refunded
- Get the total tax refunded
-
transaction_id
- Get transaction id
-
view_order_url
- Generates a URL to view an order from the my account page