Title: PHP 8 Compatibility
Last modified: April 27, 2021

---

# PHP 8 Compatibility

 *  [grower](https://wordpress.org/support/users/grower/)
 * (@grower)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/php-8-compatibility-14/)
 * 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.

 * ![](https://ps.w.org/additional-product-fields-for-woocommerce/assets/icon-256x256.
   png?rev=3288566)
 * [Extra Product Options Builder for WooCommerce](https://wordpress.org/plugins/additional-product-fields-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/additional-product-fields-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/additional-product-fields-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/additional-product-fields-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/additional-product-fields-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/additional-product-fields-for-woocommerce/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [grower](https://wordpress.org/support/users/grower/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/php-8-compatibility-14/)
 * Status: not resolved