mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Move function to appropriate place
This commit is contained in:
parent
9db695af75
commit
28257e3e38
1 changed files with 6 additions and 3 deletions
|
@ -80,9 +80,7 @@ class PayPalSubscriptionsModule implements ModuleInterface {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $product->get_meta( '_ppcp_enable_subscription_product', true ) === 'yes' ) {
|
|
||||||
update_metadata( 'post', $product_id, '_sold_individually', 'yes', 'no' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$subscriptions_api_handler = $c->get( 'paypal-subscriptions.api-handler' );
|
$subscriptions_api_handler = $c->get( 'paypal-subscriptions.api-handler' );
|
||||||
assert( $subscriptions_api_handler instanceof SubscriptionsApiHandler );
|
assert( $subscriptions_api_handler instanceof SubscriptionsApiHandler );
|
||||||
|
@ -697,6 +695,11 @@ class PayPalSubscriptionsModule implements ModuleInterface {
|
||||||
if ( $product->meta_exists( 'ppcp_subscription_product' ) && $product->meta_exists( 'ppcp_subscription_plan' ) ) {
|
if ( $product->meta_exists( 'ppcp_subscription_product' ) && $product->meta_exists( 'ppcp_subscription_plan' ) ) {
|
||||||
$subscriptions_api_handler->update_product( $product );
|
$subscriptions_api_handler->update_product( $product );
|
||||||
$subscriptions_api_handler->update_plan( $product );
|
$subscriptions_api_handler->update_plan( $product );
|
||||||
|
|
||||||
|
if ( $product->get_meta( '_ppcp_enable_subscription_product', true ) === 'yes' ) {
|
||||||
|
update_metadata( 'post', $product->get_id(), '_sold_individually', 'yes', 'no' );
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue