wc-customer-and-sessions
CommunityMaster WC session and customer data flow.
AuthorLonsdale201
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps developers correctly use WooCommerce's session and customer abstractions, avoiding $_SESSION and direct cookies that break with page caching, REST, AJAX, cron, and WP-CLI, by guiding data storage and retrieval through WC()->session and WC()->customer.
Core Features & Use Cases
- Correctly read and write per-visitor data with WC()->session, including ephemeral data such as cart state and feature flags.
- Read the active customer's billing/shipping details via WC()->customer, and update them in a way that works for both guests and logged-in users.
- Ensure session initialization in non-frontend contexts (REST, cron, CLI) by calling wc_load_cart() or WC()->initialize_session().
Quick Start
Use WC()->session to store per-visitor data and WC()->customer to read billing info in a plugin context, and call wc_load_cart() in REST or cron contexts when needed.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: wc-customer-and-sessions Download link: https://github.com/Lonsdale201/wp-agent-skills/archive/main.zip#wc-customer-and-sessions Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.