tier-pricing-table
/
src
/
Settings
/
Sections
/
GeneralSection
/
Subsections
/
UpsellsSubsection.php
UpsellsSubsection.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Settings/Sections/GeneralSection/Subsections/UpsellsSubsection.php
| 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 UpsellsSubsection extends SubsectionAbstract { |
| 9 | |
| 10 | public function getTitle(): string { |
| 11 | return __( 'Cart upsells', 'tier-pricing-table' ); |
| 12 | } |
| 13 | |
| 14 | public function getDescription(): string { |
| 15 | return __( 'Use cart upsell messages to encourage customers to buy more by displaying available discounts.', |
| 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' => __( 'Enabled', '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 | 'desc' => __( 'Note: This feature is not compatible with the Gutenberg Cart/Checkout blocks.', |
| 47 | 'tier-pricing-table' ), |
| 48 | ), |
| 49 | |
| 50 | array( |
| 51 | 'title' => __( 'Upsell text color', 'tier-pricing-table' ), |
| 52 | 'id' => Settings::SETTINGS_PREFIX . 'cart_upsell_color', |
| 53 | 'type' => 'color', |
| 54 | 'default' => '#96598A', |
| 55 | 'css' => 'width:6em;', |
| 56 | 'desc_tip' => false, |
| 57 | ), |
| 58 | ); |
| 59 | } |
| 60 | } |
| 61 |