# subscription/1.10.4/includes/Admin/views/related-subscriptions.php

Subscriptions for WooCommerce with Stripe Recurring Payments, version 1.10.4. 108 lines.

- Page: https://pluginprobe.com/plugins/subscription/1.10.4/code/includes/Admin/views/related-subscriptions.php
- Raw: https://pluginprobe.com/plugins/subscription/1.10.4/raw/includes/Admin/views/related-subscriptions.php
- Modified: 2026-06-21T06:28:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/subscription/1.10.4/code/includes/Admin/views/related-subscriptions.php#L10-L20`.

```php
<?php
/**
 * Related Subscriptions meta box view.
 *
 * @package SpringDevs\Subscription\Admin
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

?>
<style>
	.subscrpt-related-subscriptions td{
		vertical-align: middle;
	}
</style>

<table class="widefat striped subscrpt-related-subscriptions">
	<thead>
		<tr>
			<th><?php esc_html_e( 'ID', 'subscription' ); ?></th>
			<th><?php esc_html_e( 'Product', 'subscription' ); ?></th>
			<th><?php esc_html_e( 'Recurring', 'subscription' ); ?></th>
			<th><?php esc_html_e( 'Started on', 'subscription' ); ?></th>
			<th><?php esc_html_e( 'Expiry date', 'subscription' ); ?></th>
			<th><?php esc_html_e( 'Status', 'subscription' ); ?></th>
		</tr>
	</thead>
	<tbody>
		<?php
		foreach ( $histories as $history ) :
			$subscription_id   = $history->subscription_id;
			$subscription_data = SpringDevs\Subscription\Illuminate\Helper::get_subscription_data( $subscription_id );

			$subscrpt_status = $subscription_data['status'] ?? '';
			$verbose_status  = SpringDevs\Subscription\Illuminate\Helper::get_verbose_status( $subscrpt_status );

			$order_item_id = get_post_meta( $history->subscription_id, '_subscrpt_order_item_id', true );
			$order_item    = $order->get_item( $history->order_item_id );

			$trial = get_post_meta( $history->subscription_id, '_subscrpt_trial', true );

			$start_date = $subscription_data['start_date'] ?? '';
			$start_date = ! empty( $start_date ) ? wp_date( 'F j, Y - g:i A', strtotime( $start_date ) ) : '-';

			$next_date = $subscription_data['next_date'] ?? '';
			$next_date = ! empty( $next_date ) ? wp_date( 'F j, Y - g:i A', strtotime( $next_date ) ) : '-';

			$quantity       = (int) $order_item->get_quantity();
			$price          = (float) ( $subscription_data['price'] ?? 0 ) * max( 1, $quantity );
			$price_excl_tax = (float) $order_item->get_total();
			$tax_amount     = (float) $order_item->get_total_tax();

			if ( $tax_amount > 0 ) {
				$price = $price_excl_tax + $tax_amount;
				$price = number_format( (float) $price, 2, '.', '' );
			}

			$is_grace_period = isset( $subscription_data['grace_period'] );
			$grace_remaining = $subscription_data['grace_period']['remaining_days'] ?? 0;
			?>
				<tr>
					<td>
						<a href="<?php echo esc_html( get_edit_post_link( $subscription_id ) ); ?>" target="_blank">Subscription #<?php echo esc_html( $subscription_id ); ?></a>
					</td>
					<td>
						<?php echo esc_html( $order_item->get_name() ); ?>
					</td>
					<td>
						<?php echo wp_kses_post( SpringDevs\Subscription\Illuminate\Helper::format_price_with_order_item( $price, $order_item->get_id() ) ); ?>
					</td>
					<td>
						<?php echo esc_html( $start_date ); ?>
					</td>
					<td>
						<?php echo esc_html( $next_date ); ?>
					</td>
					<td>
						<?php if ( $is_grace_period && $grace_remaining > 0 ) : ?>
							<span class="subscrpt-legacy-status subscrpt-legacy-status--active grace-active">
								Active

								<?php
									$grace_remaining_text = sprintf(
										// translators: Number of days remaining in grace period.
										__( '%d days remaining!', 'subscription' ),
										$grace_remaining
									);
								?>
								<span class="grace-icon" data-tooltip="<?php echo esc_attr( $grace_remaining_text ); ?>">
									<span class="dashicons dashicons-warning"></span>
								</span>
							</span>
						<?php else : ?>
							<span class="subscrpt-legacy-status subscrpt-legacy-status--<?php echo esc_attr( strtolower( $subscrpt_status ) ); ?>">
								<?php echo esc_html( $verbose_status ); ?>
							</span>
						<?php endif; ?>
					</td>
				</tr>
				<?php
		endforeach;
		?>
	</tbody>
</table>

```
