woocommerce
БесплатноБез исполняемых скриптовНе проверенBuild e-commerce stores with WooCommerce for WordPress. Use when a user asks to add a shop to WordPress, manage products and orders, customize checkout…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
WooCommerce
Overview
WooCommerce is the open-source e-commerce plugin for WordPress (GPLv3, free; costs come from hosting and paid extensions). Release 11.2.1 (9 October 2026) requires WordPress 7.0+ and PHP 7.4+. You extend it with PHP hooks, talk to it from outside through the REST API (/wp-json/wc/v3), and get notified of changes through webhooks.
Instructions
Step 1: REST API integration
Create keys in WordPress admin under WooCommerce > Settings > Advanced > REST API (pick a user, choose Read, Write or Read/Write). The key acts with that user's capabilities. Keep both values in environment variables. Over HTTPS the client sends them as HTTP Basic auth; on plain HTTP the API falls back to OAuth 1.0a, so always put the store on HTTPS.
npm install @woocommerce/woocommerce-rest-api # 1.0.2, CommonJS with a default export
// lib/woo.ts
import WooCommerceRestApi from '@woocommerce/woocommerce-rest-api'
export const woo = new WooCommerceRestApi({
url: 'https://shop.northwindcoffee.co',
consumerKey: process.env.WOO_CONSUMER_KEY!,
consumerSecret: process.env.WOO_CONSUMER_SECRET!,
version: 'wc/v3',
})
// List published products (default page size is 10, max per_page is 100)
const { data: products } = await woo.get('products', { per_page: 20, status: 'publish' })
// Create a product; categories are referenced by id, images are sideloaded from the URL
const { data: created } = await woo.post('products', {
name: 'Ethiopia Guji Whole Bean 1kg',
type: 'simple',
regular_price: '29.99', // prices are strings
description: 'Washed Guji, notes of bergamot and peach.',
categories: [{ id: 15 }],
images: [{ src: 'https://cdn.northwindcoffee.co/guji-1kg.jpg' }],
})
// Orders waiting to be fulfilled, then mark one completed
const { data: orders } = await woo.get('orders', { status: 'processing', per_page: 50 })
await woo.put(`orders/${orders[0].id}`, { status: 'completed' })
// Several writes in one request (create, update and delete arrays)
await woo.post('products/batch', {
update: [{ id: created.id, regular_price: '27.50' }],
})
Pagination totals come in the x-wp-total and x-wp-totalpages response headers (response.headers). The library exports default and OptionsException; queryStringAuth: true sends the keys in the URL, only for hosts that strip the Authorization header (the keys then land in server logs).
Step 2: Hooks (PHP)
Put code in a small plugin or a child theme, never in the parent theme. Checkout comes in two flavours and the hooks differ:
- Block checkout (the default for new stores): add fields with
woocommerce_register_additional_checkout_fieldon thewoocommerce_initaction. Locations arecontact,addressandorder; types aretext,select,checkboxanddate. The id isnamespace/name. Values are stored on the order and (forcontactandaddress) on the customer. - Classic shortcode checkout: the older
woocommerce_after_order_notesandwoocommerce_checkout_update_order_metahooks. They do nothing on the block checkout.
<?php
// wp-content/plugins/northwind-checkout/northwind-checkout.php
add_action( 'woocommerce_init', function () {
woocommerce_register_additional_checkout_field( array(
'id' => 'northwind/delivery-notes',
'label' => 'Delivery notes',
'location' => 'order',
'type' => 'text',
'required' => false,
) );
} );
// Read it back from an order later (helper survives storage changes).
// The third argument is the storage group: 'billing' or 'shipping' for `address` fields,
// 'other' for `contact` and `order` fields.
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFields;
function northwind_delivery_notes( int $order_id ): ?string {
$order = wc_get_order( $order_id );
$fields = Package::container()->get( CheckoutFields::class );
return $order ? $fields->get_field_from_object( 'northwind/delivery-notes', $order, 'other' ) : null;
}
// A fee works on both checkouts; a negative amount is a discount
add_action( 'woocommerce_cart_calculate_fees', function ( WC_Cart $cart ) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
return;
}
if ( $cart->get_subtotal() > 100 ) {
$cart->add_fee( 'Bulk discount', -10 ); // 10 off orders over 100
}
} );
Read and write orders through the CRUD objects (wc_get_order(), $order->get_meta(), $order->update_meta_data() then $order->save()), not get_post_meta(). New stores keep orders in their own tables (High-Performance Order Storage), where post-meta calls return nothing.
Step 3: Webhooks
Create them under WooCommerce > Settings > Advanced > Webhooks, or with POST wc/v3/webhooks (name, topic, delivery_url, secret). Topics look like order.created, order.updated, product.updated. Each delivery carries X-WC-Webhook-Topic and `X-WC-Webhook-
Установить woocommerce в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл woocommerce?
Build e-commerce stores with WooCommerce for WordPress. Use when a user asks to add a shop to WordPress, manage products and orders, customize checkout, integrate payment gateways, or build a WordPress-based online store.
Как установить скилл woocommerce?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл woocommerce запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic