WooCategoryApi extension
WooCommerce Category API Extension
This extension provides comprehensive product category management capabilities for WooCommerce stores. It allows you to create, read, update, and delete product categories, as well as retrieve category lists with extensive filtering and pagination options.
Key Features
- Category Management: Create, read, update, and delete product categories
- Hierarchical Support: Handle parent-child category relationships
- Advanced Filtering: Filter categories by parent, product, slug, and more
- Pagination Support: Efficiently handle large category collections
- Search Capabilities: Find categories by name or other criteria
- Display Control: Configure how categories display products and subcategories
Example Usage
// Get all categories
final categories = await wooCommerce.getCategories();
// Create a new category
final category = WooProductCategory(
name: 'Electronics',
description: 'Electronic products and gadgets',
);
final created = await wooCommerce.createCategory(category);
- on
Methods
-
batchUpdateCategories(
WooProductCategoryBatchRequest request, {bool? useFaker}) → Future< WooProductCategoryBatchResponse> -
Available on WooCommerce, provided by the WooCategoryApi extension
Performs batch operations on product categories (create, update, delete) in a single request. -
createCategory(
WooProductCategory category, {bool? useFaker}) → Future< WooProductCategory> -
Available on WooCommerce, provided by the WooCategoryApi extension
Creates a new product category in the WooCommerce store. -
deleteCategory(
int id, {bool force = false, bool? useFaker}) → Future< bool> -
Available on WooCommerce, provided by the WooCategoryApi extension
Deletes a product category from the WooCommerce store. -
getCategories(
{WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, List< int> ? exclude, List<int> ? include, WooSortOrder order = WooSortOrder.desc, WooCategoryOrderBy orderBy = WooCategoryOrderBy.name, bool? hideEmpty, int? parent, int? product, String? slug, bool? useFaker}) → Future<List< WooProductCategory> > -
Available on WooCommerce, provided by the WooCategoryApi extension
Retrieves a list of product categories from the WooCommerce store. -
getCategory(
int id, {bool? useFaker}) → Future< WooProductCategory> -
Available on WooCommerce, provided by the WooCategoryApi extension
Retrieves a single product category by its ID from the WooCommerce store. -
updateCategory(
WooProductCategory category, {bool? useFaker}) → Future< WooProductCategory> -
Available on WooCommerce, provided by the WooCategoryApi extension
Updates an existing product category in the WooCommerce store.