• Resolved doffine

    (@doffine)


    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)
  • 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 Support David G

    (@gravid7)

    Hi @doffine, @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

    (@doffine)

    Hi @gravid7, @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 – have you already implemented this solution and can say anything about it?

    Greetings and many thanks to both of you,
    -doffine

    Hi @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

    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 2 years, 9 months ago by vendidero.

    Hi, i still have the same problem with “germanized pro” and “Booster for Woo Commerce”. Has anyone found a solution? Greetings

    Plugin Author ronyp

    (@ronyp)

    Hello @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

    Hi Ronyp, thank you very much! After the last plugin update it works again! Greetings

    Plugin Author ronyp

    (@ronyp)

    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.