Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Bug in class-wcj-product-by-user.php

$
0
0

Replies: 0

Hi there,

Fatal Error: Uncaught Error: Cannot access protected property XXX::$id in /home/xxx/www.xxx.de/wp-content/plugins/woocommerce-jetpack/includes/class-wcj-product-by-user.php:81

as reported here: https://wordpress.org/support/topic/fatal-error-cannot-access-protected-property/

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.

Could you please look into this?

Cheers


Viewing all articles
Browse latest Browse all 59525

Trending Articles