You've already forked wc-tier-and-package-prices
Release version 1.2.5 - Parent product default pricing and UI enhancements
Added: - Parent product default pricing for variable products - set tier/package pricing once on parent, variations inherit unless overridden - Hide empty table headers in admin until pricing rules are defined Technical: - Added parent fallback logic to get_tier_price() and get_package_price() methods - Created helper methods get_packages_with_fallback() and is_restriction_enabled() in cart class - Updated all cart methods to support parent product defaults - Added CSS :has() selectors to hide table headers when tbody is empty - Fixed cart pricing calls to pass correct product ID for fallback resolution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
31
CHANGELOG.md
31
CHANGELOG.md
@@ -5,6 +5,37 @@ All notable changes to WooCommerce Tier and Package Prices will be documented in
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.2.5] - 2025-12-30
|
||||
|
||||
### Added
|
||||
|
||||
- **Parent Product Default Pricing**: Variable products can now define tier and package pricing at the parent product level that applies as defaults to all variations. Individual variations can override these defaults with their own specific pricing. This makes it much easier to set up pricing for products with many variations - set defaults once on the parent, then only customize the variations that need different pricing.
|
||||
|
||||
- **Hide Empty Table Headers**: Table headers for tier and package pricing in the admin area now automatically hide when no pricing rules are defined. This creates a cleaner interface when starting to configure a product, showing only the helpful empty state message and "Add" button.
|
||||
|
||||
### Technical Details
|
||||
|
||||
**Parent Fallback Implementation**:
|
||||
- Modified `WC_TPP_Frontend::get_tier_price()` and `WC_TPP_Frontend::get_package_price()` to fall back to parent product pricing when variation doesn't have its own pricing
|
||||
- Updated `WC_TPP_Cart` to use helper methods `get_packages_with_fallback()` and `is_restriction_enabled()` for consistent parent fallback behavior
|
||||
- All cart validation, quantity restriction, and display methods now support parent product defaults
|
||||
- Fixed cart pricing calls to pass parent `$product_id` instead of `$effective_id` for proper fallback resolution
|
||||
|
||||
**CSS Enhancement**:
|
||||
- Added `:has()` pseudo-class selectors to hide table headers when tbody is empty
|
||||
- Leverages existing empty state message styling for consistent UX
|
||||
|
||||
**Backward Compatibility**:
|
||||
- 100% backward compatible - existing products continue working as before
|
||||
- No database migrations required
|
||||
- Variations with specific pricing take precedence over parent defaults
|
||||
|
||||
### Changed Files
|
||||
|
||||
- `includes/class-wc-tpp-frontend.php` - Added parent fallback logic to `get_tier_price()` and `get_package_price()` methods
|
||||
- `includes/class-wc-tpp-cart.php` - Added helper methods `get_packages_with_fallback()` and `is_restriction_enabled()`; updated all cart methods to support parent fallback; fixed pricing calls to use correct product ID
|
||||
- `assets/css/admin.css` - Added CSS rules to hide table headers when no pricing rules exist
|
||||
|
||||
## [1.2.4] - 2025-12-30
|
||||
|
||||
### Fixed
|
||||
|
||||
Reference in New Issue
Block a user