Automattic\WooCommerce\Enums
CatalogSortOrder{}
Enum class for the possible values of the woocommerce_default_catalog_orderby
No Hooks.
Usage
$CatalogSortOrder = new CatalogSortOrder(); // use class methods
Methods
No Methods in class.Changelog
| Since 11.1.0 | Introduced. |
CatalogSortOrder{} CatalogSortOrder{} code WC 11.1.2
final class CatalogSortOrder {
/**
* Default sorting (custom ordering + name).
*
* @var string
*/
public const MENU_ORDER = 'menu_order';
/**
* Sort by popularity (number of sales).
*
* @var string
*/
public const POPULARITY = 'popularity';
/**
* Sort by average rating.
*
* @var string
*/
public const RATING = 'rating';
/**
* Sort by most recent.
*
* @var string
*/
public const DATE = 'date';
/**
* Sort by price ascending.
*
* @var string
*/
public const PRICE = 'price';
/**
* Sort by price descending.
*
* @var string
*/
public const PRICE_DESC = 'price-desc';
}