PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 1.3.2
Subscriptions for WooCommerce with Stripe Recurring Payments v1.3.2
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / includes / Illuminate / views / subscription-table.php

subscription-table.php in Subscriptions for WooCommerce with Stripe Recurring Payments 1.3.2, at includes/Illuminate/views/subscription-table.php

103 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Related subscriptions for email.
4 *
5 * @var \WC_Order $order Order Object.
6 * @var object[] $histories Order Object.
7 */
8
9 use SpringDevs\Subscription\Illuminate\Helper;
10
11 ?>
12
13 <div style="margin-bottom: 40px;">
14 <table class="td" cellspacing="0" cellpadding="6"
15 style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"
16 border="1">
17 <tbody>
18 <tr>
19 <h2>
20 <?php
21 esc_html_e( 'Related Subscriptions', 'sdevs_subscrpt' );
22 ?>
23 </h2>
24 <?php
25 if ( ! $order->has_status( 'completed' ) ) :
26 ?>
27 <p><small>Your subscription will be activated when order status is completed.</small></p>
28 <?php endif; ?>
29 </tr>
30 <?php
31 foreach ( $histories as $history ) :
32 $item = $order->get_item( $history->order_item_id );
33 $item_meta = wc_get_order_item_meta( $history->order_item_id, '_subscrpt_meta', true );
34 $subscription_id = $history->subscription_id;
35 $subscription_status_object = get_post_status_object( get_post_status( $subscription_id ) );
36 $cost = get_post_meta( $subscription_id, '_subscrpt_price', true );
37 $has_trial = isset( $item_meta['trial'] ) && strlen( $item_meta['trial'] ) > 2;
38 $start_date = get_post_meta( $subscription_id, '_subscrpt_start_date', true );
39 $next_date = get_post_meta( $subscription_id, '_subscrpt_next_date', true );
40 ?>
41 <tr>
42 <th class="td" scope="row" colspan="3"
43 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: center;"><?php echo get_the_title( $subscription_id ); ?></th>
44 </tr>
45 <tr>
46 <th class="td" scope="row" colspan="3"
47 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;">
48 <a href="<?php echo get_permalink( $item->get_product_id() ); ?>"><?php echo $item->get_name(); ?></a>
49 <strong
50 class="product-quantity">×&nbsp;<?php echo esc_html( $item->get_quantity() ); ?></strong>
51 </th>
52 </tr>
53 <tr>
54 <th class="td" scope="row" colspan="2"
55 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php esc_html_e( 'Status:', 'sdevs_subscrpt' ); ?> </th>
56 <td class="td"
57 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php echo esc_html( $subscription_status_object->label ); ?></td>
58 </tr>
59 <tr>
60 <th class="td" scope="row" colspan="2"
61 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;">
62 <?php esc_html_e( 'Recurring amount:', 'sdevs_subscrpt' ); ?> </th>
63 <td class="td"
64 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php echo wp_kses_post( Helper::format_price_with_order_item( $cost, $item->get_id() ) ); ?></td>
65 </tr>
66 <?php if ( ! $has_trial ) { ?>
67 <tr>
68 <th class="td" scope="row" colspan="2"
69 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php esc_html_e( 'Next billing on', 'sdevs_subscrpt' ); ?>
70 :
71 </th>
72 <td class="td"
73 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php echo ! empty( $next_date ) ? esc_html( gmdate( 'F d, Y', $next_date ) ) : '-'; ?></td>
74 </tr>
75 <?php } else { ?>
76 <tr>
77 <th class="td" scope="row" colspan="2"
78 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php esc_html_e( 'Trial', 'sdevs_subscrpt' ); ?>
79 :
80 </th>
81 <td class="td"
82 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php echo esc_html( $item_meta['trial'] ); ?></td>
83 </tr>
84 <tr>
85 <th class="td" scope="row" colspan="2"
86 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php esc_html_e( 'First billing on', 'sdevs_subscrpt' ); ?>
87 :
88 </th>
89 <td class="td"
90 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left;"><?php echo ! empty( $start_date ) ? esc_html( gmdate( 'F d, Y', $start_date ) ) : '-'; ?></td>
91 </tr>
92 <?php } ?>
93 <tr>
94 <th class="td" scope="row" colspan="3"
95 style="color: #636363; border: 1px solid #e5e5e5; vertical-align: middle; padding: 12px; text-align: left; padding-bottom: 30px;"></th>
96 </tr>
97 <?php
98 endforeach;
99 ?>
100 </tbody>
101 </table>
102 </div>
103