wc-order-lifecycle-and-items

Official

Handle WooCommerce orders and items safely.

Authorvikingokft
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It prevents incorrect WooCommerce order handling that can skip payment side effects, break status hook ordering, mismanage line items, or cause double stock adjustments.

Core Features & Use Cases

  • Correct payment vs status transitions: Use payment_complete for paid success flows and update_status for non-success status changes.
  • Reliable hook selection and ordering: React to the right WooCommerce status hooks with the correct arguments and transition awareness.
  • Safe order item + totals management: Add and edit the right WC_Order_Item_* types, update meta safely, and recalculate totals after changes.
  • Stock side-effect correctness: Rely on WooCommerce lifecycle stock reduction/restoration and respect reduced-stock behavior instead of calling low-level reducers blindly.
  • HPOS-safe order persistence: Use Woo CRUD APIs (wc_get_order, update_meta_data, save) rather than postmeta or direct SQL over shop_order.

Quick Start

Ask the AI to help you decide which WooCommerce hook and API to use for a plugin action after a webhook payment event, including whether to call payment_complete or update_status and how to safely add or modify order line items and totals.

Dependency Matrix

Required Modules

None required

Components

references

💻 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-order-lifecycle-and-items
Download link: https://github.com/vikingokft/wp-agent-skills/archive/main.zip#wc-order-lifecycle-and-items

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.