Skip to content

Commit

Permalink
Merge pull request #2041 from woocommerce/PCP-2641-proceed-to-pay-pal…
Browse files Browse the repository at this point in the history
…-button-is-showing-for-free-trial-subscription-products-for-germany-merchant-extended-v-3

Proceed to PayPal button is showing for Free trial subscription products (2641)
  • Loading branch information
Dinamiko authored Feb 29, 2024
2 parents 1a6b2ff + 80cf93b commit f1c79db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/ppcp-wc-subscriptions/src/FreeTrialHandlerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ protected function is_free_trial_cart(): bool {

foreach ( $cart->get_cart() as $item ) {
$product = $item['data'] ?? null;
if ( $product && WC_Subscriptions_Product::is_subscription( $product ) ) {
if (
$product
&& WC_Subscriptions_Product::is_subscription( $product )
&& ! $product->get_meta( 'ppcp_subscription_plan' )
) {
return true;
}
}
Expand Down

0 comments on commit f1c79db

Please sign in to comment.