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 / ShortcodeParser / MyAccount / view-order.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
view-order.tmpl.php
237 lines
1 <?php
2
3 use ProfilePress\Core\Membership\CheckoutFields;
4 use ProfilePress\Core\Membership\CheckoutFields as CF;
5 use ProfilePress\Core\Membership\DigitalProducts\DownloadService;
6 use ProfilePress\Core\Membership\Models\Customer\CustomerFactory;
7 use ProfilePress\Core\Membership\Models\Order\OrderFactory;
8 use ProfilePress\Core\Membership\Models\Order\OrderStatus;
9 use ProfilePress\Core\Membership\Models\Order\OrderType;
10 use ProfilePress\Core\Membership\Models\Subscription\SubscriptionFactory;
11 use ProfilePress\Core\Membership\PaymentMethods\PaymentMethods;
12 use ProfilePress\Core\Membership\Services\Calculator;
13 use ProfilePress\Core\Membership\Services\TaxService;
14 use ProfilePress\Core\ShortcodeParser\MyAccount\MyAccountTag;
15
16 if ( ! defined('ABSPATH')) {
17 exit;
18 }
19
20 $order = OrderFactory::fromOrderKey(ppressGET_var('order_key'));
21
22 $customer_id = CustomerFactory::fromUserId(get_current_user_id())->id;
23
24 ?>
25 <div class="profilepress-myaccount-orders-subs">
26
27 <?php if ( ! $order->exists() || (is_user_logged_in() && $order->customer_id !== $customer_id)) :
28
29 printf('<p class="profilepress-myaccount-alert pp-alert-danger">%s</p>', esc_html__('Invalid order', 'wp-user-avatar'));
30
31 else : $plan = ppress_get_plan($order->plan_id);
32 $vat_number = $order->get_customer_tax_id();
33 $plan_purchase_note = $order->get_plan_purchase_note();
34
35 do_action('ppress_myaccount_view_order_before_order_details_table', $order, $customer_id);
36 ?>
37
38 <div class="profilepress-myaccount-order-details-wrap">
39 <div class="ppress-details-table-wrap">
40 <table class="ppress-details-table">
41 <tbody>
42 <tr>
43 <td><?php esc_html_e('Order', 'wp-user-avatar'); ?></td>
44 <td><?= $order->get_reduced_order_key() ?> <?php do_action('ppress_myaccount_view_order_details_order_row', $order); ?></td>
45 </tr>
46 <tr>
47 <td><?php esc_html_e('Date Placed', 'wp-user-avatar'); ?></td>
48 <td><?= ppress_format_date($order->date_created) ?></td>
49 </tr>
50 <tr>
51 <td><?php esc_html_e('Order Item', 'wp-user-avatar'); ?></td>
52 <td><?= $plan->name ?>
53 <span class="ppress-sub-info"><?= ppress_display_amount($plan->price) ?></span></td>
54 </tr>
55 <?php if ( ! empty($plan->description)) : ?>
56 <tr>
57 <td><?php esc_html_e('Item Description', 'wp-user-avatar'); ?></td>
58 <td><?= wpautop($plan->description) ?></td>
59 </tr>
60 <?php endif; ?>
61 <?php if ($order->is_completed() && ! empty($plan_purchase_note)): ?>
62 <tr>
63 <td><?php esc_html_e('Purchase Note', 'wp-user-avatar'); ?></td>
64 <td><?= $plan_purchase_note ?></td>
65 </tr>
66 <?php endif; ?>
67 <tr>
68 <td><?php esc_html_e('Order Status', 'wp-user-avatar'); ?></td>
69 <td>
70 <span class="order-status <?= $order->status ?>"><?= OrderStatus::get_label($order->status) ?></span>
71 </td>
72 </tr>
73 <tr>
74 <td><?php esc_html_e('Order Type', 'wp-user-avatar'); ?></td>
75 <td>
76 <span class="order-type <?= $order->order_type ?>"><?= OrderType::get_label($order->order_type) ?></span>
77 </td>
78 </tr>
79 <tr>
80 <td><?php esc_html_e('Payment Method', 'wp-user-avatar'); ?></td>
81 <td><?= PaymentMethods::get_instance()->get_by_id($order->payment_method)->title ?></td>
82 </tr>
83 <tr>
84 <td><?php esc_html_e('Billing Address', 'wp-user-avatar'); ?></td>
85 <td>
86 <?php
87
88 foreach (CheckoutFields::standard_billing_fields() as $field_id => $field) {
89
90 $method_name = str_replace('ppress_', '', $field_id);
91
92 $detail = $order->$method_name;
93
94 if ( ! empty($detail)) {
95
96 if ($field_id == CF::BILLING_COUNTRY) {
97 $detail = ppress_array_of_world_countries($detail);
98 }
99
100 if ($field_id == CF::BILLING_STATE) {
101 $state = ! empty($order->billing_country) ? ppress_array_of_world_states($order->billing_country) : [];
102 $detail = ppress_var($state, $detail, $detail, true);
103 }
104
105 }
106
107 if (empty($detail)) continue;
108
109 echo '<p>';
110 printf('<span class="ppress-billing-title">%s:</span> %s', esc_html($field['label']), $detail);
111 echo '</p>';
112 } ?>
113 </td>
114 </tr>
115 <tr>
116 <td><?php esc_html_e('Subtotal', 'wp-user-avatar'); ?></td>
117 <td><?= ppress_display_amount($order->subtotal, $order->currency) ?></td>
118 </tr>
119 <?php if ( ! Calculator::init($order->discount)->isNegativeOrZero()) : ?>
120 <tr>
121 <td><?php esc_html_e('Discount', 'wp-user-avatar'); ?></td>
122 <td>
123 <?= ppress_display_amount($order->discount, $order->currency) ?>
124 <span class="ppress-sub-info"><?= $order->coupon_code ?></span>
125 </td>
126 </tr>
127 <?php endif; ?>
128 <?php if (TaxService::init()->is_tax_enabled() || Calculator::init($order->tax)->isGreaterThanZero()) : ?>
129 <tr>
130 <td><?= TaxService::init()->get_tax_label($order->billing_country) ?></td>
131 <td><?= ppress_display_amount($order->tax, $order->currency) ?>
132 <?php if (Calculator::init($order->tax_rate)->isGreaterThanZero()) : ?>
133 <span class="ppress-sub-info"><?= $order->tax_rate ?>%</span>
134 <?php elseif (TaxService::init()->is_reverse_charged($order->id)) : ?>
135 <span class="ppress-sub-info"><?php esc_html_e('Reverse Charged', 'wp-user-avatar') ?></span>
136 <?php endif; ?>
137 </td>
138 </tr>
139 <?php endif; ?>
140 <tr>
141 <td><?php esc_html_e('Total', 'wp-user-avatar'); ?></td>
142 <td><?= ppress_display_amount($order->total, $order->currency) ?></td>
143 </tr>
144 <?php if ( ! empty($vat_number)): ?>
145 <tr>
146 <td><?php esc_html_e('VAT Number', 'wp-user-avatar'); ?></td>
147 <td><?= $vat_number ?></td>
148 </tr>
149 <?php endif; ?>
150 </tbody>
151 </table>
152 </div>
153 </div>
154
155 <?php $subscription = SubscriptionFactory::fromId($order->subscription_id); ?>
156
157 <?php if ($subscription->exists()): $view_sub_url = add_query_arg(['sub_id' => $subscription->id], MyAccountTag::get_endpoint_url('list-subscriptions')) ?>
158
159 <h2><?= esc_html__('Subscription', 'wp-user-avatar') ?></h2>
160
161 <div class="profilepress-myaccount-sub-order-details-wrap">
162 <div class="profilepress-myaccount-sub-order-details-table-wrap">
163 <table class="ppress-details-table">
164 <thead>
165 <tr>
166 <th><?php esc_html_e('Subscription', 'wp-user-avatar') ?></th>
167 <th><?php esc_html_e('Terms', 'wp-user-avatar') ?></th>
168 <th><?php esc_html_e('Status', 'wp-user-avatar') ?></th>
169 <th><?php echo $subscription->get_renewal_expiration_date_label() ?></th>
170 </tr>
171 </thead>
172 <tbody>
173 <tr>
174 <td>
175 <a href="<?php echo esc_url($view_sub_url) ?>"><?= $subscription->get_plan()->get_name() ?></a>
176 </td>
177 <td><?= $subscription->get_subscription_terms() ?></td>
178 <td><?= $subscription->get_status_label() ?></td>
179 <td><?= $subscription->get_formatted_expiration_date() ?></td>
180 </tr>
181 </tbody>
182 </table>
183 </div>
184 </div>
185
186
187 <?php endif; ?>
188
189 <?php if ($order->is_completed() && SubscriptionFactory::fromId($order->subscription_id)->is_active()) : $downloads = $plan->get_downloads(); ?>
190
191 <?php if (isset($downloads['files']) && is_array($downloads['files']) && ! empty($downloads['files'])) : ?>
192
193 <h2><?= esc_html__('Downloads', 'wp-user-avatar') ?></h2>
194
195 <div class="profilepress-myaccount-sub-order-details-wrap">
196 <div class="profilepress-myaccount-sub-order-details-table-wrap">
197 <table class="ppress-details-table">
198 <thead>
199 <tr>
200 <th><?php esc_html_e('Product', 'wp-user-avatar') ?></th>
201 <th><?php esc_html_e('Downloads Remaining', 'wp-user-avatar') ?></th>
202 <th><?php esc_html_e('Action', 'wp-user-avatar') ?></th>
203 </tr>
204 </thead>
205 <tbody>
206 <?php $index = 0; ?>
207 <?php foreach ($downloads['files'] as $file_url => $file_name) : ?>
208 <?php $download_link = DownloadService::init()->get_download_file_url(
209 $order->order_key,
210 $index,
211 $downloads['download_expiry']
212 ); ?>
213 <tr>
214 <td><?= $file_name ?></td>
215 <td><?php echo DownloadService::init()->get_downloads_remaining(
216 $order->get_id(),
217 $plan->get_id(),
218 $file_url
219 ) ?></td>
220 <td>
221 <a class="ppress-myac-action" href="<?php echo esc_url($download_link) ?>"><?php esc_html_e('Download', 'wp-user-avatar'); ?></a>
222 </td>
223 </tr>
224 <?php $index++; ?>
225 <?php endforeach; ?>
226 </tbody>
227 </table>
228 </div>
229 </div>
230
231 <?php endif; ?>
232 <?php endif; ?>
233 <?php endif; ?>
234 </div>
235 <?php
236
237 do_action('ppress_myaccount_view_order_details', $order);