mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-08 02:24:02 +00:00
2.2.7
This commit is contained in:

committed by
Remco Tolsma

parent
5e536ec717
commit
b99eba2f79
@@ -172,7 +172,11 @@ function wcs_get_users_subscriptions( $user_id = 0 ) {
|
||||
) );
|
||||
|
||||
foreach ( $post_ids as $post_id ) {
|
||||
$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );
|
||||
$subscription = wcs_get_subscription( $post_id );
|
||||
|
||||
if ( $subscription ) {
|
||||
$subscriptions[ $post_id ] = $subscription;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +286,7 @@ function wcs_get_all_user_actions_for_subscription( $subscription, $user_id ) {
|
||||
|
||||
// Show button for subscriptions which can be cancelled and which may actually require cancellation (i.e. has a future payment)
|
||||
$next_payment = $subscription->get_time( 'next_payment' );
|
||||
if ( $subscription->can_be_updated_to( 'cancelled' ) && ! $subscription->is_one_payment() && ( $next_payment > 0 || ( $subscription->has_status( 'on-hold' ) && empty( $next_payment ) ) ) ) {
|
||||
if ( $subscription->can_be_updated_to( 'cancelled' ) && ( ! $subscription->is_one_payment() && ( $subscription->has_status( 'on-hold' ) && empty( $next_payment ) ) || $next_payment > 0 ) ) {
|
||||
$actions['cancel'] = array(
|
||||
'url' => wcs_get_users_change_status_link( $subscription->get_id(), 'cancelled', $current_status ),
|
||||
'name' => _x( 'Cancel', 'an action on a subscription', 'woocommerce-subscriptions' ),
|
||||
|
Reference in New Issue
Block a user