PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 4.16.19
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v4.16.19
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 / ShortcodeParser / MyAccount / billing-details.tmpl.php
wp-user-avatar / src / ShortcodeParser / MyAccount Last commit date
MyAccountTag.php 1 month ago account-settings.tmpl.php 3 years ago billing-details.tmpl.php 1 year ago change-password.tmpl.php 1 year ago dashboard.tmpl.php 3 years ago delete-account.tmpl.php 1 year ago downloads.tmpl.php 1 year ago edit-profile.tmpl.php 1 year ago email-notifications.tmpl.php 3 years ago index.php 5 years ago orders.tmpl.php 3 years ago subscriptions.tmpl.php 1 year ago view-order.tmpl.php 1 year ago view-subscription.tmpl.php 1 year ago
billing-details.tmpl.php
147 lines
1 <?php
2
3 use ProfilePress\Core\Admin\ProfileCustomFields;
4 use ProfilePress\Core\Classes\EditUserProfile;
5 use ProfilePress\Core\Membership\CheckoutFields;
6
7 if ( ! defined('ABSPATH')) {
8 exit; // Exit if accessed directly
9 }
10
11 $billing_details_fields = CheckoutFields::standard_billing_fields();
12
13 $success_message = EditUserProfile::get_success_message();
14
15 echo '<div class="profilepress-myaccount-edit-profile">';
16
17 echo '<h2>' . esc_html__('Billing Address', 'wp-user-avatar') . '</h2>';
18
19 if (isset($_GET['edit']) && $_GET['edit'] == 'true') :
20 echo $success_message;
21 endif;
22
23 if ( ! empty($this->edit_profile_form_error)) :
24
25 if (strpos($this->edit_profile_form_error, 'profilepress-edit-profile-status') !== false) :
26 echo $this->edit_profile_form_error;
27 else :
28 echo '<div class="profilepress-edit-profile-status">';
29 echo $this->edit_profile_form_error;
30 echo '</div>';
31 endif;
32 endif;
33
34 ob_start();
35 echo '[pp-edit-profile-form]';
36
37 echo '<div class="profilepress-myaccount-form-wrap">';
38
39 printf(
40 '<p>%s</p>',
41 apply_filters(
42 'ppress_myaccount_billing_details_description',
43 esc_html__('The following billing address will be used on the checkout page by default.', 'wp-user-avatar'))
44 );
45
46 $billing_details_fields = apply_filters('ppress_myaccount_billing_details_fields', $billing_details_fields);
47
48 if (is_array($billing_details_fields) && ! empty($billing_details_fields)) :
49
50 foreach ($billing_details_fields as $field_key => $field) :
51
52 $field_type = $field['field_type'];
53
54 $options = '';
55
56 if ($field_key == CheckoutFields::BILLING_STATE) {
57
58 $billing_country = get_user_meta(get_current_user_id(), CheckoutFields::BILLING_COUNTRY, true);
59 $billing_country_states = ! empty($billing_country) ? ppress_array_of_world_states($billing_country) : [];
60
61 if ( ! empty($billing_country_states)) {
62 $field_type = 'select';
63 $options = base64_encode(serialize(['' => '&mdash;&mdash;&mdash;&mdash;'] + $billing_country_states));
64 }
65 }
66
67 if (apply_filters('ppress_myaccount_billing_details_disable_' . $field_key, false)) continue;
68
69 // skip woocommerce core billing / shipping fields added to wordpress profile admin page.
70 if (in_array($field_key, ppress_woocommerce_billing_shipping_fields())) continue;
71
72 echo '<div class="profilepress-myaccount-form-field">';
73
74 if ($field_type !== 'agreeable') {
75 printf('<label for="%s">%s</label>', $field_key, $field['label']);
76 }
77
78 echo sprintf(
79 '[edit-profile-cpf id="%1$s" key="%1$s" type="%2$s" key_value_options="%3$s" class="profilepress-myaccount-form-control"]',
80 $field_key, $field_type, $options
81 );
82 echo '</div>';
83
84 endforeach;
85
86 endif;
87
88 echo '<div class="profilepress-myaccount-form-field">';
89 echo '[edit-profile-submit]';
90 echo '</div>';
91 echo '</div>';
92
93 echo '<input type="hidden" name="ppmyac_form_action" value="updateProfile">';
94
95 echo '[/pp-edit-profile-form]';
96
97 echo do_shortcode(ob_get_clean(), true);
98 echo '</div>';
99
100 do_action('ppress_myaccount_billing_details');
101
102 add_action('wp_footer', function () {
103 ?>
104 <script type="text/html" id="tmpl-ppress-profile-state-input">
105 <input name="ppress_billing_state" type="text" id="ppress_billing_state" class="profilepress-myaccount-form-control" value="">
106 </script>
107
108 <script type="text/html" id="tmpl-ppress-profile-state-select">
109 <select name="ppress_billing_state" id="ppress_billing_state" class="profilepress-myaccount-form-control">
110 <option value="">&mdash;&mdash;&mdash;</option>
111 <# jQuery.each(data.options, function(index, value) { #>
112 <option value="{{index}}">{{value}}</option>
113 <# }); #>
114 </select>
115 </script>
116
117 <script type="text/javascript">
118 (function ($) {
119 $(function () {
120
121 var ppress_countries_states = <?php echo wp_json_encode(array_filter(ppress_array_of_world_states())); ?>,
122 country_state_select_tmpl = wp.template('ppress-profile-state-select'),
123 country_state_input_tmpl = wp.template('ppress-profile-state-input');
124
125 $(document).on('change', '#ppress_billing_country', function () {
126
127 var val = $(this).val(), field;
128
129 if (val in ppress_countries_states) {
130
131 field = country_state_select_tmpl({
132 options: ppress_countries_states[val]
133 });
134
135 } else {
136
137 field = country_state_input_tmpl();
138 }
139
140 $('#ppress_billing_state').replaceWith(field);
141 });
142 })
143 })(jQuery);
144 </script>
145 <?php
146 });
147