Product loop
For loop type woo_product
, here are the available query arguments and fields.
Query arguments
-
average_rating
- Average ratingType: number
-
backorders
- Backorders allowedType: string
-
count
- Limit number of results, or -1 for allDefault:
-1
Type: number -
date_created
- Date createdType: string
-
date_modified
- Date modifiedType: string
-
date_on_sale_from
- Date on sale fromType: string
-
date_on_sale_to
- Date on sale toType: string
-
download_expiry
- Download expiryType: number
-
download_limit
- Download limitType: number
-
downloadable
- Downloadable productType: boolean
-
exclude
- Exclude product ID(s)Type: array
-
featured
- FeaturedType: boolean
-
height
- HeightType: number
-
id
- Same as includeType: array
-
include
- Include only product ID(s). This option is overwritten if a membership_id is supplied.Type: array
-
length
- LengthType: number
-
manage_stock
- Product stock management enabled/disabledType: boolean
-
membership_id
- Return only products which grant access to a specific membership plan. Must have membership plugin installed and activated.Type: number
-
order
- OrderDefault:
desc
Type: string -
orderby
- Order by fieldDefault:
name
Type: string -
parent
- Parent product ID(s)Type: number
-
parent_exclude
- Exclude parent product ID(s)Type: array
-
price
- PriceType: number
-
product_category
- Products by category ID(s), slug(s)Type: string, array
-
product_tag
- Products by tag ID(s), slug(s)Type: string, array
-
product_type
- Product typeDefault:
["external","grouped","simple","variable","subscription","variable-subscription","appointment"]
Type: string, array -
regular_price
- Regular priceType: number
-
review_count
- Review countType: number
-
reviews_allowed
- Reviews allowedType: boolean
-
sale_price
- Sale priceType: number
-
shipping_class
- Shipping classType: string, array
-
sku
- Product SKU or partial matchType: string
-
sold_individually
- Sold individuallyType: boolean
-
status
- StatusType: string, array
-
stock_quantity
- Stock quantityType: number
-
stock_status
- Stock statusType: string
-
tag
- Products by category slug(s)Type: string, array
-
tax_class
- Tax statusType: string
-
tax_status
- Tax statusType: string
-
total_sales
- Products with total salesType: number
-
virtual
- Virtual product (does not require shipping)Type: boolean
-
visibility
- Product visibilityType: string
-
weight
- WeightType: number
-
width
- WidthType: number
Fields
-
attributes
- Product attributes if applicable, else empty array
-
availability_span
- Availability span
-
average_rating
- Average rating
-
backorders
- Backorders allowed
-
cancel_limit
- Cancel limit value
-
cancel_limit_unit
- Cancel limit unit
-
customer_timezones
- Customer timezone
-
download_expiry
- Download expiry
-
download_limit
- Download limit
-
downloadable
- Downloadable product
-
duration
- Duration value
-
duration_unit
- Duration unit
-
expiration_date
- The date on which the subscription product will expire
-
featured
- Featured
-
first_renewal_payment_date
- The first renewal payment will be processed based on the subscription's length
-
grants_access_to_team
- Product grants access to a team
-
has_price_label
- Has price label
-
has_pricing
- Has pricing
-
has_restricted_days
- Has restricted days within a week
-
height
- Height
-
id
- ID
-
interval
- Interval value
-
interval_unit
- Interval unit
-
length
- Returns the length of a subscription product
-
manage_stock
- Product stock management enabled/disabled
-
name
- Name
-
padding_duration
- Padding between slots value
-
padding_duration_unit
- Padding between slots unit
-
period
- Returns the subscription period for a product
-
price
- Price
-
price_label
- Price label
-
price_per_period
- Returns the active price per period for a product if it is a subscription.
-
price_string
- Returns a string representing the details of the subscription.
-
pricing
- Pricing,returns list loop
-
purchased
- Product is purchased
-
qty
- Quantity
-
regular_price
- Returns the sale price per period for a product if it is a subscription
-
requires_confirmation
- Customer must confirm
-
restricted_days
- Restricted days within a week
-
review_count
- Review count
-
reviews_allowed
- Reviews allowed
-
sale_price
- Sale price
-
shipping_class
- Shipping class
-
sign_up_fee
- The sign-up fee for a subscription
-
sku
- Product SKU or partial match
-
sold_individually
- Sold individually
-
stock_quantity
- Stock quantity
-
stock_status
- Stock status
-
subscription_limit
- Subscription limitation
-
subscriptions
- Active subscription object when restricted to subscription type products
-
tax_class
- Tax status
-
tax_status
- Tax status
-
total_sales
- Products with total sales
-
trial_expiration_date
- The date on which the subscription trial will expire
-
trial_length
- Returns the trial length of a subscription product
-
trial_period
- Returns the trial period of a subscription product
-
type
- Product type
-
url
- Product URL
-
user_can_cancel
- User can cancel
-
variations
- Product variations if applicable, else empty array
-
virtual
- Virtual product (does not require shipping)
-
visibility
- Product visibility
-
weight
- Weight
-
width
- Width