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
|
let status;
|
||||||
? __( 'Active', 'woocommerce' )
|
if ( subscription.lifetime ) {
|
||||||
: __( 'Cancelled', 'woocommerce' );
|
status = __( 'Lifetime', 'woocommerce' );
|
||||||
|
} else if ( subscription.autorenew ) {
|
||||||
|
status = __( 'Active', 'woocommerce' );
|
||||||
|
} else {
|
||||||
|
status = __( 'Cancelled', 'woocommerce' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
display: getStatus(),
|
display: getStatus(),
|
||||||
|
@ -377,7 +384,7 @@ export function actions( subscription: Subscription ): TableRow {
|
||||||
let actionButton = null;
|
let actionButton = null;
|
||||||
if ( subscription.product_key === '' ) {
|
if ( subscription.product_key === '' ) {
|
||||||
actionButton = <SubscribeButton subscription={ subscription } />;
|
actionButton = <SubscribeButton subscription={ subscription } />;
|
||||||
} else if ( subscription.expired ) {
|
} else if ( subscription.expired && ! subscription.lifetime ) {
|
||||||
actionButton = <RenewButton subscription={ subscription } />;
|
actionButton = <RenewButton subscription={ subscription } />;
|
||||||
} else if (
|
} else if (
|
||||||
subscription.local.installed === false &&
|
subscription.local.installed === false &&
|
||||||
|
@ -391,7 +398,7 @@ export function actions( subscription: Subscription ): TableRow {
|
||||||
actionButton = (
|
actionButton = (
|
||||||
<ConnectButton subscription={ subscription } variant="link" />
|
<ConnectButton subscription={ subscription } variant="link" />
|
||||||
);
|
);
|
||||||
} else if ( ! subscription.autorenew ) {
|
} else if ( ! subscription.autorenew && ! subscription.lifetime ) {
|
||||||
actionButton = <AutoRenewButton subscription={ subscription } />;
|
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