tier-pricing-table
/
src
/
Settings
/
Sections
/
GeneralSection
/
Subsections
/
CatalogPricesSubsection.php
CatalogPricesSubsection.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Settings/Sections/GeneralSection/Subsections/CatalogPricesSubsection.php
| 1 | <?php namespace TierPricingTable\Settings\Sections\GeneralSection\Subsections; |
| 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 __( 'Price format for products with tiered pricing (in the catalog, widgets, etc.)', |
| 12 | 'tier-pricing-table' ); |
| 13 | } |
| 14 | |
| 15 | public function getDescription(): string { |
| 16 | return __( 'Control how products with tiered pricing will show their prices outside their product pages.', |
| 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' => __( 'Format price', 'tier-pricing-table' ), |
| 28 | 'id' => Settings::SETTINGS_PREFIX . 'tiered_price_at_catalog', |
| 29 | 'type' => TPTSwitchOption::FIELD_TYPE, |
| 30 | 'default' => 'yes', |
| 31 | 'desc' => __( 'Format price based on tiered pricing (show pricing range or minimal price).', |
| 32 | 'tier-pricing-table' ), |
| 33 | 'desc_tip' => true, |
| 34 | ), |
| 35 | array( |
| 36 | 'title' => __( 'Format price 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' => __( 'Format price based on tiered pricing (show pricing range or minimal price) for variable products. Uses the lowest and the highest prices from all variations.', |
| 41 | 'tier-pricing-table' ), |
| 42 | 'desc_tip' => true, |
| 43 | ), |
| 44 | array( |
| 45 | 'title' => __( 'Display price as', '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 how to display tiered pricing: show only the lowest price or the full price range.', 'tier-pricing-table' ), |
| 54 | 'desc_tip' => true, |
| 55 | ), |
| 56 | array( |
| 57 | 'title' => __( 'The lowest price prefix', 'tier-pricing-table' ), |
| 58 | 'id' => Settings::SETTINGS_PREFIX . 'lowest_prefix', |
| 59 | 'type' => 'text', |
| 60 | 'default' => __( 'From', 'tier-pricing-table' ), |
| 61 | 'desc' => __( 'Enter a prefix that will be shown before the lowest price. For example, it can look like this: <b>From $10.00</b>', |
| 62 | 'tier-pricing-table' ), |
| 63 | ), |
| 64 | ); |
| 65 | } |
| 66 | } |
| 67 |