PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.3.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.3.0
2.4.0 2.3.0 2.2.0 2.1.0 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 All 65 releases
← All changes | templates/myaccount/subscriptions.php +5 -11 1.10.6 → 2.3.0 View file →
@@ -58,24 +58,18 @@
58 58 $start_date = $subscription_data['start_date'] ?? '';
59 59 $start_date = ! empty( $start_date ) ? wp_date( 'F j, Y', strtotime( $start_date ) ) : '-';
60 60
61 61 $next_date = $subscription_data['next_date'] ?? '';
62 - $next_date = ! empty( $next_date ) ? wp_date( 'F j, Y', strtotime( $next_date ) ) : '-';
62 + $next_date = ! empty( $next_date ) && SpringDevs\Subscription\Illuminate\Helper::has_next_payment( $subscrpt_status ) ? wp_date( 'F j, Y', strtotime( $next_date ) ) : '-';
63 63
64 64 $trial = get_post_meta( get_the_ID(), '_subscrpt_trial', true );
65 65 $trial_mode = get_post_meta( get_the_ID(), '_subscrpt_trial_mode', true );
66 66 $trial_mode = empty( $trial_mode ) ? 'off' : $trial_mode;
67 67
68 - $quantity = (int) $order_item->get_quantity();
69 - $price = (float) ( $subscription_data['price'] ?? 0 ) * max( 1, $quantity );
70 - $price_excl_tax = (float) $order_item->get_total();
71 - $tax_amount = (float) $order_item->get_total_tax();
68 + // Renewal total, already net of any discount that recurs.
69 + $display_totals = SpringDevs\Subscription\Illuminate\Helper::get_subscription_display_totals( $subscription_id, $order_item );
70 + $price = $display_totals['total'];
72 71
73 - if ( $tax_amount > 0 ) {
74 - $price = $price_excl_tax + $tax_amount;
75 - $price = number_format( (float) $price, 2, '.', '' );
76 - }
77 -
78 72 $product_price_html = SpringDevs\Subscription\Illuminate\Helper::format_price_with_order_item( $price, $order_item->get_id() );
79 73
80 74 $is_grace_period = isset( $subscription_data['grace_period'] );
81 75 $grace_remaining = $subscription_data['grace_period']['remaining_days'] ?? 0;
@@ -113,9 +107,9 @@
113 107 </td>
114 108
115 109 <td data-title="Product"><?php echo esc_html( $product_name ); ?></td>
116 110
117 - <?php if ( 'on' !== $trial_mode ) : ?>
111 + <?php if ( 'on' !== $trial_mode || ! SpringDevs\Subscription\Illuminate\Helper::has_next_payment( $subscrpt_status ) ) : ?>
118 112 <td data-title="Next Payment"><?php echo esc_html( $next_date ); ?></td>
119 113 <?php else : ?>
120 114 <td data-title="Next Payment"><small>First Billing : </small><?php echo esc_html( $start_date ); ?></td>
121 115 <?php endif; ?>