Title: Fatal error. Cannot access protected property
Last modified: June 8, 2022

---

# Fatal error. Cannot access protected property

 *  Resolved [doffine](https://wordpress.org/support/users/doffine/)
 * (@doffine)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/)
 * Hello,
 * we keep getting a fatal error message when invoices are sent to the customer 
   in woocommerce.
 * ——————————————————
 * Fatal Error: Uncaught Error: Cannot access protected property Vendidero\StoreaBill\
   Invoice\Simple::$id in /home/xxx/www.xxx.de/wp-content/plugins/woocommerce-jetpack/
   includes/class-wcj-product-by-user.php:81
    Stack trace: #0 /home/xxx/www.xxx.
   de/wp-includes/class-wp-hook.php(309): WCJ_Product_By_User->sendemail_to_productowner_order_place_successfully(‘
   Content-Type: t…’, ‘sab_simple_invo…’, Object(Vendidero\StoreaBill\Invoice\Simple))#
   1 /home/xxx/www.xxx.de/wp-includes/plugin.php(189): WP_Hook->apply_filters(‘Content-
   Type: t…’, Array) #2 /home/xxx/www.xxx.de/wp-content/plugins/woocommerce/includes/
   emails/class-wc-email.php(425): apply_filters(‘woocommerce_ema…’, ‘Content-Type:
   t…’, ‘sab_simple_invo…’, Object(Vendidero\StoreaBill\Invoice\Simple), Object(
   Vendidero\StoreaBill\Emails\SimpleInvoice)) #3 /home/xxx/www.xxx.de/wp-content/
   plugins/woocommerce-germanized-pro/packages/storeabill/src/Emails/Document.php(
   117): WC_Email->get_headers() #4 /home/`
 * ——————————————————
 * WordPress-Version 5.9.3
    Activated Theme Theme: Avada (Version 7.7.1) Activated
   Plugin: Booster for WooCommerce (Version 5.5.8) PHP-Version 7.4.29
 * This error occurs while using the Plugin “Booster for WooCommerce” and “Germanized
   Pro”.
 * We already reached out to the Germanized Pro Support of course. They said the
   following:
 * “You can see from the error stack that this is a problem with the WooCommerce
   booster plugin. There it seems that certain checks are carried out and unfortunately
   not checked properly, so that a fatal error occurs.”
 * Could you check if this is a bug and possibly fix it? Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [mirkogosch](https://wordpress.org/support/users/mirkogosch/)
 * (@mirkogosch)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15722497)
 * I´m getting the same error message – also using WooCommerce-Germanized and woocommerce-
   jetpack.
 * I´d be great if your developers could fix the problem timely.
 * Thank you so much for your support.
 * BTW: We are currently running a test to see if the following change in line 81
   of the class-wcj-product-by-user.php will fix the problem:
 * The original line 81 reads: $useremail = $this->getProductOwnerEmail( $order-
   >id );
 * The proposed solution of our developer is the following:
    $useremail = $this-
   >getProductOwnerEmail( $order->get_id() );
 * I´ll report back if this solves the problem.
 * Greets
 * Mirko
 *  Plugin Contributor [David G](https://wordpress.org/support/users/gravid7/)
 * (@gravid7)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15731215)
 * Hi [@doffine](https://wordpress.org/support/users/doffine/), [@mirkogosch](https://wordpress.org/support/users/mirkogosch/)
 * Thanks for reaching out to us.
 * Can you please replace ‘$order->id’ with ‘$order->get_id()’ in line number 81.
   And let me know if issue is still not solved.
 * wp-content/plugins/woocommerce-jetpack/includes/class-wcj-product-by-user.php
 *  Thread Starter [doffine](https://wordpress.org/support/users/doffine/)
 * (@doffine)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15732602)
 * Hi [@gravid7](https://wordpress.org/support/users/gravid7/), [@mirkogosch](https://wordpress.org/support/users/mirkogosch/),
 * since we are not versed in things like that and because we don’t want to have
   any risk for our customer’s shop we would prefer not to make this test on our
   site and would like to wait until an official update is there.
 * [@mirkogosch](https://wordpress.org/support/users/mirkogosch/) – have you already
   implemented this solution and can say anything about it?
 * Greetings and many thanks to both of you,
    -doffine
 *  [vendidero](https://wordpress.org/support/users/vendidero/)
 * (@vendidero)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15743385)
 * Hi [@gravid7](https://wordpress.org/support/users/gravid7/),
 * plugin owner of Germanized here. This issues occurs due to missing checks in `
   WCJ_Product_By_User::sendemail_to_productowner_order_place_successfully()`. See:
   [https://github.com/pluggabl/woocommerce-jetpack/blob/master/includes/class-wcj-product-by-user.php#L80](https://github.com/pluggabl/woocommerce-jetpack/blob/master/includes/class-wcj-product-by-user.php#L80)
 * You are filtering `woocommerce_email_headers` and should not assume that every
   email template registered in WooCommerce contains a `WC_Order` as object (btw:
   Using `$order->id` is deprecated – you should use `$order->get_id()` instead).
   Please check whether the object is a `WC_Order` or not before accessing the id.
 * Cheers
    -  This reply was modified 4 years, 1 month ago by [vendidero](https://wordpress.org/support/users/vendidero/).
 *  [capmarv](https://wordpress.org/support/users/capmarv/)
 * (@capmarv)
 * [4 years ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15773442)
 * Hi, i still have the same problem with “germanized pro” and “Booster for Woo 
   Commerce”. Has anyone found a solution? Greetings
 *  Plugin Author [ronyp](https://wordpress.org/support/users/ronyp/)
 * (@ronyp)
 * [4 years ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15785174)
 * Hello [@capmarv](https://wordpress.org/support/users/capmarv/),
 * Did you update the plugin to the latest version?
    Please upgrade and make below
   quick changes.
 * File: includes/class-wcj-product-by-user.php
    On Line: 95 Please change “$order-
   >id” to “wcj_get_order_id( $order )”
 * BEFORE: $useremail = $this->getProductOwnerEmail( $order->id );
    AFTER: $useremail
   = $this->getProductOwnerEmail( wcj_get_order_id( $order ) );
 * Kind Regards,
    RonyP – Support Team
 *  [capmarv](https://wordpress.org/support/users/capmarv/)
 * (@capmarv)
 * [4 years ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15785558)
 * Hi Ronyp, thank you very much! After the last plugin update it works again! Greetings
 *  Plugin Author [ronyp](https://wordpress.org/support/users/ronyp/)
 * (@ronyp)
 * [4 years ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15788722)
 * Hello,
 * We have fixed the above and released a new version. Kindly please upgrade and
   let me know.
 * Kind Regards,
    RonyP – Support Team

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Fatal error. Cannot access protected property’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-jetpack/assets/icon-256x256.png?rev=3351194)
 * [Booster for WooCommerce – PDF Invoices, Abandoned Cart, Variation Swatches & 100+ Tools](https://wordpress.org/plugins/woocommerce-jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-jetpack/reviews/)

 * 8 replies
 * 6 participants
 * Last reply from: [ronyp](https://wordpress.org/support/users/ronyp/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/#post-15788722)
 * Status: resolved