The issue is as follows:
If the user tries to upgrade to/from a subscription that has zero cost gets this error:
Fatal error: Uncaught TypeError: Unsupported operand types: string * int in /public_html/wp-content/plugins/woocommerce-subscriptions/includes/switching/class-wcs-switch-cart-item.php:208nStack trace:n#0
The solution is to convert the line of code 208
$new_price_per_day = ( WC_Subscriptions_Product::get_price( $this->product ) * $this->cart_item[‘quantity’] ) / $days_in_new_cycle;
to this:
$new_price_per_day = ( (float) WC_Subscriptions_Product::get_price( $this->product ) * $this->cart_item[‘quantity’] ) / $days_in_new_cycle;
You may also need to do something similar in the previous method:
public function get_old_price_per_day()
Open
Last updated: September 7, 2023
0 comments
Log in to comment on this feature request.