PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 4.17.1
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v4.17.1
4.17.1 4.17.0 4.16.19 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 / views / customers / data-metabox.php
wp-user-avatar / src / Admin / SettingsPages / Membership / views / customers Last commit date
data-metabox.php 4 months ago subcriptions-metabox.php 1 year ago submit-sidebar.php 4 years ago view-customer.php 4 months ago
data-metabox.php
253 lines
1 <?php
2
3 use ProfilePress\Core\Membership\CheckoutFields as CF;
4 use ProfilePress\Core\Membership\Models\Customer\CustomerEntity;
5 use ProfilePress\Core\Membership\Models\Order\OrderStatus;
6 use ProfilePress\Core\Membership\Services\OrderService;
7
8 /** @global CustomerEntity $customer_data */
9
10 $customer_id = $customer_data->id;
11 $user_id = $customer_data->user_id;
12
13 $billing_fields = CF::billing_fields();
14 $sb = CF::standard_billing_fields();
15
16 echo '<div class="ppress-membership-customer-details">';
17
18 ?>
19 <div class="ppress-metabox-data-column-container">
20
21 <div class="ppress-metabox-data-column" style="width:65%">
22 <div class="ppress-customer-info">
23
24 <div class="ppress-avatar-wrap">
25 <?php echo get_avatar($customer_data->user_id, 150); ?>
26
27 <?php if ($customer_data->user_exists()) : ?>
28 <div class="ppres-customer-edit-link">
29 <a href="<?= get_edit_user_link($customer_data->user_id) ?>" class="button-secondary">
30 <?php esc_html_e('Edit Profile', 'wp-user-avatar'); ?>
31 </a>
32 </div>
33 <?php endif; ?>
34 </div>
35
36 <div class="ppress-customer-main-wrapper">
37
38 <div class="ppress-customer-main-header">
39
40 <span class="customer-name"><?php echo $customer_data->get_name() ?></span>
41
42 <span class="customer-email"><?php echo $customer_data->get_email() ?></span>
43
44 <span class="customer-since">
45 <?php printf(esc_html__('Customer since %s', 'wp-user-avatar'), esc_html($customer_data->get_date_created())) ?>
46 </span>
47
48 <?php if ( ! empty($customer_data->get_last_login())) : ?>
49 <span class="last-login">
50 <?php printf(esc_html__('Last login on %s', 'wp-user-avatar'), esc_html($customer_data->get_last_login())) ?>
51 </span>
52 <?php endif; ?>
53
54 <p class="mb-form-field">
55
56 <label for="customer_wp_user">
57 <?php esc_html_e('WordPress User', 'wp-user-avatar') ?>:
58 <?php if ($customer_data->user_exists()) : ?>
59 <a href="<?= get_edit_user_link($customer_data->user_id); ?>"><?= esc_html__('View profile &rarr;', 'wp-user-avatar') ?></a>
60 <?php endif; ?>
61 </label>
62
63 <select id="customer_wp_user" name="customer_wp_user" class="ppress-select2-field customer_wp_user">
64 <?php if ($customer_data->user_exists()) : ?>
65 <option value="<?= $customer_data->user_id ?>" selected>
66 <?php printf(
67 esc_html__('%1$s (%2$s)', 'wp-user-avatar'),
68 $customer_data->get_wp_user()->user_login,
69 $customer_data->get_wp_user()->user_email
70 ); ?>
71 </option>
72 <?php endif; ?>
73 </select>
74 </p>
75 </div>
76 </div>
77
78 <?php do_action('ppress_admin_customer_data_after_customer_info', $customer_id, $customer_data); ?>
79
80 </div>
81 </div>
82
83 <div class="ppress-metabox-data-column" style="width:35%">
84 <h3>
85 <?php esc_html_e('Billing Address', 'wp-user-avatar'); ?>
86 <a href="#" class="edit_address"><?php esc_html_e('Edit', 'wp-user-avatar'); ?></a>
87 </h3>
88 <div class="ppress-billing-details">
89 <?php if ( ! empty($billing_fields)) {
90
91 $billing_country = sanitize_text_field(get_user_meta($user_id, CF::BILLING_COUNTRY, true));
92
93 foreach ($billing_fields as $field_id => $field) {
94
95 $detail = wp_kses_post(get_user_meta($user_id, $field_id, true));
96
97 if ($field_id == CF::BILLING_COUNTRY) {
98 $detail = ppress_array_of_world_countries($detail);
99 $detail = is_array($detail) ? '' : $detail;
100 }
101
102 if ($field_id == CF::BILLING_STATE) {
103 $state = ! empty($billing_country) ? ppress_array_of_world_states($billing_country) : [];
104 $detail = ppress_var($state, $detail, $detail, true);
105 }
106
107 echo '<p>';
108 printf('<strong>%s</strong>: %s', esc_html($field['label']), $detail);
109 echo '</p>';
110 }
111 } else {
112 echo '<p class="none_set">' . __('No billing address set.', 'wp-user-avatar') . '</p>';
113 }
114 ?>
115 </div>
116
117 <div class="ppress_edit_address_wrap">
118 <?php
119
120 if ( ! empty($billing_fields)) {
121 $found = [];
122 if (in_array(CF::BILLING_ADDRESS, array_keys($billing_fields))) {
123 $found[] = CF::BILLING_ADDRESS;
124 echo '<p class="ppress-metabox-form-field">';
125 printf('<label for="%s">%s</label>', CF::BILLING_ADDRESS, $sb[CF::BILLING_ADDRESS]['label']);
126 echo do_shortcode(
127 sprintf(
128 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
129 CF::BILLING_ADDRESS,
130 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_ADDRESS, true)))
131 ),
132 true
133 );
134 echo '</p>';
135 }
136
137 if (in_array(CF::BILLING_CITY, array_keys($billing_fields))) {
138 $found[] = CF::BILLING_CITY;
139 echo '<p class="ppress-metabox-form-field">';
140 printf('<label for="%s">%s</label>', CF::BILLING_CITY, $sb[CF::BILLING_CITY]['label']);
141 echo do_shortcode(
142 sprintf(
143 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
144 CF::BILLING_CITY,
145 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_CITY, true)))
146 ),
147 true
148 );
149 echo '</p>';
150 }
151
152 if (in_array(CF::BILLING_COUNTRY, array_keys($billing_fields))) {
153 $found[] = CF::BILLING_COUNTRY;
154 echo '<p class="ppress-metabox-form-field">';
155 printf('<label for="%s">%s</label>', CF::BILLING_COUNTRY, $sb[CF::BILLING_COUNTRY]['label']);
156 echo do_shortcode(
157 sprintf(
158 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
159 CF::BILLING_COUNTRY,
160 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_COUNTRY, true)))
161 ),
162 true
163 );
164 echo '</p>';
165 }
166
167 if (in_array(CF::BILLING_STATE, array_keys($billing_fields))) {
168 $found[] = CF::BILLING_STATE;
169 echo '<p class="ppress-metabox-form-field">';
170 printf('<label for="%s">%s</label>', CF::BILLING_STATE, $sb[CF::BILLING_STATE]['label']);
171 echo do_shortcode(
172 sprintf(
173 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
174 CF::BILLING_STATE,
175 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_STATE, true)))
176 ),
177 true
178 );
179 echo '</p>';
180 }
181
182 if (in_array(CF::BILLING_POST_CODE, array_keys($billing_fields))) {
183 $found[] = CF::BILLING_POST_CODE;
184 echo '<p class="ppress-metabox-form-field">';
185 printf('<label for="%s">%s</label>', CF::BILLING_POST_CODE, $sb[CF::BILLING_POST_CODE]['label']);
186 echo do_shortcode(
187 sprintf(
188 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
189 CF::BILLING_POST_CODE,
190 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_POST_CODE, true)))
191 ),
192 true
193 );
194 echo '</p>';
195 }
196
197 if (in_array(CF::BILLING_PHONE_NUMBER, array_keys($billing_fields))) {
198 $found[] = CF::BILLING_PHONE_NUMBER;
199 echo '<p class="ppress-metabox-form-field">';
200 printf('<label for="%s">%s</label>', CF::BILLING_PHONE_NUMBER, $sb[CF::BILLING_PHONE_NUMBER]['label']);
201 echo do_shortcode(
202 sprintf(
203 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
204 CF::BILLING_PHONE_NUMBER,
205 strip_shortcodes(esc_attr(get_user_meta($user_id, CF::BILLING_PHONE_NUMBER, true)))
206 ),
207 true
208 );
209 echo '</p>';
210 }
211
212 foreach ($billing_fields as $field_id => $field) {
213 if ( ! in_array($field_id, $found)) {
214 $found[] = $field_id;
215 echo '<p class="ppress-metabox-form-field">';
216 printf('<label for="%s">%s</label>', $field_id, $field['label']);
217 echo do_shortcode(
218 sprintf(
219 '[edit-profile-cpf id="%1$s" key="%1$s" value="%2$s"]',
220 $field_id,
221 strip_shortcodes(esc_attr(get_user_meta($user_id, $field_id, true)))
222 ),
223 true
224 );
225 echo '</p>';
226 }
227 }
228 }
229 ?>
230 </div>
231
232 <?php do_action('ppress_admin_customer_data_after_billing_address', $customer_id, $customer_data); ?>
233 </div>
234 </div>
235
236 <div class="ppress-customer-stats-wrapper">
237 <ul>
238 <li>
239 <a href="<?= OrderService::init()->get_customer_orders_url($customer_id, OrderStatus::COMPLETED) ?>">
240 <span class="dashicons dashicons-cart"></span>
241 <span class="ppress_purchase_count"><?= $customer_data->purchase_count ?></span> <?php esc_html_e('Completed Sales', 'wp-user-avatar') ?>
242 </a>
243 </li>
244 <li>
245 <span class="dashicons dashicons-chart-area"></span>
246 <span class="ppress_total_spend"><?= ppress_display_amount($customer_data->total_spend) ?></span> <?php esc_html_e('Total Spend', 'wp-user-avatar') ?>
247 </li>
248 </ul>
249 </div>
250 <?php
251
252 echo '</div>';
253