Hi,
we use Buy Again for WooCommerce
https://flintop.com/product/buy-again-for-woocommerce/
V5.1.0
CRITICAL Uncaught TypeError: Unsupported operand types: string + int
in /wp-content/plugins/buy-again-for-woocommerce/inc/class-bya-order-handler.php:196
means that on line 196 of the Buy Again for WooCommerce plugin an attempt is made to add a string and a number, which is no longer silently converted in PHP 8+, but throws an error.
You can fix it so: in Line: 196
$args[‘order_count’] = (int) $customer_obj->get_order_count() + (int) $bya_product_obj->get_order_count();
in lines 197 and 198 also cast to (int)
Please inform me when this has been fixed 😊
best regards Rafael
Open
Last updated: June 10, 2025
Log in to comment on this feature request.
I also get this error.
Thank you Rafael!
Flintop, please apply this fix. These errors have resulted in Checkout issues for 12 customers. Here are a few of the support emails received:
Julia: This was made in error and duplicate! We have another order – 77325 that was also sent as a confirmation. When I was trying to check out, it gave me an error, so I tried again and then I got two confirmations. Please cancel and refund!
Brittany: When I would click submit after putting in the credit card information the screen would grey out a little and then a red error message appeared at the top saying please check the following information. I didn’t realize I was making multiple purchases when clicking submit again. It just did not seem like the payments were going through. Thank you so much for getting this figured out for me. I appreciate your time.
Cassidie: The payment said it did not go through and apparently it did 3 times. I need to cancel order 77299 and 77300!