PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / trunk
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress vtrunk
4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / src / Admin / SettingsPages / Membership / PaymentSettings.php
wp-user-avatar / src / Admin / SettingsPages / Membership Last commit date
CouponsPage 1 year ago CustomersPage 5 months ago DashboardPage 1 year ago DownloadLogsPage 1 year ago ExportPage 5 months ago GroupsPage 1 year ago OrdersPage 1 year ago PlansPage 2 months ago SubscriptionsPage 3 months ago TaxSettings 3 years ago views 1 month ago CheckListHeader.php 3 years ago CheckoutFieldsManager.php 1 year ago ContextualStateChangeHelper.php 3 years ago FileDownloads.php 3 years ago PaymentMethods.php 1 year ago PaymentSettings.php 1 month ago PlanIntegrationsMetabox.php 10 months ago SettingsFieldsParser.php 1 year ago index.php 3 years ago
PaymentSettings.php
183 lines
1 <?php
2
3 namespace ProfilePress\Core\Admin\SettingsPages\Membership;
4
5 use ProfilePress\Core\Admin\SettingsPages\AbstractSettingsPage;
6 use ProfilePress\Core\Classes\ExtensionManager;
7 use ProfilePress\Core\Membership\CheckoutFields;
8 use ProfilePress\Custom_Settings_Page_Api;
9
10 class PaymentSettings extends AbstractSettingsPage
11 {
12 public $settingsPageInstance;
13
14 public function __construct()
15 {
16 add_filter('ppress_settings_page_tabs', [$this, 'header_menu_tab']);
17 add_filter('ppress_settings_page_submenus_tabs', [$this, 'header_sub_menu_tab']);
18 add_action('ppress_admin_settings_submenu_page_payments_settings', [$this, 'settings_page']);
19 }
20
21 public function header_menu_tab($tabs)
22 {
23 $tabs[35] = ['id' => 'payments', 'url' => add_query_arg('view', 'payments', PPRESS_SETTINGS_SETTING_PAGE), 'label' => esc_html__('Payments', 'wp-user-avatar')];
24
25 return $tabs;
26 }
27
28 public function header_sub_menu_tab($tabs)
29 {
30 $tabs[172] = ['parent' => 'payments', 'id' => 'settings', 'label' => esc_html__('Settings', 'wp-user-avatar')];
31
32 return $tabs;
33 }
34
35 public function settings_page()
36 {
37 $page_header = esc_html__('Payment Settings', 'wp-user-avatar');
38
39 $currency_code_options = ppress_get_currencies();
40
41 foreach ($currency_code_options as $code => $name) {
42 $currency_code_options[$code] = $name . ' (' . ppress_get_currency_symbol($code) . ')';
43 }
44
45 $settings = [
46 [
47 'section_title' => esc_html__('Currency Settings', 'wp-user-avatar'),
48 'payment_currency' => [
49 'label' => esc_html__('Currency', 'wp-user-avatar'),
50 'description' => esc_html__('Choose your currency. Note that some payment gateways have currency restrictions.', 'wp-user-avatar'),
51 'type' => 'select',
52 'options' => $currency_code_options
53 ],
54 'currency_position' => [
55 'label' => esc_html__('Currency Position', 'wp-user-avatar'),
56 'description' => esc_html__('The position of the currency symbol.', 'wp-user-avatar'),
57 'type' => 'select',
58 'options' => [
59 'left' => 'Left (' . sprintf('%1$s%2$s', ppress_get_currency_symbol(), 99.99) . ')',
60 'right' => 'Right (' . sprintf('%2$s%1$s', ppress_get_currency_symbol(), 99.99) . ')',
61 'left_space' => 'Left with Space (' . sprintf('%1$s&nbsp;%2$s', ppress_get_currency_symbol(), 99.99) . ')',
62 'right_space' => 'Right with Space (' . sprintf('%2$s&nbsp;%1$s', ppress_get_currency_symbol(), 99.99) . ')',
63 ]
64 ],
65 'currency_decimal_separator' => [
66 'label' => esc_html__('Decimal Separator', 'wp-user-avatar'),
67 'type' => 'select',
68 'options' => [
69 '.' => 'Period (12.50)',
70 ',' => 'Comma (12,50)'
71 ],
72 ],
73 'currency_thousand_separator' => [
74 'label' => esc_html__('Thousand Separator', 'wp-user-avatar'),
75 'type' => 'select',
76 'options' => [
77 ',' => __('Comma (10,000)', 'wp-user-avatar'),
78 '.' => __('Period (10.000)', 'wp-user-avatar'),
79 ' ' => __('Space (10 000)', 'wp-user-avatar'),
80 'none' => __('None', 'wp-user-avatar')
81 ],
82 ],
83 'currency_decimal_number' => [
84 'label' => esc_html__('Number of Decimals', 'wp-user-avatar'),
85 'type' => 'select',
86 'options' => [
87 '0' => '0',
88 '1' => '1',
89 '2' => '2',
90 '3' => '3',
91 '4' => '4',
92 '5' => '5',
93 '6' => '6',
94 '7' => '7',
95 '8' => '8',
96 ]
97 ]
98 ],
99 [
100 'section_title' => esc_html__('Checkout Settings', 'wp-user-avatar'),
101 'one_time_trial' => [
102 'label' => esc_html__('One Time Trials', 'wp-user-avatar'),
103 'description' => esc_html__('Check this if you will like customers to be prevented from using the free trial of a plan multiple times.', 'wp-user-avatar'),
104 'type' => 'checkbox'
105 ],
106 'terms_agreement_label' => [
107 'label' => esc_html__('Terms & Conditions Label', 'wp-user-avatar'),
108 'description' => sprintf(
109 esc_html__('Label for the "Agree to Terms" checkbox where "[terms]" is a link to the %sterms and condition page%s', 'wp-user-avatar'),
110 '<a href="' . PPRESS_SETTINGS_SETTING_GENERAL_PAGE . '#global_pages?terms_page_id_row" target="_blank">', '</a>'
111 ),
112 'type' => 'text'
113 ],
114 'proration_method' => [
115 'label' => esc_html__('Proration Method', 'wp-user-avatar'),
116 'description' => sprintf(
117 esc_html__('Specify how to calculate proration for subscription downgrades and upgrades. %sCost-based calculation is where the value of an upgrade is calculated based on the cost difference between the current and new membership plans. %sTime-based calculation is true proration in which the amount of time remaining on the current subscription plan is calculated to adjust the cost of the new subscription.', 'wp-user-avatar'),
118 '</p><p class="description">', '</p><p class="description">'
119 ),
120 'type' => 'select',
121 'options' => [
122 'cost-based' => esc_html__('Cost-Based Calculation', 'wp-user-avatar'),
123 'time-based' => esc_html__('Time-Based Calculation', 'wp-user-avatar')
124 ]
125 ],
126 'disable_auto_renew' => [
127 'label' => esc_html__('Disable Auto-renewal', 'wp-user-avatar'),
128 'checkbox_label' => esc_html__('Disable', 'wp-user-avatar'),
129 'description' => esc_html__('Check to disable automatic renewal of subscriptions at the end of a billing cycle', 'wp-user-avatar'),
130 'type' => 'checkbox'
131 ],
132 'checkout_auto_renewal_checkbox' => [
133 'label' => esc_html__('Auto-renewal Checkbox', 'wp-user-avatar'),
134 'checkbox_label' => esc_html__('Enable', 'wp-user-avatar'),
135 'description' => esc_html__('Check to show a checkbox that lets customers enable or disable auto-renewal during checkout.', 'wp-user-avatar'),
136 'type' => 'select',
137 'options' => [
138 'disabled' => esc_html__('Disabled', 'wp-user-avatar'),
139 'opt-out' => esc_html__('Let customers opt-out of auto-renewal', 'wp-user-avatar'),
140 'opt-in' => esc_html__('Let customers opt-in to auto-renewal', 'wp-user-avatar')
141 ]
142 ],
143 'enable_checkout_autologin' => [
144 'label' => esc_html__('Checkout Autologin', 'wp-user-avatar'),
145 'checkbox_label' => esc_html__('Enable', 'wp-user-avatar'),
146 'description' => esc_html__('Check to automatically log in customers after checkout.', 'wp-user-avatar'),
147 'type' => 'checkbox'
148 ],
149 ]
150 ];
151
152 if (ExtensionManager::is_enabled(ExtensionManager::SOCIAL_LOGIN)) {
153 $settings[1]['checkout_social_login_buttons'] = [
154 'label' => esc_html__('Checkout Social Login', 'wp-user-avatar'),
155 'description' => esc_html__('Select the social login buttons to display on the checkout page.', 'wp-user-avatar'),
156 'type' => 'select2',
157 'options' => ppress_social_login_networks()
158 ];
159 }
160
161 if ( ! ExtensionManager::is_enabled(ExtensionManager::AUTORENEWAL_CHECKBOX)) {
162 unset($settings[1]['checkout_auto_renewal_checkbox']);
163 }
164
165 $settingsPageInstance = Custom_Settings_Page_Api::instance('', PPRESS_SETTINGS_DB_OPTION_NAME);
166 $settingsPageInstance->page_header($page_header);
167 $settingsPageInstance->main_content(apply_filters('ppress_payment_admin_settings', $settings));
168 $settingsPageInstance->sidebar(AbstractSettingsPage::sidebar_args());
169 $settingsPageInstance->build();
170 }
171
172 public static function get_instance()
173 {
174 static $instance = null;
175
176 if (is_null($instance)) {
177 $instance = new self();
178 }
179
180 return $instance;
181 }
182 }
183