| 1 |
<?php namespace TierPricingTable\Addons\NonLoggedInUsers\CartRules; |
| 2 |
|
| 3 |
use TierPricingTable\Settings\CustomOptions\TPTSwitchOption; |
| 4 |
use TierPricingTable\Settings\Sections\SubsectionAbstract; |
| 5 |
|
| 6 |
class CartRulesSubsection extends SubsectionAbstract { |
| 7 |
|
| 8 |
public function getTitle(): string { |
| 9 |
return __( 'Cart rules by role', 'tier-pricing-table' ); |
| 10 |
} |
| 11 |
|
| 12 |
public function getDescription(): string { |
| 13 |
return __( 'A minimum order amount or quantity for the whole cart per role, and payment or shipping methods limited to roles (the two groups below). Guests count as a role; a customer with several roles gets the strictest minimum. Off by default.', 'tier-pricing-table' ); |
| 14 |
} |
| 15 |
|
| 16 |
public function getSlug(): string { |
| 17 |
return 'cart-rules'; |
| 18 |
} |
| 19 |
|
| 20 |
public function getSettings(): array { |
| 21 |
return array( |
| 22 |
array( |
| 23 |
'title' => __( 'Cart rules by role', 'tier-pricing-table' ), |
| 24 |
'id' => CartRulesSettings::optionId( 'enabled' ), |
| 25 |
'type' => TPTSwitchOption::FIELD_TYPE, |
| 26 |
'default' => 'no', |
| 27 |
'desc' => __( 'Applies the minimums below and the payment and shipping method limits of the next two groups in the cart and at checkout, for the classic pages and the blocks.', 'tier-pricing-table' ), |
| 28 |
), |
| 29 |
array( |
| 30 |
'title' => __( 'Minimum order', 'tier-pricing-table' ), |
| 31 |
'id' => CartRulesSettings::optionId( 'minimums' ), |
| 32 |
'type' => RoleMinimumsOption::FIELD_TYPE, |
| 33 |
'desc' => __( 'Leave a cell empty for no minimum. The amount is the cart subtotal after tiered prices, before shipping.', 'tier-pricing-table' ), |
| 34 |
), |
| 35 |
array( |
| 36 |
'title' => __( 'Amount message', 'tier-pricing-table' ), |
| 37 |
'id' => CartRulesSettings::optionId( 'amount_message' ), |
| 38 |
'type' => 'text', |
| 39 |
'default' => CartRulesSettings::defaultAmountMessage(), |
| 40 |
'desc' => __( 'Placeholders: {minimum}, {subtotal}.', 'tier-pricing-table' ), |
| 41 |
), |
| 42 |
array( |
| 43 |
'title' => __( 'Quantity message', 'tier-pricing-table' ), |
| 44 |
'id' => CartRulesSettings::optionId( 'quantity_message' ), |
| 45 |
'type' => 'text', |
| 46 |
'default' => CartRulesSettings::defaultQuantityMessage(), |
| 47 |
'desc' => __( 'Placeholders: {minimum}, {count}.', 'tier-pricing-table' ), |
| 48 |
), |
| 49 |
); |
| 50 |
} |
| 51 |
} |
| 52 |
|