Fatal error on Divi template builder

[ad_1]

Hi there,

Your plugin is causing an issue on Divi 4.24.3 and possibily other versions, under PHP 8.2+

The error is the following:

[09-Apr-2024 12:08:21 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_meta() on bool in <ABSPATH>/wp-content/plugins/elex-product-price-custom-text-before-after-text-and-discount-for-woocommerce/includes/SettingsController.php:433

It also impacts line 435.

I’ve replaced the lines with the following:

433: $custom_check_enable = $product_info ? $product_info->get_meta( 'elex_ppct_custom_fields_checkbox' ) : 'no';

435: $custom_discount_checkbox = $product_info ? $product_info->get_meta( 'elex_ppct_custom_fields_discount_type_checkbox' ) : 'no';

I am not sure why you are trying to fetch the product once again in line 432, since normally you should already have the product passed in the second function parameter.

Either way, if you could get a chance to investigate this and fix in in next releases, it would be great.

Best regards,
Adrian

  • This topic was modified 15 hours, 36 minutes ago by railmedia.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer