woo-catalog
Work with WooCommerce catalog — product types, categories, tags, attributes, product queries, search, related products, and product visibility. Use when managing products programmatically or customizing the catalog display.
Best use case
woo-catalog is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Work with WooCommerce catalog — product types, categories, tags, attributes, product queries, search, related products, and product visibility. Use when managing products programmatically or customizing the catalog display.
Teams using woo-catalog should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/woo-catalog/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How woo-catalog Compares
| Feature / Agent | woo-catalog | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Work with WooCommerce catalog — product types, categories, tags, attributes, product queries, search, related products, and product visibility. Use when managing products programmatically or customizing the catalog display.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# WooCommerce Catalog & Products
## Before writing code
**Fetch live docs**:
1. Web-search `site:developer.woocommerce.com products` for product documentation
2. Fetch `https://woocommerce.github.io/code-reference/` for class reference
3. Web-search `woocommerce custom product type implementation` for custom product types
## Product Types
### Built-In Types
| Type | Class | Description |
|------|-------|-------------|
| Simple | `WC_Product_Simple` | Single product, no options |
| Variable | `WC_Product_Variable` | Product with variations (size, color) |
| Variation | `WC_Product_Variation` | Individual variation of a variable product |
| Grouped | `WC_Product_Grouped` | Collection of related simple products |
| External/Affiliate | `WC_Product_External` | Linked to external URL |
### Virtual & Downloadable Flags
Any product can be marked:
- **Virtual** — no shipping (services, memberships)
- **Downloadable** — digital delivery (files, licenses)
### Custom Product Types
1. Extend `WC_Product` (or `WC_Product_Simple`)
2. Register the type via `woocommerce_product_type_selector` filter
3. Register the class via `woocommerce_product_class` filter or `woocommerce_product_type_{type}` class name filter
## Product Factory
`WC_Product_Factory` resolves a product ID to the correct class:
- `wc_get_product( $id )` — returns the correct `WC_Product_*` subclass
- Uses `woocommerce_product_class` filter to allow custom type resolution
## Product CRUD
### Creating Products
```php
$product = new WC_Product_Simple();
$product->set_name( 'My Product' );
$product->set_regular_price( '29.99' );
$product->set_status( 'publish' );
$product->save();
```
### Querying Products
`wc_get_products( $args )` — primary query method:
- `type` — product type(s)
- `status` — post status
- `sku` — SKU lookup
- `category` — category slug(s)
- `tag` — tag slug(s)
- `limit`, `page`, `offset` — pagination
- `orderby`, `order` — sorting
- `meta_key`, `meta_value` — meta queries
- `return` — `'objects'` (default) or `'ids'`
### WC_Product_Query
Object-oriented query builder — same as `wc_get_products()` but chainable.
## Categories & Taxonomies
### Product Categories
Taxonomy: `product_cat` (hierarchical)
- `wp_set_object_terms( $product_id, $term_ids, 'product_cat' )`
- `get_the_terms( $product_id, 'product_cat' )`
- Or CRUD: `$product->set_category_ids( [ 12, 15 ] )`
### Product Tags
Taxonomy: `product_tag` (non-hierarchical)
- `$product->set_tag_ids( [ 5, 8 ] )`
### Product Type
Taxonomy: `product_type` — internal, determines the product class.
### Custom Taxonomies
Register with `register_taxonomy()` associated with `product` post type. Set `show_in_rest => true` for block editor and API support.
## Product Visibility
### Catalog Visibility
`$product->set_catalog_visibility( $visibility )`:
- `visible` — shop and search
- `catalog` — shop only
- `search` — search only
- `hidden` — not visible (accessible via direct URL)
### Stock Status
`$product->set_stock_status( $status )`:
- `instock`, `outofstock`, `onbackorder`
- Controls visibility when "Hide out of stock" setting is enabled
## Product Images
- `$product->set_image_id( $attachment_id )` — featured image
- `$product->set_gallery_image_ids( [ $id1, $id2 ] )` — gallery
## Variable Products & Variations
### Variable Product Setup
1. Create `WC_Product_Variable`
2. Define attributes with `set_attributes()` (mark as `variation = true`)
3. Create `WC_Product_Variation` for each combination
4. Each variation has its own price, SKU, stock, image
### Variation Attributes
Each variation specifies attribute values:
- `$variation->set_attributes( [ 'pa_color' => 'red', 'pa_size' => 'large' ] )`
- Empty value = "Any" (matches all)
## Related Products & Upsells
- `$product->set_upsell_ids( $ids )` — upsell products
- `$product->set_cross_sell_ids( $ids )` — cross-sells (shown in cart)
- Related products auto-calculated from shared categories/tags (filterable via `woocommerce_related_products` filter)
## Best Practices
- Use `wc_get_product()` to load products — never `new WC_Product( $id )` directly
- Use `wc_get_products()` for queries — not `WP_Query` with `post_type => 'product'`
- Use CRUD methods for all property access
- Declare product type support: `show_if_simple`, `show_if_variable` classes on admin tabs
- Cache product data when iterating over large collections
- Use `wc_clean()` to sanitize product input data
Fetch the WooCommerce product documentation and code reference for exact method signatures, query parameters, and product type registration patterns before implementing.Related Skills
spree-catalog
Build and customize Spree's catalog — Products with Variants and OptionTypes/OptionValues, Taxonomies and Taxons (nested set), Properties, Images via ActiveStorage, multi-currency Prices, the v5.3+ PriceList feature for customer/segment overrides, MeiliSearch faceted search (v5.4+), product archiving/activation, CSV import/export, and SEO. Use when modeling products, customizing the catalog UI, indexing search, or importing inventory.
shopify-catalog
Manage Shopify catalog — Product, Variant, and Option models, collections, metafields and metaobjects, inventory management, product taxonomy, bulk operations, and media. Use when working with Shopify product data.
sf-catalog
Manage Salesforce Commerce catalogs — B2C (Business Manager catalogs, categories, products, pricing books, promotions, search indexes) and B2B (Product2, Pricebook2, PricebookEntry, volume discounts, entitlements). Use when working with product data across either platform.
saleor-catalog
Manage the Saleor catalog — products, variants, product types, categories, collections, media, and warehouse stock. Use when working with Saleor product data.
medusa-catalog
Manage the Medusa v2 catalog — products, variants, options, collections, categories, tags, and product metadata. Use when working with Medusa product data.
magento-catalog
Work with Magento 2 catalog — product types, categories, attributes, indexing, and search integration. Use when building catalog features, customizing product types, or working with the catalog architecture.
bc-catalog
Work with BigCommerce catalog — products, variants, options, modifiers, categories, brands, metafields, images, and bulk operations. Use when managing product data programmatically or building catalog integrations.
woo-testing
Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.
woo-shipping
Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.
woo-setup
Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.
woo-security
Implement WooCommerce security — nonces, capabilities, input sanitization, output escaping, data validation, PCI compliance considerations, and WordPress security best practices. Use when hardening a WooCommerce store or reviewing security posture.
woo-plugin-dev
Create WooCommerce extensions/plugins — file structure, main plugin file, activation/deactivation hooks, custom database tables, autoloading, and WordPress plugin API. Use when building new WooCommerce extensions or structuring plugin code.