| 1 |
<?php |
| 2 |
|
| 3 |
use TierPricingTable\Addons\RoleBasedPricing\RoleBasedPricingRule; |
| 4 |
use TierPricingTable\Core\ServiceContainer; |
| 5 |
use TierPricingTable\Forms\MinimumOrderQuantityForm; |
| 6 |
use TierPricingTable\Forms\RegularPricingForm; |
| 7 |
use TierPricingTable\Forms\TieredPricingRulesForm; |
| 8 |
|
| 9 |
if ( ! defined( 'WPINC' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
/** |
| 14 |
* Available variables |
| 15 |
* |
| 16 |
* @var WC_Product $product |
| 17 |
* @var RoleBasedPricingRule $pricing_rule |
| 18 |
* @var int $loop |
| 19 |
*/ |
| 20 |
|
| 21 |
$fileManager = ServiceContainer::getInstance()->getFileManager(); |
| 22 |
|
| 23 |
?> |
| 24 |
|
| 25 |
<?php if ( ! tpt_fs()->can_use_premium_code() ) : ?> |
| 26 |
<p style="color: red"> |
| 27 |
<?php esc_html_e( 'Available only in the premium version.', 'tier-pricing-table' ); ?> |
| 28 |
<a target="_blank" href="<?php echo esc_attr( tpt_fs_activation_url() ); ?>"> |
| 29 |
<?php esc_html_e( 'Upgrade your plan', 'tier-pricing-table' ); ?> |
| 30 |
</a> |
| 31 |
</p> |
| 32 |
<?php endif; ?> |
| 33 |
|
| 34 |
<?php |
| 35 |
if ( ! $product->is_type( 'variable' ) ) { |
| 36 |
RegularPricingForm::render( $pricing_rule->getRole(), $loop, $pricing_rule->getRegularPrice(), |
| 37 |
$pricing_rule->getSalePrice(), $pricing_rule->getPricingType(), $pricing_rule->getDiscount(), |
| 38 |
$pricing_rule->getDiscountType() ); |
| 39 |
?> |
| 40 |
<hr style="border-color: #f5f5f5;border-top: none;"> |
| 41 |
<?php |
| 42 |
} |
| 43 |
|
| 44 |
MinimumOrderQuantityForm::render( $pricing_rule->getRole(), $loop, $pricing_rule->getMinimumOrderQuantity() ); |
| 45 |
|
| 46 |
do_action( 'tiered_pricing_table/admin/role_based_rules/after_minimum_order_quantity_field', |
| 47 |
$pricing_rule->getProductId(), $pricing_rule->getRole(), $loop ); |
| 48 |
|
| 49 |
?> |
| 50 |
<hr style="border-color: #f5f5f5;border-top: none;"> |
| 51 |
<?php |
| 52 |
|
| 53 |
TieredPricingRulesForm::render( $pricing_rule->getProductId(), $pricing_rule->getRole(), $loop, |
| 54 |
$pricing_rule->getTieredPricingType(), $pricing_rule->getPercentageTieredPricingRules(), |
| 55 |
$pricing_rule->getFixedTieredPricingRules() ); |
| 56 |
?> |
| 57 |
|