You've already forked wc-composable-product
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>
4.1 KiB
4.1 KiB
Installation Guide
Requirements
Before installing the WooCommerce Composable Products plugin, ensure your system meets these requirements:
- PHP: 8.3 or higher
- WordPress: 6.0 or higher
- WooCommerce: 8.0 or higher
- Composer: For dependency management
Installation Steps
1. Upload Plugin Files
Upload the plugin directory to your WordPress installation:
/wp-content/plugins/wc-composable-product/
2. Install Dependencies
Navigate to the plugin directory and install dependencies:
cd /wp-content/plugins/wc-composable-product/
composer install --no-dev --optimize-autoloader
3. Activate Plugin
- Log in to your WordPress admin panel
- Navigate to Plugins > Installed Plugins
- Find "WooCommerce Composable Products"
- Click Activate
4. Configure Settings
After activation, configure the plugin:
- Navigate to WooCommerce > Settings
- Click on the Composable Products tab
- Configure default settings:
- Default Selection Limit: Number of items customers can select (default: 5)
- Default Pricing Mode: Choose between "Sum of selected products" or "Fixed price"
- Display Options: Toggle product images, prices, and totals
Creating Your First Composable Product
Step 1: Create a New Product
- Go to Products > Add New
- Enter a product name (e.g., "Custom Sticker Pack")
Step 2: Set Product Type
- In the Product Data panel, select Composable product from the dropdown
Step 3: Configure General Settings
In the General tab:
- Set a Regular price (used if pricing mode is "Fixed")
- Configure Selection Limit (leave empty to use global default)
- Choose Pricing Mode (leave empty to use global default)
Step 4: Configure Composable Options
Click on the Composable Options tab:
-
Selection Criteria: Choose how to select available products
- By Category: Select product categories
- By Tag: Select product tags
- By SKU: Enter comma-separated SKUs
-
Based on your selection:
- Categories: Select one or more categories from the dropdown
- Tags: Select one or more tags from the dropdown
- SKUs: Enter SKUs like:
STICKER-01, STICKER-02, STICKER-03
Step 5: Publish
Click Publish to make your composable product live.
Frontend Usage
When customers visit your composable product:
- They see a grid of available products based on your criteria
- They can select up to the configured limit
- The total price updates in real-time (if using sum pricing mode)
- Click "Add to Cart" to add the composition to their cart
- Selected products are displayed in the cart
Troubleshooting
Plugin Won't Activate
- Ensure WooCommerce is installed and activated first
- Check PHP version (must be 8.3+)
- Verify Composer dependencies are installed
Products Not Showing in Selector
- Check that products are published and in stock
- Verify the selection criteria (category/tag/SKU) is correct
- Ensure products match the criteria you configured
Twig Template Errors
- Ensure the
vendor/directory exists and contains Twig - Run
composer installagain - Check that the
cache/directory is writable
JavaScript Not Working
- Clear browser cache
- Check browser console for errors
- Ensure jQuery is loaded (WooCommerce includes it)
Updating
When updating the plugin:
- Deactivate the plugin
- Replace plugin files
- Run
composer install --no-dev --optimize-autoloader - Reactivate the plugin
- Clear all caches (WordPress, browser, CDN)
Uninstallation
To completely remove the plugin:
- Deactivate the plugin
- Delete the plugin from the Plugins page
- Optionally clean up database entries (WooCommerce will handle this automatically)
Support
For issues and feature requests:
- GitHub: https://github.com/magdev/wc-composable-product/issues
- Documentation: See README.md
Next Steps
- Customize the template by editing
templates/product-selector.twig - Modify styles in
assets/css/frontend.css - Translate the plugin using the provided
.potfile - Create categories/tags for easier product organization