You've already forked wc-tier-and-package-prices
## Bugfixes
1. **Price Header Not Translated**
- Fixed translation function placement in printf statements
- Changed from printf(__()) to printf(esc_html__())
- Headers now display in administrator's configured language
2. **Placeholder HTML Entity Encoding**
- Currency symbols were showing as HTML entities (e.g., €)
- Removed translation filter from concatenated placeholder strings
- Placeholders are example values that should not be translated
3. **Variation Pricing Still Not Deletable (Regression)**
- Despite v1.2.8 fix, edge cases remained due to conditional branching
- Refactored save logic to be more defensive
- Always initializes arrays, then unconditionally updates or deletes
- Guarantees proper cleanup regardless of POST data structure
## Technical Details
- Updated all 6 table headers: printf(esc_html__('Price (%s)', 'wc-tier-package-prices'), ...)
- Removed |__() filter from Twig placeholder concatenations
- Refactored save_variation_pricing_fields() with simplified logic:
* Initialize arrays at start
* Populate only if valid POST data exists
* Always perform update (if !empty) or delete (if empty)
- Added is_array() check for extra safety
## Changed Files
- includes/class-wc-tpp-product-meta.php
- templates/admin/tier-row.twig
- templates/admin/package-row.twig
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
38 lines
1.3 KiB
Twig
38 lines
1.3 KiB
Twig
{#
|
|
# Admin Tier Row Template
|
|
#
|
|
# @package WC_Tier_Package_Prices
|
|
# @var int index
|
|
# @var array tier
|
|
# @var string field_prefix (optional) - Prefix for field names (for variations)
|
|
#}
|
|
{% set name_prefix = field_prefix is defined ? field_prefix : '_wc_tpp_tiers' %}
|
|
<tr class="wc-tpp-tier-row">
|
|
<td>
|
|
<input type="number"
|
|
name="{{ name_prefix }}[{{ index|esc_attr }}][min_qty]"
|
|
value="{{ tier.min_qty|default('')|esc_attr }}"
|
|
placeholder="{{ 'e.g., 10'|__('wc-tier-package-prices') }}"
|
|
min="1"
|
|
step="1"
|
|
class="short">
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
name="{{ name_prefix }}[{{ index|esc_attr }}][price]"
|
|
value="{{ tier.price|default('')|esc_attr }}"
|
|
placeholder="{{ 'e.g., 9.99 ' ~ currency_symbol }}"
|
|
class="short wc_input_price">
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
name="{{ name_prefix }}[{{ index|esc_attr }}][label]"
|
|
value="{{ tier.label|default('')|esc_attr }}"
|
|
placeholder="{{ 'e.g., Wholesale'|__('wc-tier-package-prices') }}"
|
|
class="regular">
|
|
</td>
|
|
<td>
|
|
<button type="button" class="button wc-tpp-remove-tier">{{ 'Remove'|__('wc-tier-package-prices') }}</button>
|
|
</td>
|
|
</tr>
|