Cast price to float to avoid error in php 8+

This commit is contained in:
Emili Castells Guasch 2023-09-19 10:44:02 +02:00
parent 5b0c11db27
commit 7b253c97f1

View file

@ -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 )