• Resolved badro0

    (@badro0)


    Hello,

    I am using this function $product->get_available_variations in my theme, and since the last Woocommerce update (to version 3.1.1) i’m getting this error:

    Fatal error: Call to undefined method WC_Product_Simple::get_available_variations() in [……]\wp-content\themes\themename\woocommerce\loop\price.php

    when i deactivate the plugin the function works fine.

    Edit: the product is variable, and as i see it’s treated like a simple product.

    Regards

    • This topic was modified 7 years, 7 months ago by badro0.
    • This topic was modified 7 years, 7 months ago by badro0. Reason: mistake in the subject
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello

    Very strange !!!

    Yes WC_Product_Simple has no this method.

    Woosc – changes prices only with the help of hooks. This plugin can not change the product class.
    Try to exclude 3-party plugins.
    Disable all plugins except woo+woocs do test!

    Read this please – https://currency-switcher.com/currency-recounts-wrong-double-zero-and-others/

    Thread Starter badro0

    (@badro0)

    Hello,

    Thank you for the response.

    I tried deactivating all plugins except woo+woocs but the problem persists. It’s only solved when i deactivate woocs or if i remove $product->get_available_variations use in the loop.

    what’s even more strage is when i var_dump the $product before the function use it seems to be a WC_Product_Variable object, yet when the function call happens i get that error saying it’s a WC_Product_Simple object..

    Thread Starter badro0

    (@badro0)

    The problem is solved actually it was something else causing the problem.

    Thank you for your help.

    Hello

    Welcome;)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WC last update: The plugin Causes a fatal error’ is closed to new replies.