ProductType
in package
Enum class for all the product types.
Table of Contents
- EXTERNAL = 'external'
- External/Affiliate product type.
- GROUPED = 'grouped'
- Grouped product type.
- SIMPLE = 'simple'
- Simple product type.
- VARIABLE = 'variable'
- Variable product type.
- VARIATION = 'variation'
- Variation product type.
- get_all() : array<string|int, string>
- Returns every product type value defined by this enum, as a flat list.
Constants
EXTERNAL
External/Affiliate product type.
public
string
EXTERNAL
= 'external'
GROUPED
Grouped product type.
public
string
GROUPED
= 'grouped'
SIMPLE
Simple product type.
public
string
SIMPLE
= 'simple'
VARIABLE
Variable product type.
public
string
VARIABLE
= 'variable'
VARIATION
Variation product type.
public
string
VARIATION
= 'variation'
Methods
get_all()
Returns every product type value defined by this enum, as a flat list.
public
static get_all() : array<string|int, string>
It includes self::VARIATION. Variations are real, creatable products, and WC_Product_Variation::get_type() returns this value, but each belongs to a parent rather than standing on its own.
For the top-level types a merchant can pick, use wc_get_product_types(). It returns a value => label map rather than a list, and being filterable it also carries types an extension registered.
