You've already forked wc-tier-and-package-prices
This major feature release adds full support for WooCommerce variable products with variation-level pricing configuration. ## Key Features - Each product variation can have independent tier and package pricing - AJAX-based dynamic pricing table loading on variation selection - Admin UI integrated into WooCommerce variation panels - Full backward compatibility with existing simple product functionality - WooCommerce Blocks compatibility maintained ## Implementation Highlights - Effective ID pattern throughout codebase for variation handling - Variation-specific meta boxes with field prefix support - Template system updated to support both simple and variation products - JavaScript enhancements for variation selector integration - Cart logic updated to handle variation pricing correctly ## Files Changed - Core: wc-tier-and-package-prices.php (version 1.2.0), composer.json - Cart: includes/class-wc-tpp-cart.php (effective ID logic) - Frontend: includes/class-wc-tpp-frontend.php (AJAX endpoint, variation detection) - Admin: includes/class-wc-tpp-product-meta.php (variation hooks and methods) - Templates: templates/admin/*.twig (field prefix support, table structure) - JavaScript: assets/js/*.js (variation support) - Documentation: CHANGELOG.md, README.md, CLAUDE.md 🤖 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'|__('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>
|