mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Ensure connect subscription is sent when saving subscription product
This commit is contained in:
parent
cb624eb3bf
commit
0bb7165273
1 changed files with 8 additions and 0 deletions
|
@ -58,6 +58,14 @@ class PayPalSubscriptionsModule implements ModuleInterface {
|
||||||
* @psalm-suppress MissingClosureParamType
|
* @psalm-suppress MissingClosureParamType
|
||||||
*/
|
*/
|
||||||
function( $product_id ) use ( $c ) {
|
function( $product_id ) use ( $c ) {
|
||||||
|
$subscriptions_helper = $c->get( 'wc-subscriptions.helper' );
|
||||||
|
assert( $subscriptions_helper instanceof SubscriptionHelper );
|
||||||
|
|
||||||
|
$connect_subscription = wc_clean( wp_unslash( $_POST['_ppcp_enable_subscription_product'] ?? '' ) );
|
||||||
|
if ( ! $subscriptions_helper->plugin_is_active() || $connect_subscription !== 'yes' ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$settings = $c->get( 'wcgateway.settings' );
|
$settings = $c->get( 'wcgateway.settings' );
|
||||||
assert( $settings instanceof Settings );
|
assert( $settings instanceof Settings );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue