woocommerce-subscriptions

Implement WooCommerce subscription products with recurring billing, lifecycle hooks, and prorated plan switching.

3|1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill woocommerce-subscriptions-tomtoto757
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: woocommerce-subscriptions
Source: https://github.com/tomtoto757/ecomm-ai-team/tree/main/skills/platform-integrations-infrastructure/finsilabs/platform-woocommerce/woocommerce-subscriptions
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill woocommerce-subscriptions-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building subscription products in WooCommerce requires correctly wiring recurring billing, lifecycle events, failed payment retries, and proration logic — mistakes here cause revenue leakage, double charges, or broken access control. ## Core Features & Use Cases - Programmatic Subscription Products: Create simple subscription products in PHP with correct meta keys for price, billing period, trial length, and sign-up fees. - Lifecycle Event Handling: Hook into activation, renewal success, renewal failure, and cancellation actions to manage user roles and access automatically. - Proration & Plan Switching: Implement daily-rate proration with a non-negative floor and safely swap subscription items with recalculated totals. - Use Case: A membership site needs a 14-day free trial at $29.99/month, automatic role revocation after two failed renewals, and fair mid-cycle upgrades — this Skill provides the exact hooks, meta keys, and API calls to build it. ## Quick Start Ask the AI to write a WooCommerce plugin that creates a monthly subscription product with a free trial and hooks into renewal failure events to manage user access.

Frequently Asked Questions about woocommerce-subscriptions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a WooCommerce subscription product programmatically?▼

Instantiate WC_Product_Subscription, set the name and price, save it, then set subscription meta via update_post_meta: _subscription_price, _subscription_period, _subscription_period_interval, _subscription_length, trial keys, and _subscription_sign_up_fee.

How to handle failed WooCommerce subscription renewal payments?▼

Hook into woocommerce_subscription_payment_failed and call get_failed_payment_count() to track retries. After two or more failures, remove access roles and set the subscription status to on-hold, optionally sending a dunning email.

Does WooCommerce Subscriptions support prorated plan upgrades?▼

Yes, use the woocommerce_subscriptions_switch_proration filter to calculate proration from daily rates and days remaining in the billing period. Always floor the result at 0.00, since negative amounts cause gateway errors.

Why are my WooCommerce subscription renewal payments not processing?▼

Renewals fail when the payment gateway does not declare subscription support in its capabilities array. The gateway must also store a payment token from the initial order to charge the card on file during renewal.

How do I check if a user has an active subscription in WooCommerce?▼

Use wcs_get_users_subscriptions($user_id, ['active']) to list active subscriptions, or wcs_user_has_subscription() for access control checks. Always null-check results from wcs_get_subscription() since subscriptions can be deleted.