• Resolved Abland

    (@abland)


    I upgraded Woocommerce today to version 2.6.0 and all product pages worked fine but every other page on the website – cart, contact, about, etc – all whitescreened.

    Debug showed the following error:

    Fatal error: Call to a member function is_type() on boolean in /absolute/path/to/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php on line 809

    That line is:
    if ($product->is_type('variable') && is_single()) {

    I edited as follows which seems to have corrected the whitescreen and fatal error:
    if ($product->product_type == 'variable' && is_single()) {

    Now I get a notice:
    Notice: Trying to get property of non-object in /absolute/path/to/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php on line 809

    But the site works again now.

    https://www.ads-software.com/plugins/offers-for-woocommerce/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Contributor angelleye

    (@angelleye)

    We are a little behind on testing with 2.6. It seems we need to make an adjustment. We’ll get this done ASAP and get the update released. Thanks for the feedback!

    Cool…just got the same thing.

    Very nice plugin BTW!

    Plugin Contributor angelleye

    (@angelleye)

    We have made some adjustments in the dev branch on GitHub, which you can download here.

    If you want to grab that and update it manually I think it will resolve your issues. Please verify if you can.

    Works so far…thanks!

    I’ll post if I find anything.

    I updated today and now I can no longer access my home page or any of my pages except the product pages. I get this message:

    Fatal error: Call to a member function is_type() on a non-object in /home2/auntless/public_html/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php on line 809

    I’m pretty new at this, so I really need some help, please.
    Thank you

    My website:
    https://www.auntlessiesbooksandcollectibles.com

    Problem solved! I followed the solution given by Abland as follows:

    “I upgraded Woocommerce today to version 2.6.0 and all product pages worked fine but every other page on the website – cart, contact, about, etc – all whitescreened.

    Debug showed the following error:

    Fatal error: Call to a member function is_type() on boolean in /absolute/path/to/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php on line 809

    That line is:
    if ($product->is_type(‘variable’) && is_single()) {

    I edited as follows which seems to have corrected the whitescreen and fatal error:
    if ($product->product_type == ‘variable’ && is_single()) {

    Now I get a notice:
    Notice: Trying to get property of non-object in /absolute/path/to/wp-content/plugins/offers-for-woocommerce/public/class-offers-for-woocommerce.php on line 809

    But the site works again now.”

    THANKS Abland!

    Plugin Contributor angelleye

    (@angelleye)

    @mildred73120, glad you got it worked out. We already applied that adjustment to the code in our GitHub repo, though, and I had linked to that update in my previous response, so you could have just downloaded that and applied it.

    Glad you got it worked out one way or another! The next official update will include this adjustment, of course.

    Thanks @angelleye. I had the same issue but downloaded the update and it took care of the problem.

    By the way, I love the plugin, it’s awesome for our business. Thanks!

    Plugin Contributor angelleye

    (@angelleye)

    Glad to hear it! If you have a moment to leave a review for the plugin that would be great!

    Fatal error: Call to a member function get_upsell_ids() on a non-object in C:\xampp\htdocs\demo07\wp-content\plugins\woocommerce\includes\wc-template-functions.php on line 1324

    This is my error. i can not fixed it. Please solve this one.

    Fatal error: Call to a member function get_upsell_ids() on a non-object in C:\xampp\htdocs\demo07\wp-content\plugins\woocommerce\includes\wc-template-functions.php on line 1324

    This is my error. i can not fixed it. Please solve this one.

    Plugin Contributor angelleye

    (@angelleye)

    @foding, are you running WooCommerce 3.0? We are not yet fully compatible. We are currently working on the update that will fix this, and it should be ready within a week or so.

    Hello
    i am running Woocommerce 3.07 and got this error, however, the site has been running ok. kindly give direction.

    Fatal error: Call to a member function is_on_sale() on null in /home//public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php on line 26

    Plugin Contributor angelleye

    (@angelleye)

    Our latest version, 1.4.4, is compatible with WC 3.0 so that wouldn’t be an issue anymore.

    Based on the error I would say there is a problem with your theme. Can you try switching to one of the basic Twenty themes temporarily to see if that issue goes away?

    Hello
    @angelleye

    Thanks for the response
    yes i switched the themes and the error still occurred and even deactivated the plugins and still it dint go away

    line 26 = <?php if ( $product->is_on_sale() ) : ?> just after global $post, $product;

    the Single Product Sale Flash php file has the following information

    Full code

    <?php
    /**
    * Single Product Sale Flash
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/single-product/sale-flash.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @see https://docs.woocommerce.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    global $post, $product;

    ?>
    <?php if ( $product->is_on_sale() ) : ?>

    <?php echo apply_filters( ‘woocommerce_sale_flash’, ‘<span class=”onsale”>’ . esc_html__( ‘Sale!’, ‘woocommerce’ ) . ‘</span>’, $post, $product ); ?>

    <?php endif;

    /* Omit closing PHP tag at the end of PHP files to avoid “headers already sent” issues. */

    Regards

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Fatal error on Woocommerce update’ is closed to new replies.