Fixed "Unknown 'esc_attr' filter" error that occurred when rendering
the product selector template. The issue was caused by WordPress
escaping functions being registered only as Twig functions, not filters.
Changes:
- Added TwigFilter registrations for esc_html, esc_attr, esc_url
- Template now supports both filter syntax (|esc_attr) and function syntax
- Fixes compatibility issues when other plugins use their own Twig instances
- Version bump to 1.1.5
This resolves the bug documented in logs/fatal-errors-2025-12-31.log
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added session history for v1.1.4 which introduced:
- Fixed price field in Composable Options tab
- JavaScript toggle based on pricing mode selection
- Improved admin UX with progressive disclosure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
CRITICAL BUG FIX: v1.1.1 still had the same error!
Root cause analysis:
- v1.1.1 changed hook to woocommerce_init but error persisted
- Real issue: Settings.php was require_once'd in Plugin::includes()
- At that point, class extends WC_Settings_Page which doesn't exist yet
- Even woocommerce_init fires before WC_Settings_Page is loaded
Solution:
- Removed require_once from Plugin::includes() (line 93)
- Moved require_once to Plugin::add_settings_page() (line 196)
- Settings.php now loads on-demand via woocommerce_get_settings_pages filter
- This filter fires when WooCommerce has loaded all settings classes
Changes:
- includes/Plugin.php: Delayed Settings.php inclusion with explanatory comment
- wc-composable-product.php: Version bump to 1.1.2
- CHANGELOG.md: Documented fix and noted v1.1.1 was insufficient
This addresses the actual root cause that persisted through 3 versions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added complete inventory tracking system for composable products:
- Stock validation during product selection and add-to-cart
- Automatic stock deduction on order completion/processing
- Automatic stock restoration on order cancellation/refund
- Stock status indicators with visual feedback (In stock, Low stock, Out of stock)
- Prevention of out-of-stock item selection
- Low stock warnings when 5 or fewer items remain
- Order notes documenting all stock changes
New files:
- includes/Stock_Manager.php: Core stock management logic
Modified files:
- includes/Cart_Handler.php: Integrated stock validation
- includes/Product_Selector.php: Added stock info to product data
- includes/Plugin.php: Added Stock_Manager to includes
- templates/product-selector.twig: Stock status display
- assets/css/frontend.css: Stock indicator styling
- languages/*.pot/*.po: 8 new translatable strings
Version bumped to 1.1.0 with updated CHANGELOG.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented custom WooCommerce product type allowing customers to build their own
product bundles by selecting from predefined sets of products.
Features:
- Custom "Composable Product" type with admin interface
- Product selection by category, tag, or SKU
- Configurable selection limits (global and per-product)
- Dual pricing modes: fixed price or sum of selected products
- Modern responsive frontend with Twig templates
- AJAX add-to-cart functionality
- Full internationalization support (.pot file)
- WooCommerce settings integration
- Comprehensive documentation
Technical implementation:
- PHP 8.3+ with PSR-4 autoloading
- Twig 3.0 templating engine via Composer
- Vanilla JavaScript with jQuery for frontend interactions
- WordPress and WooCommerce hooks for seamless integration
- Security: input sanitization, validation, and output escaping
- Translation-ready with text domain 'wc-composable-product'
Documentation:
- README.md: Project overview and features
- INSTALL.md: Installation and usage guide
- IMPLEMENTATION.md: Technical architecture
- CHANGELOG.md: Version history
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>