+1. We just ran into this as well. I just fixed it by doing this:
$product_children = $product->get_children();
if ( ! empty ( $product_children ) ) {
instead of
if ( ! empty ( $product_children = $product->get_children()) ) {
Thank you @vincentjames501.
Of course it would be nicer if a fix were released.
Hi guys,
This looks like a PHP notice due to the usage of empty with a return value which is a problem on pre-Php 5.6 versions.
Can you confirm for me which PHP version you are on?
To update to 5.6+ check your hosting control panel or contact your host.
I’ll have one of the devs check this out and we will release a patch early next week at the latest.
Cheers,
Josh
Hi Josh, my PHP version is definitely older than 5.6 (I’d say 5.4.4).
Not sure I can update it, though.
Do you think the patch will work with older versions of PHP?
Hi Marco,
We officially support 5.4+ but as with WooCommerce core we recommend 5.6 as the recommended min.
This bug must have slipped through in our testing unfortunately, my apologies!
The patch we release will ensure that it will work with 5.4 but your best course of action right now would be to contact your host and upgrade to 5.6. 5.4 technically isn’t actually supported by the PHP team anymore, even for security patches (5.4 version is over a decade old).
Hope you can get a quick resolution via your host otherwise please feel free to manually apply the code change as suggested by Vincent above and then once the patch comes through you should be fine to update.
Cheers,
Josh
Hi guys,
UPDATE: We have released a patch version 1.4.5, please go ahead and update and this will correct the error.
Just reiterate this was a PHP 5.4 specific syntax error. I highly recommend anyone using PHP 5.4 to update to at least PHP 5.6, preferably PHP 7+.
Thanks for your patience and sorry for the inconvenience.
Cheers,
Josh