| 1 |
<?php namespace TierPricingTable\Addons\CatalogPrices; |
| 2 |
|
| 3 |
use TierPricingTable\Settings\CustomOptions\TPTDisplayType; |
| 4 |
use TierPricingTable\Settings\CustomOptions\TPTSwitchOption; |
| 5 |
use TierPricingTable\Settings\Sections\SubsectionAbstract; |
| 6 |
use TierPricingTable\Settings\Settings; |
| 7 |
|
| 8 |
class CatalogPricesSubsection extends SubsectionAbstract { |
| 9 |
|
| 10 |
public function getTitle(): string { |
| 11 |
return __( 'Catalog Price Format', |
| 12 |
'tier-pricing-table' ); |
| 13 |
} |
| 14 |
|
| 15 |
public function getDescription(): string { |
| 16 |
return __( 'Manage how tiered pricing appears in catalogs, loops, and widgets.', |
| 17 |
'tier-pricing-table' ); |
| 18 |
} |
| 19 |
|
| 20 |
public function getSlug(): string { |
| 21 |
return 'catalog_prices'; |
| 22 |
} |
| 23 |
|
| 24 |
public function getSettings(): array { |
| 25 |
return array( |
| 26 |
array( |
| 27 |
'title' => __( 'Enable tiered format', 'tier-pricing-table' ), |
| 28 |
'id' => Settings::SETTINGS_PREFIX . 'tiered_price_at_catalog', |
| 29 |
'type' => TPTSwitchOption::FIELD_TYPE, |
| 30 |
'default' => 'yes', |
| 31 |
'desc' => __( 'Display the lowest tiered price or a price range instead of the standard product price.', |
| 32 |
'tier-pricing-table' ), |
| 33 |
'desc_tip' => true, |
| 34 |
), |
| 35 |
array( |
| 36 |
'title' => __( 'Enable for variable products', 'tier-pricing-table' ), |
| 37 |
'id' => Settings::SETTINGS_PREFIX . 'tiered_price_at_catalog_for_variable', |
| 38 |
'type' => TPTSwitchOption::FIELD_TYPE, |
| 39 |
'default' => 'no', |
| 40 |
'desc' => __( 'Apply the tiered format to variable products, using the lowest and highest prices across all variations.', |
| 41 |
'tier-pricing-table' ), |
| 42 |
'desc_tip' => true, |
| 43 |
), |
| 44 |
array( |
| 45 |
'title' => __( 'Display format', 'tier-pricing-table' ), |
| 46 |
'id' => Settings::SETTINGS_PREFIX . 'tiered_price_at_catalog_type', |
| 47 |
'type' => TPTDisplayType::FIELD_TYPE, |
| 48 |
'options' => [ |
| 49 |
'lowest' => __( 'Show lowest price', 'tier-pricing-table' ), |
| 50 |
'range' => __( 'Show range (lowest to highest)', 'tier-pricing-table' ), |
| 51 |
], |
| 52 |
'default' => 'lowest', |
| 53 |
'desc' => __( 'Choose whether to show only the lowest available price or the full price range.', 'tier-pricing-table' ), |
| 54 |
'desc_tip' => true, |
| 55 |
), |
| 56 |
array( |
| 57 |
'title' => __( 'Lowest price prefix', 'tier-pricing-table' ), |
| 58 |
'id' => Settings::SETTINGS_PREFIX . 'lowest_prefix', |
| 59 |
'type' => 'text', |
| 60 |
'default' => __( 'From', 'tier-pricing-table' ), |
| 61 |
'desc' => __( 'Text displayed before the lowest price (e.g., <b>From $10.00</b>).', |
| 62 |
'tier-pricing-table' ), |
| 63 |
), |
| 64 |
); |
| 65 |
} |
| 66 |
} |
| 67 |
|