Update CLAUDE.md with v0.11.0 session history
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
106
CLAUDE.md
106
CLAUDE.md
@@ -1128,3 +1128,109 @@ Admin features always work; frontend requires valid license.
|
||||
- v0.10.1: Committed `3f5adfb` - Configurable rate limiting with settings subtabs
|
||||
- Tags: `v0.10.0`, `v0.10.1`
|
||||
- Pushed to origin: dev, main, both tags
|
||||
|
||||
### 2026-02-03 - Version 0.11.0 (WooCommerce Integration)
|
||||
|
||||
**Completed:**
|
||||
|
||||
- Created `src/Integration/WooCommerce/Manager.php` (~435 lines)
|
||||
- Core integration manager with option constants
|
||||
- HPOS (High-Performance Order Storage) compatibility declaration
|
||||
- `is_wc_active()`, `is_enabled()` checks
|
||||
- `map_wc_status_to_booking()` for status synchronization
|
||||
- `get_order_for_booking()`, `get_booking_for_order()` bidirectional lookups
|
||||
- `link_booking_to_order()` for creating relationships
|
||||
- Created `src/Integration/WooCommerce/ProductSync.php` (~515 lines)
|
||||
- Virtual WooCommerce products for rooms (SKU: `bnb-room-{id}`)
|
||||
- Auto-sync on `save_post_bnb_room` hook
|
||||
- Product deletion on room deletion
|
||||
- `sync_all_rooms()` for bulk synchronization
|
||||
- Bidirectional meta linking (room ↔ product)
|
||||
- Created `src/Integration/WooCommerce/CartHandler.php` (~545 lines)
|
||||
- Cart item data structure with booking details
|
||||
- Availability validation on add-to-cart
|
||||
- Dynamic price calculation using `Calculator` class
|
||||
- Cart item display with dates, guests, nights
|
||||
- Services support in cart items
|
||||
- Created `src/Integration/WooCommerce/CheckoutHandler.php` (~347 lines)
|
||||
- Special requests textarea field
|
||||
- Arrival time dropdown field
|
||||
- Guest data pre-fill from user profile
|
||||
- Final availability validation before payment
|
||||
- Booking summary display
|
||||
- Created `src/Integration/WooCommerce/OrderHandler.php` (~584 lines)
|
||||
- Booking creation on `woocommerce_payment_complete`
|
||||
- Guest record creation from billing info
|
||||
- Booking reference generation (BNB-YYYY-NNNNN)
|
||||
- Status synchronization on order status changes
|
||||
- Order-booking bidirectional linking
|
||||
- Created `src/Integration/WooCommerce/InvoiceGenerator.php` (~633 lines)
|
||||
- PDF generation using existing mPDF dependency
|
||||
- Configurable invoice numbering (prefix + start number)
|
||||
- Auto-attach to WooCommerce order emails
|
||||
- Secure storage in `wp-content/uploads/wp-bnb-invoices/`
|
||||
- .htaccess protection for invoice directory
|
||||
- Created `src/Integration/WooCommerce/RefundHandler.php` (~394 lines)
|
||||
- Full refund triggers booking cancellation
|
||||
- Partial refund records amount without cancellation
|
||||
- Refund meta storage on booking
|
||||
- `wp_bnb_wc_should_cancel_on_refund` filter for customization
|
||||
- Created `src/Integration/WooCommerce/AdminColumns.php` (~282 lines)
|
||||
- "WC Order" column in bookings list
|
||||
- "Booking" column in WC orders list (supports HPOS)
|
||||
- Row actions for cross-navigation
|
||||
- Created `assets/css/wc-integration.css` (~443 lines)
|
||||
- Cart booking display styles
|
||||
- Checkout summary styles
|
||||
- Booking form styles
|
||||
- Status badge colors
|
||||
- Created `assets/js/wc-integration.js` (~358 lines)
|
||||
- `BookingForm` class for frontend forms
|
||||
- AJAX sync rooms handler
|
||||
- AJAX generate invoice handler
|
||||
- Availability checking with debounce
|
||||
- Updated `src/Plugin.php`
|
||||
- WooCommerce initialization when WC is active
|
||||
- WooCommerce settings tab with 4 subtabs (General, Products, Orders, Invoices)
|
||||
- Asset enqueuing for WooCommerce integration
|
||||
|
||||
**Files Created:**
|
||||
|
||||
- `src/Integration/WooCommerce/Manager.php`
|
||||
- `src/Integration/WooCommerce/ProductSync.php`
|
||||
- `src/Integration/WooCommerce/CartHandler.php`
|
||||
- `src/Integration/WooCommerce/CheckoutHandler.php`
|
||||
- `src/Integration/WooCommerce/OrderHandler.php`
|
||||
- `src/Integration/WooCommerce/InvoiceGenerator.php`
|
||||
- `src/Integration/WooCommerce/RefundHandler.php`
|
||||
- `src/Integration/WooCommerce/AdminColumns.php`
|
||||
- `assets/css/wc-integration.css`
|
||||
- `assets/js/wc-integration.js`
|
||||
|
||||
**Files Changed:**
|
||||
|
||||
- `src/Plugin.php` - WooCommerce initialization and settings tab
|
||||
- `assets/css/admin.css` - Status badge colors for booking statuses
|
||||
- `wp-bnb.php` - Version bump to 0.11.0
|
||||
- `CHANGELOG.md` - Added v0.11.0 release notes
|
||||
- `PLAN.md` - Marked Phase 11 as complete
|
||||
|
||||
**Learnings:**
|
||||
|
||||
- WooCommerce HPOS compatibility requires `FeaturesUtil::declare_compatibility()` in `before_woocommerce_init` hook
|
||||
- Use `$order->get_meta()` / `$order->update_meta_data()` instead of `get_post_meta()` for HPOS compatibility
|
||||
- Virtual products (`virtual => true`, `downloadable => false`) don't require shipping
|
||||
- Cart item data stored via `woocommerce_add_cart_item_data` filter persists through session
|
||||
- Dynamic pricing via `woocommerce_before_calculate_totals` hook with priority 20
|
||||
- `woocommerce_payment_complete` fires after successful payment, ideal for booking creation
|
||||
- Invoice attachment via `woocommerce_email_attachments` filter with order and email type detection
|
||||
- Refund detection: `woocommerce_refund_created` for partial, `woocommerce_order_fully_refunded` for full
|
||||
- Status badge CSS must be in admin.css for settings page (wc-integration.css is frontend only)
|
||||
- HPOS orders list uses `manage_woocommerce_page_wc-orders_columns` filter (different from legacy)
|
||||
|
||||
**Released:**
|
||||
|
||||
- Committed: `2865956` on dev branch
|
||||
- Merged to main (fast-forward)
|
||||
- Tagged: `v0.11.0`
|
||||
- Pushed to origin: dev, main, v0.11.0
|
||||
|
||||
Reference in New Issue
Block a user