# tier-pricing-table/6.5.0/src/Addons/YouSave/YouSaveSubsection.php

Tiered Pricing Table for WooCommerce, version 6.5.0. 61 lines.

- Page: https://pluginprobe.com/plugins/tier-pricing-table/6.5.0/code/src/Addons/YouSave/YouSaveSubsection.php
- Raw: https://pluginprobe.com/plugins/tier-pricing-table/6.5.0/raw/src/Addons/YouSave/YouSaveSubsection.php
- Modified: 2026-06-26T14:29:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tier-pricing-table/6.5.0/code/src/Addons/YouSave/YouSaveSubsection.php#L10-L20`.

```php
<?php namespace TierPricingTable\Addons\YouSave;

use TierPricingTable\Settings\CustomOptions\TPTSwitchOption;
use TierPricingTable\Settings\CustomOptions\TPTTextTemplate;
use TierPricingTable\Settings\Sections\SubsectionAbstract;
use TierPricingTable\Settings\Settings;

class YouSaveSubsection extends SubsectionAbstract {
	
	public function getTitle(): string {
		return __( '"You Save" Badge', 'tier-pricing-table' );
	}
	
	public function getDescription(): string {
		return __( 'Show customers exactly how much they save when tiered discounts are applied.', 'tier-pricing-table' );
	}
	
	public function getSlug(): string {
		return 'you_save';
	}
	
	public function getSettings(): array {
		return array(
			array(
				'title'   => __( 'Enable "You Save" badge', 'tier-pricing-table' ),
				'id'      => Settings::SETTINGS_PREFIX . 'you_save_enabled',
				'type'    => TPTSwitchOption::FIELD_TYPE,
				'default' => 'yes',
				'desc'    => __( 'Show the difference between the regular price and a discounted price. You can also show it via the [tiered_price_you_save] shortcode.',
					'tier-pricing-table' ),
			),
			array(
				'title'   => __( 'Include sale price in calculation', 'tier-pricing-table' ),
				'id'      => Settings::SETTINGS_PREFIX . 'you_save_consider_sale_price',
				'type'    => TPTSwitchOption::FIELD_TYPE,
				'default' => 'yes',
				'desc'    => __( 'The difference between the regular and sale price will be included in the “you save” calculation.',
					'tier-pricing-table' ),
			),
			array(
				'title'        => __( 'Template', 'tier-pricing-table' ),
				'id'           => Settings::SETTINGS_PREFIX . 'you_save_template',
				'default'      => __( 'You save {tp_ys_total_price} ({tp_ys_percentage_discount}%)', 'tier-pricing-table' ),
				'placeholders' => array(
					'tp_ys_price',
					'tp_ys_total_price',
					'tp_ys_percentage_discount',
				),
				'type'         => TPTTextTemplate::FIELD_TYPE,
			),
			array(
				'title'   => __( '"You save" price color', 'tier-pricing-table' ),
				'id'      => Settings::SETTINGS_PREFIX . 'you_save_text_color',
				'type'    => 'color',
				'css'     => 'width:6em;',
				'default' => '#FF0000',
			),
		);
	}
}

```
