| 1 |
<?php namespace TierPricingTable\Addons\GlobalTieredPricing\CPT\Form\Tabs; |
| 2 |
|
| 3 |
use TierPricingTable\Addons\GlobalTieredPricing\CPT\Form\FormTab; |
| 4 |
use TierPricingTable\Addons\GlobalTieredPricing\GlobalPricingRule; |
| 5 |
use TierPricingTable\Forms\MinimumOrderQuantityForm; |
| 6 |
|
| 7 |
class Quantity extends FormTab { |
| 8 |
|
| 9 |
public function getId(): string { |
| 10 |
return 'quantity'; |
| 11 |
} |
| 12 |
|
| 13 |
public function getTitle(): string { |
| 14 |
return __( 'Quantity limits', 'tier-pricing-table' ); |
| 15 |
} |
| 16 |
|
| 17 |
public function getDescription(): string { |
| 18 |
return __( 'Specify the minimum, maximum, and quantity step for products.', 'tier-pricing-table' ); |
| 19 |
} |
| 20 |
|
| 21 |
public function render( GlobalPricingRule $pricingRule ) { |
| 22 |
|
| 23 |
$this->renderSectionTitle( __( 'Quantity Limits', 'tier-pricing-table' ), array( |
| 24 |
'only_for_premium' => true, |
| 25 |
) ); |
| 26 |
|
| 27 |
$this->renderHint( __( 'Quantity rules are applied to each product individually.', 'tier-pricing-table' ) ); |
| 28 |
|
| 29 |
MinimumOrderQuantityForm::render( null, null, $pricingRule->getMinimum() ); |
| 30 |
|
| 31 |
do_action( 'tiered_pricing_table/global_pricing/after_minimum_order_quantity_field', $pricingRule->getId(), |
| 32 |
$pricingRule ); |
| 33 |
?> |
| 34 |
<?php |
| 35 |
} |
| 36 |
|
| 37 |
public function getIcon(): string { |
| 38 |
return 'dashicons-database'; |
| 39 |
} |
| 40 |
} |
| 41 |
|