| 1 |
<?php namespace TierPricingTable\Addons\PricingSummary; |
| 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 SummarySubsection extends SubsectionAbstract { |
| 9 |
|
| 10 |
public function getTitle(): string { |
| 11 |
return __( 'Pricing Summary', 'tier-pricing-table' ); |
| 12 |
} |
| 13 |
|
| 14 |
public function getDescription(): string { |
| 15 |
return __( 'Show a summary block with total cost and unit price details.', 'tier-pricing-table' ); |
| 16 |
} |
| 17 |
|
| 18 |
public function getSlug(): string { |
| 19 |
return 'summary'; |
| 20 |
} |
| 21 |
|
| 22 |
public function getSettings(): array { |
| 23 |
return array( |
| 24 |
array( |
| 25 |
'title' => __( 'Enable pricing summary', 'tier-pricing-table' ), |
| 26 |
'id' => Settings::SETTINGS_PREFIX . 'display_summary', |
| 27 |
'type' => TPTSwitchOption::FIELD_TYPE, |
| 28 |
'default' => 'yes', |
| 29 |
'desc_tip' => true, |
| 30 |
), |
| 31 |
array( |
| 32 |
'title' => __( 'Title', 'tier-pricing-table' ), |
| 33 |
'id' => Settings::SETTINGS_PREFIX . 'summary_title', |
| 34 |
'type' => 'text', |
| 35 |
'desc' => __( 'The name is displaying above the summary block.', 'tier-pricing-table' ), |
| 36 |
'desc_tip' => true, |
| 37 |
'default' => '', |
| 38 |
), |
| 39 |
array( |
| 40 |
'title' => __( 'Position on product page', 'tier-pricing-table' ), |
| 41 |
'id' => Settings::SETTINGS_PREFIX . 'summary_position_hook', |
| 42 |
'type' => 'select', |
| 43 |
'options' => array( |
| 44 |
'woocommerce_before_add_to_cart_button' => __( 'Above buy button', 'tier-pricing-table' ), |
| 45 |
'woocommerce_after_add_to_cart_button' => __( 'Below buy button', 'tier-pricing-table' ), |
| 46 |
'woocommerce_before_add_to_cart_form' => __( 'Above add to cart form', 'tier-pricing-table' ), |
| 47 |
'woocommerce_after_add_to_cart_form' => __( 'Below add to cart form', 'tier-pricing-table' ), |
| 48 |
'woocommerce_single_product_summary' => __( 'Above product title', 'tier-pricing-table' ), |
| 49 |
'woocommerce_before_single_product_summary' => __( 'Before product summary', 'tier-pricing-table' ), |
| 50 |
'woocommerce_after_single_product_summary' => __( 'After product summary', 'tier-pricing-table' ), |
| 51 |
), |
| 52 |
'default' => 'woocommerce_after_add_to_cart_button', |
| 53 |
'desc' => __( 'Where to display the summary block.', 'tier-pricing-table' ), |
| 54 |
'desc_tip' => true, |
| 55 |
), |
| 56 |
array( |
| 57 |
'title' => __( 'Totals template', 'tier-pricing-table' ), |
| 58 |
'id' => Settings::SETTINGS_PREFIX . 'summary_type', |
| 59 |
'type' => TPTDisplayType::FIELD_TYPE, |
| 60 |
'options' => array( |
| 61 |
'detailed' => __( 'Detailed', 'tier-pricing-table' ), |
| 62 |
'table' => __( 'Reduced', 'tier-pricing-table' ), |
| 63 |
'inline' => __( 'Labels', 'tier-pricing-table' ), |
| 64 |
), |
| 65 |
'default' => 'table', |
| 66 |
), |
| 67 |
array( |
| 68 |
'title' => __( '"Total" label', 'tier-pricing-table' ), |
| 69 |
'id' => Settings::SETTINGS_PREFIX . 'summary_total_label', |
| 70 |
'type' => 'text', |
| 71 |
'default' => __( 'Total:', 'tier-pricing-table' ), |
| 72 |
'desc_tip' => true, |
| 73 |
), |
| 74 |
array( |
| 75 |
'title' => __( '"Each" label', 'tier-pricing-table' ), |
| 76 |
'id' => Settings::SETTINGS_PREFIX . 'summary_each_label', |
| 77 |
'type' => 'text', |
| 78 |
'default' => __( 'Each: ', 'tier-pricing-table' ), |
| 79 |
'desc_tip' => true, |
| 80 |
), |
| 81 |
); |
| 82 |
} |
| 83 |
} |
| 84 |
|