You've already forked wc-tier-and-package-prices
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>
38 lines
1.4 KiB
Twig
38 lines
1.4 KiB
Twig
{#
|
|
# Admin Package Row Template
|
|
#
|
|
# @package WC_Tier_Package_Prices
|
|
# @var int index
|
|
# @var array package
|
|
# @var string field_prefix (optional) - Prefix for field names (for variations)
|
|
#}
|
|
{% set name_prefix = field_prefix is defined ? field_prefix : '_wc_tpp_packages' %}
|
|
<tr class="wc-tpp-package-row">
|
|
<td>
|
|
<input type="number"
|
|
name="{{ name_prefix }}[{{ index|esc_attr }}][qty]"
|
|
value="{{ package.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="{{ package.price|default('')|esc_attr }}"
|
|
placeholder="{{ ('e.g., 99.99 ' ~ currency_symbol)|__('wc-tier-package-prices') }}"
|
|
class="short wc_input_price">
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
name="{{ name_prefix }}[{{ index|esc_attr }}][label]"
|
|
value="{{ package.label|default('')|esc_attr }}"
|
|
placeholder="{{ 'e.g., Starter Pack'|__('wc-tier-package-prices') }}"
|
|
class="regular">
|
|
</td>
|
|
<td>
|
|
<button type="button" class="button wc-tpp-remove-package">{{ 'Remove'|__('wc-tier-package-prices') }}</button>
|
|
</td>
|
|
</tr>
|