From 7b253c97f1337f7e6b406fb39318e61785517a3f Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Tue, 19 Sep 2023 10:44:02 +0200 Subject: [PATCH] Cast price to float to avoid error in php 8+ --- modules/ppcp-subscription/src/SubscriptionsApiHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-subscription/src/SubscriptionsApiHandler.php b/modules/ppcp-subscription/src/SubscriptionsApiHandler.php index dca008701..09513a340 100644 --- a/modules/ppcp-subscription/src/SubscriptionsApiHandler.php +++ b/modules/ppcp-subscription/src/SubscriptionsApiHandler.php @@ -211,7 +211,7 @@ class SubscriptionsApiHandler { $subscription_plan = $this->billing_plans_endpoint->plan( $subscription_plan_id ); $price = $subscription_plan->billing_cycles()[0]->pricing_scheme()['fixed_price']['value'] ?? ''; - if ( $price && round( $price, 2 ) !== round( (float) $product->get_price(), 2 ) ) { + if ( $price && round( (float) $price, 2 ) !== round( (float) $product->get_price(), 2 ) ) { $this->billing_plans_endpoint->update_pricing( $subscription_plan_id, $this->billing_cycle_factory->from_wc_product( $product )