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:
2025-12-30 00:23:56 +01:00
parent e2e40538df
commit e4ecc2c0be
7 changed files with 120 additions and 51 deletions

View File

@@ -111,6 +111,18 @@
font-style: italic;
}
/* Hide table headers when there are no pricing rules */
.wc-tpp-tiers-container:empty ~ thead,
.wc-tpp-packages-container:empty ~ thead {
display: none;
}
/* Alternative approach: hide thead when tbody is empty (more reliable) */
.wc-tpp-tiers-table:has(tbody.wc-tpp-tiers-container:empty) thead,
.wc-tpp-packages-table:has(tbody.wc-tpp-packages-container:empty) thead {
display: none;
}
/* Checkbox styling improvements */
#_wc_tpp_restrict_to_packages,
input[id^="wc_tpp_restrict_to_packages_"] {