WooCategoryDisplay enum

WooCommerce Category Display Enumeration

Defines how product categories display their content on category pages. Controls whether to show products, subcategories, or both on the category page.

Usage Examples

// Set category to display products only
final category = WooProductCategory(
  name: 'Electronics',
  display: WooCategoryDisplay.products,
);

// Set category to display subcategories only
final parentCategory = WooProductCategory(
  name: 'Technology',
  display: WooCategoryDisplay.subcategories,
);

// Set category to display both products and subcategories
final mixedCategory = WooProductCategory(
  name: 'Home & Garden',
  display: WooCategoryDisplay.both,
);
Inheritance
Available extensions

Values

default_ → const WooCategoryDisplay

Default display behavior (products)

products → const WooCategoryDisplay

Display products only on category page

subcategories → const WooCategoryDisplay

Display subcategories only on category page

both → const WooCategoryDisplay

Display both products and subcategories on category page

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fake() WooCategoryDisplay
Creates a fake WooCategoryDisplay instance for testing purposes
fromString(String type) WooCategoryDisplay
Creates a WooCategoryDisplay instance from a string value

Constants

values → const List<WooCategoryDisplay>
A constant List of the values in this enum, in order of their declaration.