BuddyForms / BuddyForms-WooCommerce-Form-Elements

This Plugin adds a new section to the BuddyForms Form Builder with all WooCommerce fields to create Product creation forms for the frontend
GNU General Public License v2.0
3 stars 3 forks source link

Woocommerce 3: Error on product type while rendering the form #8

Closed thiriet closed 7 years ago

thiriet commented 7 years ago

Hi,

There is an error when rendering the form :

Fatal error: Call to a member function get_type() on boolean in .../wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-panel.php on line 8

This error is displayed in the product type dropdown (id="product-type"), in the option with value="simple".

I debugged a bit, and here is what I found out: the error is triggered by the method get_type() called on $product_object: selected( $product_object->get_type(), $value, false )

The $product_object object is instanciated in the static function output (declared in this woocommerce class: WC_Meta_Box_Product_Data) which has been mainly rewritten in woocommerce v3.

Thx for your help, Raphael