• Resolved pako69

    (@pako69)


    with errors:

    PHP Fatal error: Uncaught Error: Call to undefined function WC()

    Help ! Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • mother.of.code

    (@imazed)

    The Mother of Code

    Hi! That sounds like WooCommerce is having a bit of trouble with one of the other active elements on your site. You can read more about plugin and theme conflicts here: https://docs.woocommerce.com/document/woocommerce-self-service-guide/

    The best way to determine if the issue is being caused by a theme and/or plugin is to do the following:

    1. Temporarily switch your theme back to the Storefront theme (it’s free)
    2. Disable all plugins except for WooCommerce
    3. Test to see if the issue has been resolved.
    4. If that resolves the issue, then slowly re-enable features until you find the one that’s causing the conflict.

    This is best done on a staging site. That’s a copy of your live site, so you can test things out without making changes to your actual site. Some hosting companies offer a staging site service within their hosting plans. If yours does not, there is a great free plugin that will allow you to build a complete staging site with a few button clicks: https://wordpress.org/plugins/wp-staging.

    Thread Starter pako69

    (@pako69)

    It was used in my site here:

    /* Remove the default WooCommerce 3 JSON/LD structured data */
    function remove_output_structured_data() {
      remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); // This removes structured data from all frontend pages
      remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); // This removes structured data from all Emails sent by WooCommerce
    }
    add_action( 'init', 'remove_output_structured_data' );

    and here:

    `// first, bail if WC isn’t active since we’re hooked into a general WP hook
    if ( ! function_exists( ‘WC’ ) ) {
    return;
    }`

    Thread Starter pako69

    (@pako69)

    I have the issue:
    When the WooCommerce plugin is updated, it seems that it is also desactivated so a a call to WC() function failed.

    Plugin Support RK a11n

    (@riaanknoetze)

    Just to make sure – you managed to get to the bottom of that and resolved the issue with the custom coding on your site, right?

    Thread Starter pako69

    (@pako69)

    Yes 😉

    Same Issue for me. After upgrading to the latest version for 4.1.0, php 7.2. Totally sit get damaged. Please rectify this issue as soon as possible.

    Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Database error. in /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php(242): ActionScheduler_DBStoreMigrator->save_action(Object(ActionScheduler_Action), NULL) #1 /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(177): ActionScheduler_HybridStore->save_action(Object(ActionScheduler_Action)) #2 /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(84): ActionScheduler_ActionFactory->store(Object(ActionScheduler_Action)) #3 /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/functions.php(32): ActionScheduler_ActionFactory->single(‘act in /home/dh_y8iqyh/ohbaby.me/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php on line 44
    There has been a critical error on your website. Please check your site admin email inbox for instructions.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    Hi @godwinwebdesignbahrain

    It sounds like another of your plugins or your theme may be conflicting with the latest version of WooCommerece. You can read more about plugin and theme conflicts in our Self-Service Guide.

    Here’s how you can figure out which one may be causing the problem:

    Before you start

    • First, please make sure you have a good backup in place of your full site and database. Most hosting companies have this included in the subscription, but you could also consider using a service like Jetpack. If something goes wrong, it’s nice to know that you can restore your site.
    • Second, I would suggest to install a plugin called Health Check & Troubleshooting. This is a plugin developed by the WordPress community and it allows you to disable plugins without effecting your current site visitors.

    How to test for conflicts
    In order to test for conflicts using Health Check & Troubleshooting:

    1. Go to Tools > Site Health > Troubleshooting.
    2. Select Enable Troubleshooting Mode. This will disable all your plugins and set your theme to a default one.
    3. Go to Plugins. There you can enable WooCommerce by selecting Enable While Troubleshooting.
    4. Try to reproduce the error. If the error is resolved, it’s clearly a conflict. Now we need to figure out which plugin is causing this conflict.
    5. If you can’t reproduce the problem with only WooCommerce enabled, go ahead and re-enable the other plugins one by one. Test after each one until the error occurs again – this will tell you which plugin is conflicting.
    6. If you are unable to reproduce the error with the rest of your plugins enabled it could be your theme causing the conflict. To test for this, please enable your original theme at your WordPress Dashboard in the Troubleshooting Mode section at the top (it will look similar to this: https://d.pr/i/bbvkLY). In the Troubleshooting window, you’ll be able to see a dropdown with available themes. Choose the one you normally use. Try reproducing the error you’re experiencing. If you can reproduce it, your theme is the source of the conflict.

    Once you’ve done that, please check out How to test for plugin and theme conflicts and follow the steps there. Please let us know how that goes.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please feel free to start a new thread.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Version 4.1.0 breaks my site: PHP Fatal error’ is closed to new replies.