PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.5
Tiered Pricing Table for WooCommerce v7.1.5
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / src / Addons / PricingSummary / SummarySubsection.php

SummarySubsection.php in Tiered Pricing Table for WooCommerce 7.1.5, at src/Addons/PricingSummary/SummarySubsection.php

91 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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' => __( 'Show pricing summary block', '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' => __( 'Show for standard products (non-tiered)', 'tier-pricing-table' ),
33 'id' => Settings::SETTINGS_PREFIX . 'display_summary_non_tiered',
34 'type' => TPTSwitchOption::FIELD_TYPE,
35 'default' => 'no',
36 'desc' => __( 'Display the pricing summary block for regular WooCommerce products even if they don\'t have tiered pricing rules.', 'tier-pricing-table' ),
37 ),
38 array(
39 'title' => __( 'Summary block title', 'tier-pricing-table' ),
40 'id' => Settings::SETTINGS_PREFIX . 'summary_title',
41 'type' => 'text',
42 'desc' => __( 'The name is displaying above the summary block.', 'tier-pricing-table' ),
43 'desc_tip' => true,
44 'default' => '',
45 ),
46 array(
47 'title' => __( 'Block position', 'tier-pricing-table' ),
48 'id' => Settings::SETTINGS_PREFIX . 'summary_position_hook',
49 'type' => 'select',
50 'options' => array(
51 'woocommerce_before_add_to_cart_button' => __( 'Above buy button', 'tier-pricing-table' ),
52 'woocommerce_after_add_to_cart_button' => __( 'Below buy button', 'tier-pricing-table' ),
53 'woocommerce_before_add_to_cart_form' => __( 'Above add to cart form', 'tier-pricing-table' ),
54 'woocommerce_after_add_to_cart_form' => __( 'Below add to cart form', 'tier-pricing-table' ),
55 'woocommerce_single_product_summary' => __( 'Above product title', 'tier-pricing-table' ),
56 'woocommerce_before_single_product_summary' => __( 'Before product summary', 'tier-pricing-table' ),
57 'woocommerce_after_single_product_summary' => __( 'After product summary', 'tier-pricing-table' ),
58 ),
59 'default' => 'woocommerce_after_add_to_cart_button',
60 'desc' => __( 'Where to display the summary block.', 'tier-pricing-table' ),
61 'desc_tip' => true,
62 ),
63 array(
64 'title' => __( 'Summary layout', 'tier-pricing-table' ),
65 'id' => Settings::SETTINGS_PREFIX . 'summary_type',
66 'type' => TPTDisplayType::FIELD_TYPE,
67 'options' => array(
68 'detailed' => __( 'Detailed', 'tier-pricing-table' ),
69 'table' => __( 'Compact', 'tier-pricing-table' ),
70 'inline' => __( 'Inline labels', 'tier-pricing-table' ),
71 ),
72 'default' => 'table',
73 ),
74 array(
75 'title' => __( '"Total" label', 'tier-pricing-table' ),
76 'id' => Settings::SETTINGS_PREFIX . 'summary_total_label',
77 'type' => 'text',
78 'default' => __( 'Total:', 'tier-pricing-table' ),
79 'desc_tip' => true,
80 ),
81 array(
82 'title' => __( '"Each" label', 'tier-pricing-table' ),
83 'id' => Settings::SETTINGS_PREFIX . 'summary_each_label',
84 'type' => 'text',
85 'default' => __( 'Each: ', 'tier-pricing-table' ),
86 'desc_tip' => true,
87 ),
88 );
89 }
90 }
91