Title: eval()&#8217;d code error
Last modified: May 6, 2025

---

# eval()’d code error

 *  Resolved [Strawberry](https://wordpress.org/support/users/cheesecake4488/)
 * (@cheesecake4488)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/evald-code-error-3/)
 * **I switched woocommerce single classic product editor to Guthenburg editor using
   the following snippet.** Thank you very much is someone could help. There is 
   nothing wrong when
 *     ```wp-block-code
       / enable gutenberg for woocommerce
       function activate_gutenberg_product( $can_edit, $post_type ) {
       if ( $post_type == 'product' ) {
       $can_edit = true;
       }
       return $can_edit;
       }
       add_filter( 'use_block_editor_for_post_type', 'activate_gutenberg_product', 10, 2 );
       // enable taxonomy fields for woocommerce with gutenberg on
       function enable_taxonomy_rest( $args ) {
       $args['show_in_rest'] = true;
       return $args;
       }
       add_filter( 'woocommerce_taxonomy_args_product_cat', 'enable_taxonomy_rest' );
       add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' );
       ```
   
 * Error Details
   =============An error of type E_ERROR was caused in line 10 of 
   the file eval()’d code.
 * Error message: Uncaught Error: Call to a member function get_price() on bool 
   in  : eval()’d code:10

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [1 year ago](https://wordpress.org/support/topic/evald-code-error-3/#post-18500868)
 * Hi [@cheesecake4488](https://wordpress.org/support/users/cheesecake4488/),
 * I believe the error you refer to must be coming from a different snippet – I 
   can’t see any issues with the one you posted.

Viewing 1 replies (of 1 total)

The topic ‘eval()’d code error’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/evald-code-error-3/#post-18500868)
 * Status: resolved