Use subscription_helper for manualRenewalEnabled

This commit is contained in:
Alex P. 2024-10-22 17:00:46 +03:00
parent ad07c05cb7
commit ccbb2995a4
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -1322,7 +1322,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
'needShipping' => $this->need_shipping(),
'vaultingEnabled' => $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ),
'productType' => null,
'manualRenewalEnabled' => false,
'manualRenewalEnabled' => $this->subscription_helper->accept_manual_renewals(),
);
if ( is_product() ) {
@ -1332,15 +1332,6 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
}
}
if ( class_exists( '\WCS_Manual_Renewal_Manager' ) ) {
/**
* We verify the existence of the class prior to invoking a static method.
*
* @psalm-suppress UndefinedClass
*/
$localize['manualRenewalEnabled'] = \WCS_Manual_Renewal_Manager::is_manual_renewal_enabled();
}
if ( 'pay-now' === $this->context() ) {
$localize['pay_now'] = $this->pay_now_script_data();
}