| 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 |
|