| @@ -112,9 +112,9 @@ | ||
| 112 | 112 | $start_date = $subscription_data['start_date'] ?? ''; |
| 113 | 113 | $start_date = ! empty( $start_date ) ? wp_date( 'F j, Y', strtotime( $start_date ) ) : '-'; |
| 114 | 114 | |
| 115 | 115 | $next_date = $subscription_data['next_date'] ?? ''; |
| 116 | - $next_date = ! empty( $next_date ) ? wp_date( 'F j, Y', strtotime( $next_date ) ) : '-'; | |
| 116 | + $next_date = ! empty( $next_date ) && Helper::has_next_payment( $status ) ? wp_date( 'F j, Y', strtotime( $next_date ) ) : '-'; | |
| 117 | 117 | |
| 118 | 118 | $trial = get_post_meta( $id, '_subscrpt_trial', true ); |
| 119 | 119 | $trial_mode = get_post_meta( $id, '_subscrpt_trial_mode', true ); |
| 120 | 120 | |
| @@ -211,8 +211,13 @@ | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $action_buttons = apply_filters( 'subscrpt_single_action_buttons', $action_buttons, $id, $subscrpt_nonce, $status ); |
| 214 | 214 | |
| 215 | + // Nothing renews once a subscription has ended, so drop the auto-renewal toggle — Pro adds it through the filter too. | |
| 216 | + if ( ! Helper::has_next_payment( $status ) ) { | |
| 217 | + unset( $action_buttons['auto-renew-on'], $action_buttons['auto-renew-off'] ); | |
| 218 | + } | |
| 219 | + | |
| 215 | 220 | wc_get_template( |
| 216 | 221 | 'myaccount/single.php', |
| 217 | 222 | array( |
| 218 | 223 | 'id' => $id, |
| @@ -305,9 +310,9 @@ | ||
| 305 | 310 | 'author' => get_current_user_id(), |
| 306 | 311 | 'posts_per_page' => 10, |
| 307 | 312 | 'paged' => $current_page, |
| 308 | 313 | 'post_type' => 'subscrpt_order', |
| 309 | - 'post_status' => array( 'pending', 'active', 'on_hold', 'cancelled', 'expired', 'pe_cancelled' ), | |
| 314 | + 'post_status' => array( 'pending', 'active', 'on_hold', 'cancelled', 'expired', 'pe_cancelled', 'completed' ), | |
| 310 | 315 | ); |
| 311 | 316 | |
| 312 | 317 | $postslist = new \WP_Query( $args ); |
| 313 | 318 | wc_get_template( |