• I am receiving this error after upgrading the MyParcel plugin to version 4.18.6 and using the export to MyParcel button to create a shipment:

    CRITICAL Uncaught Error: Call to a member function get_data() on bool in /home/u38303p33606/domains/ourdomainname.nl/public_html/wp-content/plugins/woocommerce-myparcel/includes/admin/class-wcmp-export-consignments.php:354

    I even tested it in an environment with only WooCommerce and the MyParcel plugin enabled and the result stayed the same. When I downgrade the MyParcel plugin to the previous used version (4.15.1) we have no problem at all. We don’t have a frontend by the way.

    Hopefully you can help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @barthusz same problem here. When I look in the code the issue is caused if the product doesn’t exist anymore.

    MyParcel, would you please validate if the product exists before invoking a method on the product?

    Workaround includes/admin/class-wcmp-export-consignments.php : 352

          $data = $item
             ->get_product()
             ->get_data();



    To

          $product = $item->get_product();
            if(!$product) continue;
            $data = $product->get_data();

    Thread Starter barthusz

    (@barthusz)

    Thanks a lot @gamecreature for the workaround!

    Unfortunately MyParcel still did not fixed this issue. We use imported products (via WP All Import) and these products are not available in WooCommerce. So I guess this is causing the problem.

    Another downside is that we cannot use the extra options for the labels now. I would like to print the product name on the label but with the variable [PRODUCT_NAME] which can be used in the export settings of the plugin I get nothing on the label if the product does not exist in WooCommerce. Can this also be fixed MyParcel?

    Plugin Author MyParcel Support

    (@myparcelsupport)

    Hi @barthusz

    The variable issue that you are facing will be fixed in our new version, we will be mailing all our customers next Monday 16-10-23, 11:00 CEST with our new release.

    Regarding the issue with the imported products (WP All Import), I am not sure if this is a compatibility issue or an issue on our end. If you would like for us to take a look, be sure to reach us at [email protected]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call to a member function get_data() on bool’ is closed to new replies.