PluginProbe
Tiered Pricing Table for WooCommerce / 6.4.0
Tiered Pricing Table for WooCommerce v6.4.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 / Addons / YouSave / YouSaveSubsection.php

YouSaveSubsection.php in Tiered Pricing Table for WooCommerce 6.4.0, at src/Addons/YouSave/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\Addons\YouSave;
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" Badge', 'tier-pricing-table' );
12 }
13
14 public function getDescription(): string {
15 return __( 'Show customers exactly how much they save when tiered discounts are applied.', 'tier-pricing-table' );
16 }
17
18 public function getSlug(): string {
19 return 'you_save';
20 }
21
22 public function getSettings(): array {
23 return array(
24 array(
25 'title' => __( 'Enable "You Save" badge', 'tier-pricing-table' ),
26 'id' => Settings::SETTINGS_PREFIX . 'you_save_enabled',
27 'type' => TPTSwitchOption::FIELD_TYPE,
28 'default' => 'yes',
29 'desc' => __( 'Show the difference between the regular price and a discounted price. You can also show it via the [tiered_price_you_save] shortcode.',
30 'tier-pricing-table' ),
31 ),
32 array(
33 'title' => __( 'Include sale price in calculation', 'tier-pricing-table' ),
34 'id' => Settings::SETTINGS_PREFIX . 'you_save_consider_sale_price',
35 'type' => TPTSwitchOption::FIELD_TYPE,
36 'default' => 'yes',
37 'desc' => __( 'The difference between the regular and sale price will be included in the “you save” calculation.',
38 'tier-pricing-table' ),
39 ),
40 array(
41 'title' => __( 'Template', 'tier-pricing-table' ),
42 'id' => Settings::SETTINGS_PREFIX . 'you_save_template',
43 'default' => __( 'You save {tp_ys_total_price} ({tp_ys_percentage_discount}%)', 'tier-pricing-table' ),
44 'placeholders' => array(
45 'tp_ys_price',
46 'tp_ys_total_price',
47 'tp_ys_percentage_discount',
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