PHP 8 Compatibility
-
Howdy!
In order to get priced dropdown options to work on a FRESH Woocommerce store that uses PHP 8.0.3, I had to comment out the AddToCartValidation filter
/core/Managers/WooStagesManager.php, Line 46
//add_filter( 'woocommerce_add_to_cart_validation', array($this,'AddToCartValidation'), 10, 4 );
Prior to doing this, I would get the error “Invalid product price, please try again.” whenever trying to add a product to the cart that had a dropdown option with a price associated with it. (Radio Buttons worked just fine, so did priceless dropdowns)
I Will update if I manage to make this work without disabling the validation. As of now it’s seemingly functional but has errors when used
Warning: Undefined property: stdClass::$FieldName in /home/testsite/public_html/wp-content/plugins/additional-product-fields-for-woocommerce/core/Managers/FormManager/Fields/FBTextField.php on line 26 Warning: Undefined property: stdClass::$FieldName in /home/testsite/public_html/wp-content/plugins/additional-product-fields-for-woocommerce/core/Managers/FormManager/Fields/FBMultipleOptionsField.php on line 82
Haven’t looked into the files any further than the WooStagesManager but I’m sure it’s just some scoping or comparator issue brought on by the breaking changes in php8.
Crossing my fingers that compatibility is on the horizon
- The topic ‘PHP 8 Compatibility’ is closed to new replies.