You've already forked wc-tier-and-package-prices
Release version 1.2.8 - Currency display and data deletion fixes
Fixed two important bugs reported in v1.2.7: Bug 1: Currency Symbol Missing in Admin Headers and Placeholders - Table headers now show "Price (CURRENCY)" instead of just "Price" - Input placeholders include currency symbol (e.g., "9.99 $") - Better UX for multi-currency stores Bug 2: Variation Pricing Data Not Deleted Properly (Critical) - Empty pricing arrays were being saved instead of deleted - Fixed save logic to check if arrays are empty after filtering - Properly deletes post meta when all entries are removed - Affects simple products, variable parents, and variations Technical changes: - Updated all table headers with currency symbol display - Modified all render methods to pass currency_symbol to templates - Updated Twig templates to use currency in placeholders - Fixed save_tier_package_fields() and save_variation_pricing_fields() - Added !empty() checks before update_post_meta() calls 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
37
CHANGELOG.md
37
CHANGELOG.md
@@ -5,6 +5,43 @@ 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.8] - 2025-12-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Currency Symbol Missing in Admin Headers and Placeholders**: Table headers in the admin pricing configuration now display "Price (CURRENCY)" instead of just "Price", making it immediately clear which currency is being used. Price input placeholders now show currency symbol (e.g., "e.g., 9.99 $" instead of "e.g., 9.99"), providing better UX for administrators configuring pricing in different currencies.
|
||||
|
||||
- **Variation Pricing Data Not Deleted Properly (Critical)**: When administrators deleted all tier or package pricing entries from a variation (or simple/parent product) and saved, the empty pricing data was still stored in the database instead of being deleted. This caused variations to retain deleted pricing rules. The save logic now properly detects when the filtered pricing arrays are empty after removing invalid entries and deletes the post meta instead of saving empty arrays.
|
||||
|
||||
### Technical Details
|
||||
|
||||
**Currency Symbol Enhancement**:
|
||||
- Updated all table headers to use `printf(__('Price (%s)', 'wc-tier-package-prices'), get_woocommerce_currency_symbol())`
|
||||
- Modified `render_tier_row()` and `render_package_row()` methods to pass `currency_symbol` to Twig templates
|
||||
- Updated `render_variation_tier_row()` and `render_variation_package_row()` with same currency symbol parameter
|
||||
- Changed Twig template placeholders from `'e.g., 9.99'` to `('e.g., 9.99 ' ~ currency_symbol)`
|
||||
- Affects all pricing contexts: simple products, variable product parents, and variations
|
||||
|
||||
**Pricing Deletion Fix**:
|
||||
- Modified `save_tier_package_fields()` method (simple/parent products) to check `if (!empty($tiers))` before saving
|
||||
- Modified `save_variation_pricing_fields()` method (variations) with same empty check logic
|
||||
- Changed logic from "save on isset, delete otherwise" to "filter entries, then save if not empty, delete if empty"
|
||||
- Applies to both tier pricing and package pricing for all product types
|
||||
- Root cause was filtering out empty entries but still calling `update_post_meta()` with an empty array
|
||||
|
||||
**User Impact**:
|
||||
- Administrators see currency symbol in all pricing configuration interfaces
|
||||
- Clear indication of which currency prices should be entered in
|
||||
- Deleting all pricing rules now properly removes them from the database
|
||||
- No orphaned pricing data remains after deletion
|
||||
- Works correctly for simple products, variable product parents, and variations
|
||||
|
||||
### Changed Files
|
||||
|
||||
- `includes/class-wc-tpp-product-meta.php` - Added currency symbol to all table headers; updated all render methods to pass currency symbol; fixed empty array deletion logic in both save methods
|
||||
- `templates/admin/tier-row.twig` - Updated placeholder to include currency symbol
|
||||
- `templates/admin/package-row.twig` - Updated placeholder to include currency symbol
|
||||
|
||||
## [1.2.7] - 2025-12-30
|
||||
|
||||
### Fixed
|
||||
|
||||
Reference in New Issue
Block a user