You've already forked wc-tier-and-package-prices
Release version 1.2.0 - Add complete variable product support
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>
This commit is contained in:
@@ -4,33 +4,34 @@
|
||||
# @package WC_Tier_Package_Prices
|
||||
# @var int index
|
||||
# @var array package
|
||||
# @var string field_prefix (optional) - Prefix for field names (for variations)
|
||||
#}
|
||||
<div class="wc-tpp-package-row">
|
||||
<p class="form-field">
|
||||
<label>{{ 'Quantity'|__('wc-tier-package-prices') }}</label>
|
||||
{% set name_prefix = field_prefix is defined ? field_prefix : '_wc_tpp_packages' %}
|
||||
<tr class="wc-tpp-package-row">
|
||||
<td>
|
||||
<input type="number"
|
||||
name="_wc_tpp_packages[{{ index|esc_attr }}][qty]"
|
||||
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">
|
||||
</p>
|
||||
<p class="form-field">
|
||||
<label>{{ 'Fixed Price'|__('wc-tier-package-prices') }}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text"
|
||||
name="_wc_tpp_packages[{{ index|esc_attr }}][price]"
|
||||
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">
|
||||
</p>
|
||||
<p class="form-field">
|
||||
<label>{{ 'Label (Optional)'|__('wc-tier-package-prices') }}</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text"
|
||||
name="_wc_tpp_packages[{{ index|esc_attr }}][label]"
|
||||
name="{{ name_prefix }}[{{ index|esc_attr }}][label]"
|
||||
value="{{ package.label|default('')|esc_attr }}"
|
||||
placeholder="{{ 'e.g., Starter Pack'|__('wc-tier-package-prices') }}"
|
||||
class="regular">
|
||||
</p>
|
||||
<button type="button" class="button wc-tpp-remove-package">{{ 'Remove'|__('wc-tier-package-prices') }}</button>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" class="button wc-tpp-remove-package">{{ 'Remove'|__('wc-tier-package-prices') }}</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user