woo-frontend
Customize WooCommerce frontend — template overrides, theme integration, shortcodes, hooks for product/cart/checkout display, and WooCommerce block themes. Use when modifying the storefront appearance or building WooCommerce themes.
Best use case
woo-frontend is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Customize WooCommerce frontend — template overrides, theme integration, shortcodes, hooks for product/cart/checkout display, and WooCommerce block themes. Use when modifying the storefront appearance or building WooCommerce themes.
Teams using woo-frontend 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-frontend/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How woo-frontend Compares
| Feature / Agent | woo-frontend | 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?
Customize WooCommerce frontend — template overrides, theme integration, shortcodes, hooks for product/cart/checkout display, and WooCommerce block themes. Use when modifying the storefront appearance or building WooCommerce themes.
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 Frontend & Template Customization
## Before writing code
**Fetch live docs**:
1. Web-search `site:developer.woocommerce.com template structure` for template hierarchy
2. Web-search `site:developer.wordpress.org themes` for WordPress Theme Handbook
3. Web-search `woocommerce template override guide` for override patterns
## Template System
### How Templates Work
WooCommerce uses a template override system:
- Core templates live in `woocommerce/templates/` within the plugin
- Themes override by copying to `{theme}/woocommerce/{template-path}`
- `wc_get_template()` and `wc_get_template_part()` handle the lookup chain
### Template Lookup Order
1. `{child-theme}/woocommerce/{template}.php`
2. `{parent-theme}/woocommerce/{template}.php`
3. `woocommerce/templates/{template}.php` (plugin default)
### Key Template Files
| Template | Path | Purpose |
|----------|------|---------|
| Single product | `content-single-product.php` | Product page layout |
| Product archive | `archive-product.php` | Shop/category page |
| Product loop item | `content-product.php` | Product card in loop |
| Cart | `cart/cart.php` | Cart page |
| Checkout | `checkout/form-checkout.php` | Checkout form |
| My Account | `myaccount/my-account.php` | Customer account |
| Emails | `emails/*.php` | Transactional emails |
### Template Parts
`wc_get_template_part( 'content', 'product' )` loads `content-product.php` — used for reusable template fragments.
## Template Hooks
### Product Page Hooks (Sequence)
```
woocommerce_before_single_product
woocommerce_before_single_product_summary
(product image/gallery)
woocommerce_single_product_summary
woocommerce_template_single_title (5)
woocommerce_template_single_rating (10)
woocommerce_template_single_price (10)
woocommerce_template_single_excerpt (20)
woocommerce_template_single_add_to_cart (30)
woocommerce_template_single_meta (40)
woocommerce_template_single_sharing (50)
woocommerce_after_single_product_summary
woocommerce_output_product_data_tabs (10)
woocommerce_upsell_display (15)
woocommerce_output_related_products (20)
woocommerce_after_single_product
```
### Shop/Archive Hooks
```
woocommerce_before_shop_loop
woocommerce_before_shop_loop_item
woocommerce_before_shop_loop_item_title
woocommerce_shop_loop_item_title
woocommerce_after_shop_loop_item_title
woocommerce_after_shop_loop_item
woocommerce_after_shop_loop
```
## Enqueuing Assets
### CSS
Enqueue via `wp_enqueue_scripts` action:
- `wp_enqueue_style( 'handle', plugin_dir_url(__FILE__) . 'assets/css/style.css', [], '1.0.0' )`
- Conditional loading: wrap in `is_product()`, `is_cart()`, `is_checkout()`, etc.
### JavaScript
- `wp_enqueue_script( 'handle', $url, ['jquery'], '1.0.0', true )`
- Pass data to JS: `wp_localize_script()` or `wp_add_inline_script()`
- Use `wp_enqueue_script` with `strategy => 'defer'` for performance
### WooCommerce Conditional Functions
| Function | Returns true on |
|----------|----------------|
| `is_shop()` | Main shop page |
| `is_product_category()` | Category archive |
| `is_product_tag()` | Tag archive |
| `is_product()` | Single product page |
| `is_cart()` | Cart page |
| `is_checkout()` | Checkout page |
| `is_account_page()` | My Account page |
| `is_woocommerce()` | Any WooCommerce page |
## Theme Integration
### Declaring WooCommerce Support
```php
add_action( 'after_setup_theme', function() {
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
});
```
### Block Themes (FSE)
Full Site Editing themes use:
- Block templates instead of PHP templates
- `templates/` and `parts/` directories with HTML files
- `theme.json` for global styles and settings
- WooCommerce block patterns for product displays
## Email Templates
### Customizing Emails
- Override templates in `{theme}/woocommerce/emails/`
- Use `woocommerce_email_header` and `woocommerce_email_footer` hooks
- Style with `email-styles.php` template
- Custom email classes extend `WC_Email`
## Best Practices
- Override templates only when hooks are insufficient
- Keep overridden templates up to date with WooCommerce releases (check `@version` tag)
- Use hooks (`add_action` / `add_filter`) over template overrides when possible
- Conditionally load assets only on pages where they're needed
- Use `wc_get_template()` in plugins to make templates overridable by themes
- Escape all dynamic output in templates
- Support block themes by providing block template alternatives
Fetch the WooCommerce template structure docs and theme handbook for exact template paths, hook sequences, and override patterns before implementing.Related Skills
magento-frontend
Build Magento 2 frontend — layout XML, blocks, PHTML templates, ViewModels, themes, JavaScript (RequireJS/KnockoutJS), and LESS/CSS. Use when customizing the storefront, building themes, or working with frontend components.
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.
woo-performance
Optimize WooCommerce performance — object caching, transients, HPOS, database optimization, Action Scheduler, lazy loading, and query optimization. Use when improving store performance or diagnosing slowness.
woo-payments
Build WooCommerce payment gateways — WC_Payment_Gateway, direct/redirect/hosted integrations, tokenization, subscriptions support, refunds, and PCI compliance. Use when creating custom payment method integrations.
woo-hooks-filters
Master the WordPress hook system for WooCommerce — actions, filters, hook priorities, WooCommerce-specific hooks, and extensibility patterns. Use when adding functionality via hooks or understanding the WooCommerce execution flow.
woo-deploy
Deploy WooCommerce — WP-CLI automation, database migrations, zero-downtime updates, staging workflows, environment configuration, and CI/CD patterns. Use when deploying WooCommerce stores or setting up deployment pipelines.
woo-data-stores
Work with WooCommerce CRUD data stores — WC_Product, WC_Order, WC_Customer, WC_Coupon data objects, custom data stores, HPOS migration, and getters/setters. Use when creating or modifying WooCommerce data objects or implementing custom data stores.
woo-custom-fields
Work with WooCommerce product attributes, custom meta fields, taxonomies, custom product tabs, and variation data. Use when adding custom data to products, orders, or customers.