PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
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 / Settings / Sections / GeneralSection / Subsections / YouSaveSubsection.php

YouSaveSubsection.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Settings/Sections/GeneralSection/Subsections/YouSaveSubsection.php

61 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Settings\Sections\GeneralSection\Subsections;
2
3 use TierPricingTable\Settings\CustomOptions\TPTSwitchOption;
4 use TierPricingTable\Settings\CustomOptions\TPTTextTemplate;
5 use TierPricingTable\Settings\Sections\SubsectionAbstract;
6 use TierPricingTable\Settings\Settings;
7
8 class YouSaveSubsection extends SubsectionAbstract {
9
10 public function getTitle(): string {
11 return __( '"You save" on the product page', 'tier-pricing-table' );
12 }
13
14 public function getDescription(): string {
15 return __( 'Display the amount saved when a discount is applied.',
16 'tier-pricing-table' );
17 }
18
19 public function getSlug(): string {
20 return 'you_save';
21 }
22
23 public function getSettings(): array {
24 return array(
25 array(
26 'title' => __( 'Show "You save" price', 'tier-pricing-table' ),
27 'id' => Settings::SETTINGS_PREFIX . 'you_save_enabled',
28 'type' => TPTSwitchOption::FIELD_TYPE,
29 'default' => 'no',
30 'desc' => __( 'Show the difference between the regular price and a discounted price. You can also show it via the [tiered_price_you_save] shortcode.',
31 'tier-pricing-table' ),
32 ),
33 array(
34 'title' => __( 'Consider sale price as a discount', 'tier-pricing-table' ),
35 'id' => Settings::SETTINGS_PREFIX . 'you_save_consider_sale_price',
36 'type' => TPTSwitchOption::FIELD_TYPE,
37 'default' => 'yes',
38 'desc' => __( 'The difference between the regular and sale price will be included in the “you save” calculation.',
39 'tier-pricing-table' ),
40 ),
41 array(
42 'title' => __( 'Template', 'tier-pricing-table' ),
43 'id' => Settings::SETTINGS_PREFIX . 'you_save_template',
44 'default' => __( 'You save {tp_ys_total_price}', 'tier-pricing-table' ),
45 'placeholders' => array(
46 'tp_ys_price',
47 'tp_ys_total_price',
48 ),
49 'type' => TPTTextTemplate::FIELD_TYPE,
50 ),
51 array(
52 'title' => __( '"You save" price color', 'tier-pricing-table' ),
53 'id' => Settings::SETTINGS_PREFIX . 'you_save_text_color',
54 'type' => 'color',
55 'css' => 'width:6em;',
56 'default' => '#FF0000',
57 ),
58 );
59 }
60 }
61