• Hello,

    I get a fatal php error on my whole wordpress frontend:

    Fatal error: Call to a member function get_permalink() on boolean in /wp-content/plugins/woocommerce/includes/class-wc-post-data.php on line 55

    Both wordpress and woocommerce are on the newest version, no files are touched.
    Can you help me with this?

    Thanks,
    Jonas

    • This topic was modified 7 years, 10 months ago by jon.sig.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I have this exact same error but instead in the XML file created via Tools / Export. WooCommerce 2.6.14 on WordPress 4.7.2. The XML file is cut-off because of this error message, making the export unusable.

    • This reply was modified 7 years, 9 months ago by networkactiv.
    • This reply was modified 7 years, 9 months ago by networkactiv.

    If you change the core function in /wp-content/plugins/woocommerce/includes/class-wc-post-data.php to:

    public static function variation_post_link( $permalink, $post ) {
    
    		if ( 'product_variation' === $post->post_type ) {
    			$variation = wc_get_product( $post->ID );
                            if($variation) {
                               $permalink = $variation->get_permalink();
                            }	
    		}
    		return $permalink;
    	}

    It solved the issue for me, but is not ideal

    @juan-uniq — does this solve the import problem, or keep the export file from being cut off?

    I don’t have the second problem, this happens for me on import.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal PHP error’ is closed to new replies.