Files
wc-composable-product/CHANGELOG.md
magdev a581ef42e6 Fix fatal error and ensure WooCommerce settings tab integration (v1.0.1)
Fixed critical bug preventing plugin activation and improved initialization sequence.

Bug Fix:
- Fixed fatal error: "Class 'WC_Settings_Page' not found" in Settings.php:15
- Root cause: Plugin initialized on 'plugins_loaded' before WooCommerce classes loaded
- Changed initialization hook from 'plugins_loaded' to 'woocommerce_loaded'
- Settings class now extends WC_Settings_Page without errors

Settings Integration:
- Settings page properly integrates as "Composable Products" tab in WooCommerce > Settings
- Tab appears after WooCommerce core tabs (Products, Shipping, etc.)
- All settings fields render correctly:
  - Default Selection Limit (number input)
  - Default Pricing Mode (select dropdown)
  - Display options (checkboxes for images, prices, total)

Technical Details:
- Using woocommerce_loaded hook ensures WC_Settings_Page class is available
- Prevents race condition during plugin initialization
- Settings class registration via woocommerce_get_settings_pages filter works correctly
- No breaking changes to existing functionality

Version bumped to 1.0.1 with updated CHANGELOG.md documenting the fix.

Tested: Plugin now activates without errors and settings tab appears correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 16:31:21 +01:00

1.6 KiB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.1] - 2024-12-31

Fixed

  • Fatal error "Class WC_Settings_Page not found" during plugin activation
  • Changed initialization hook from plugins_loaded to woocommerce_loaded to ensure WooCommerce classes are available before plugin initialization
  • Settings page now correctly integrates as a tab in WooCommerce > Settings

Technical

  • Plugin now waits for woocommerce_loaded action before initializing
  • Prevents race condition where WooCommerce classes weren't loaded yet
  • Settings tab appears correctly in WooCommerce settings interface

1.0.0 - 2024-12-31

Added

  • Initial release
  • Composable product type for WooCommerce
  • Product selection by category, tag, or SKU
  • Configurable selection limits (global and per-product)
  • Two pricing modes: fixed price or sum of selected products
  • Admin settings page
  • Frontend product selector with grid layout
  • AJAX add-to-cart functionality
  • Twig template engine integration
  • Full internationalization support
  • Responsive design
  • WooCommerce cart integration
  • Product data validation

Features

  • Select products from predefined categories, tags, or SKUs
  • Limit number of items customers can select
  • Visual product selector with images and prices
  • Real-time price calculation
  • Clean, modern UI
  • Mobile responsive
  • Translation ready