Fix subscription status and action items for free (lifetime) subs (#51628)
* Fix subscription status and action items for free (lifetime) subs * Changelog * Lint
This commit is contained in:
parent
52d0b8c17d
commit
fae492632a
|
@ -355,9 +355,16 @@ export function subscriptionStatus(
|
|||
);
|
||||
}
|
||||
|
||||
return subscription.autorenew
|
||||
? __( 'Active', 'woocommerce' )
|
||||
: __( 'Cancelled', 'woocommerce' );
|
||||
let status;
|
||||
if ( subscription.lifetime ) {
|
||||
status = __( 'Lifetime', 'woocommerce' );
|
||||
} else if ( subscription.autorenew ) {
|
||||
status = __( 'Active', 'woocommerce' );
|
||||
} else {
|
||||
status = __( 'Cancelled', 'woocommerce' );
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
return {
|
||||
display: getStatus(),
|
||||
|
@ -377,7 +384,7 @@ export function actions( subscription: Subscription ): TableRow {
|
|||
let actionButton = null;
|
||||
if ( subscription.product_key === '' ) {
|
||||
actionButton = <SubscribeButton subscription={ subscription } />;
|
||||
} else if ( subscription.expired ) {
|
||||
} else if ( subscription.expired && ! subscription.lifetime ) {
|
||||
actionButton = <RenewButton subscription={ subscription } />;
|
||||
} else if (
|
||||
subscription.local.installed === false &&
|
||||
|
@ -391,7 +398,7 @@ export function actions( subscription: Subscription ): TableRow {
|
|||
actionButton = (
|
||||
<ConnectButton subscription={ subscription } variant="link" />
|
||||
);
|
||||
} else if ( ! subscription.autorenew ) {
|
||||
} else if ( ! subscription.autorenew && ! subscription.lifetime ) {
|
||||
actionButton = <AutoRenewButton subscription={ subscription } />;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix subscription status and action items for free (lifetime) subscriptions
|
Loading…
Reference in New Issue