• Resolved thomasstone

    (@thomasstone)


    Hi

    We are on WooCommerce v2.4.x and found that a site completely stopped working due to a PHP fatal error relating to the plugin

    PHP Fatal error: Call to undefined method WC_Product_Variable::get_id()

    After digging through the plugin code this appears to be due to lines like the following:

    if (version_compare($woocommerce->version, "2.4", "<=")) {
        category = get_the_terms($product->Id, "product_cat");
    } else {
        $category = get_the_terms($product->get_id(), "product_cat");
    }

    When this function was added after 2.6:

    https://docs.woocommerce.com/wc-apidocs/source-class-WC_Data.html#144-152

    Replacing 2.4 with 2.6 fixed the problem.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Conversios

    (@tatvic)

    Hi Thomas,

    Thank you for sharing concern!

    We will surely look into this & fix this in the next release of our plugin.

    Thanks & Regards!

    Plugin Author Conversios

    (@tatvic)

    Hi Thomas,

    The new version of our plugin is now available with the fixes of this issue.

    Kindly update our plugin.

    Happy Analyzing!

    Thread Starter thomasstone

    (@thomasstone)

    Great, thanks!

    Plugin Author Conversios

    (@tatvic)

    Hi Thomas,

    Hope you are doing well & enjoying our plugin ??

    Since you are satisfied with our plugin, we would appreciate if you can review our plugin. Your reviews will help other users to try our plugin.

    Looking forward to your review!

    Thanks & Regards!

    • This reply was modified 7 years, 6 months ago by Conversios.
    Plugin Author Conversios

    (@tatvic)

    Hi Thomas,

    Just read your Review!

    Thanks a ton for your Fantastic Review!

    Happy Analytics ??

    I’m seeing a similar error on this page:
    https://valhalladsp.com/shop/plugins/valhalla-vintage-verb/

    The logs report the following:
    PHP Fatal error: Call to a member function get_id() on null in /nas/content/live/valhalladsp/wp-content/plugins/enhanced-e-commerce-for-woocommerce-store/includes/class-wc-enhanced-ecommerce-google-analytics-integration.php on line 537

    Digging in a bit the $product global isn’t being populated for this page.

    Plugin Author Conversios

    (@tatvic)

    Hi Smith,

    Thank you for contacting us!

    We did a quick look of your store & found the following outcomes:

    1. Our plugin is working out of the box on your store except for “Product” page.
    2. Neither Woocommerce nor our plugin’s versioning issue.
    3. Found javascript error only on the “product” page of your store which may be hindered the functionality of our plugin (screenshot).

    We request you to resolve the error & verify it again. after the if you still get the same error; contact us at analytics2(at)tatvic(dot)com.

    Hope this Helps!

    Thanks & Regards!

    • This reply was modified 7 years, 6 months ago by Conversios.

    Actually that JavaScript error is representing the error I mentioned.

    In other words this error behind the scenes:
    PHP Fatal error: Call to a member function get_id() on null in /nas/content/live/valhalladsp/wp-content/plugins/enhanced-e-commerce-for-woocommerce-store/includes/class-wc-enhanced-ecommerce-google-analytics-integration.php on line 537

    That is causing that error in the console. If I disable the plugin it goes away.

    Plugin Author Conversios

    (@tatvic)

    Hi Smith,

    Thank you for getting back to us!

    It’s strange because “Failed to load resource: the server responded with a status of 500 (Internal Server Error) ” is not at all related to our plugin. It seems like the conflict between Ajax & Jquery on the “Product Page”.

    But we request you to contact us at analytics2(at)tatvic(dot)com so we can assist you further regarding your query.

    Hope to hear you soon!

    Thanks & Regards!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Fatal error with WooCommerce’ is closed to new replies.