2025-12-21 04:56:50 +01:00
|
|
|
{#
|
|
|
|
|
# Frontend Tier Pricing Table Template
|
|
|
|
|
#
|
|
|
|
|
# @package WC_Tier_Package_Prices
|
|
|
|
|
# @var object product
|
|
|
|
|
# @var array tiers
|
|
|
|
|
#}
|
|
|
|
|
<div class="wc-tpp-tier-pricing-table">
|
|
|
|
|
<h3>{{ 'Volume Discounts'|__('wc-tier-package-prices') }}</h3>
|
|
|
|
|
<table class="wc-tpp-table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>{{ 'Quantity'|__('wc-tier-package-prices') }}</th>
|
|
|
|
|
<th>{{ 'Price per Unit'|__('wc-tier-package-prices') }}</th>
|
|
|
|
|
<th>{{ 'You Save'|__('wc-tier-package-prices') }}</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% set regular_price = product.get_regular_price() %}
|
|
|
|
|
{% for tier in tiers %}
|
|
|
|
|
{% set savings = 0 %}
|
|
|
|
|
{% set savings_percent = 0 %}
|
|
|
|
|
{% if regular_price > 0 %}
|
|
|
|
|
{% set savings = regular_price - tier.price %}
|
|
|
|
|
{% set savings_percent = (savings / regular_price) * 100 %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<tr data-min-qty="{{ tier.min_qty|esc_attr }}" data-price="{{ tier.price|esc_attr }}">
|
2025-12-22 00:15:48 +01:00
|
|
|
<td>
|
|
|
|
|
{{ tier.min_qty|esc_html }}+
|
|
|
|
|
{% if tier.label is defined and tier.label is not empty %}
|
|
|
|
|
<br><small class="wc-tpp-tier-label">{{ tier.label|esc_html }}</small>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</td>
|
2025-12-21 04:56:50 +01:00
|
|
|
<td>{{ wc_price(tier.price)|raw }}</td>
|
|
|
|
|
<td>
|
|
|
|
|
{% if savings > 0 %}
|
|
|
|
|
{{ wc_price(savings)|raw }} ({{ savings_percent|round(2) }}%)
|
|
|
|
|
{% else %}
|
|
|
|
|
-
|
|
|
|
|
{% endif %}
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|