PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.1
Tiered Pricing Table for WooCommerce v7.1.1
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 / CartUpsells / UpsellsSubsection.php

UpsellsSubsection.php in Tiered Pricing Table for WooCommerce 7.1.1, at src/Addons/CartUpsells/UpsellsSubsection.php

61 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\CartUpsells;
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 UpsellsSubsection extends SubsectionAbstract {
9
10 public function getTitle(): string {
11 return __( 'Cart Upsell Messages', 'tier-pricing-table' );
12 }
13
14 public function getDescription(): string {
15 return __( 'Display targeted messages in the cart to encourage customers to reach the next discount tier.',
16 'tier-pricing-table' );
17 }
18
19 public function getSlug(): string {
20 return 'cart-upsells';
21 }
22
23 public function getSettings(): array {
24 return array(
25 array(
26 'title' => __( 'Enable cart upsells', 'tier-pricing-table' ),
27 'id' => Settings::SETTINGS_PREFIX . 'cart_upsell_enabled',
28 'type' => TPTSwitchOption::FIELD_TYPE,
29 'default' => 'no',
30 'desc_tip' => false,
31 ),
32
33 array(
34 'title' => __( 'Template', 'tier-pricing-table' ),
35 'id' => Settings::SETTINGS_PREFIX . 'cart_upsell_template',
36 'type' => TPTTextTemplate::FIELD_TYPE,
37 'placeholders' => array(
38 'tp_required_quantity',
39 'tp_next_price',
40 'tp_next_discount',
41 'tp_actual_discount',
42 ),
43 'default' => __( 'Buy <b>{tp_required_quantity}</b> more to get <b>{tp_next_price}</b> each',
44 'tier-pricing-table' ),
45 'desc_tip' => false,
46 ),
47
48 array(
49 'title' => __( 'Upsell text color', 'tier-pricing-table' ),
50 'id' => Settings::SETTINGS_PREFIX . 'cart_upsell_color',
51 'type' => 'color',
52 'default' => '#3858e9',
53 'css' => 'width:6em;',
54 'desc_tip' => false,
55 'desc' => __( 'Note: This feature is not compatible with the Gutenberg Cart/Checkout blocks.',
56 'tier-pricing-table' ),
57 ),
58 );
59 }
60 }
61