• Resolved t0str

    (@t0str)


    Hello everyone,

    I’m getting a 500 internal server error when i activate WooCommerce on Customizr theme (although when I change the theme to a different one the error also appears).

    When I deactivate the plugin manually via FTP (because I can’t access the site or the wp-admin when the plugin is active) this error shows up:

    Fatal error: Call to undefined function WC() in /wp-content/themes/customizr/core/front/models/header/parts/class-model-woocommerce_cart.php on line 30

    I know next to nothing about PHP, so I have no idea what can casue this problem.

    I’m using Mozilla Firefox or on a Windows 10 64bit PC. But I’ve also had this error when using Google Chrome on Windows 7.

    Here is my system info:

    # IS MULTISITE : No
    
    # THEME | VERSION : customizr | v4.1.4# WP VERSION : 4.9.5
    # PERMALINK STRUCTURE : /%postname%/
    
    # ACTIVE PLUGINS :
    Polylang: 2.3.5
    Wordfence Security: 7.1.4
    WPBakery Visual Composer: 4.11.1
    Yoast SEO: 7.4.2
    
    PHP Version: 5.3.29
    MySQL Version: 5.7.19-17-log
    Web Server Info: IdeaWebServer/0.83 (like Apache)
    
    WordPress Memory Limit: 40MB
    PHP Memory Limit: 256M
    PHP Upload Max Size: 64M
    PHP Post Max Size: 64M
    PHP Upload Max Filesize: 64M
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    PHP Arg Separator: &
    PHP Allow URL File Open: Yes
    WP_DEBUG: Disabled
    
    Show On Front: page
    Page On Front: Homepage (#4953)
    Page For Posts: News (#4960)

    I’ve got no solution from the theme support or from any other forum topics I’ve went through that had similar problems.

    Thanks in advance for any help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    Hi there, could you try this with the Storefront theme or TwentySeventeen as well. Which error do you get then?

    Could you also share what line 30 of that file says?

    Thread Starter t0str

    (@t0str)

    The 500 Internal Server Error appears regardless of the active theme (I checked it with both Storefront and TwentySeventeen) and it wont go away until i manually disable the WooCommerce plugin.

    The line 30 of the file is this:
    $this->wc_cart_url = esc_url( WC()->cart->get_cart_url() );

    I don’t know if this will help, but this is how the entire function looks (lines 14 to 33 of the file):

        public function __construct( $model ) {
            parent::__construct( $model);
    
            //This filter should be added once only.
            //There might be various instances of this object but we don't want it to be added more than once
            if ( empty( self::$_woocart_filter_added ) ) {
                self::$_woocart_filter_added = true;
                add_filter( 'woocommerce_add_to_cart_fragments', array( $this, 'czr_fn_woocommerce_add_to_cart_fragment' ) );
            }
    
            // fix for: https://github.com/presscustomizr/customizr/issues/1223
            // WC_Cart::get_cart_url is <strong>deprecated</strong> since version 2.5! Use wc_get_cart_url instead.
            //
            if ( function_exists( 'wc_get_cart_url' ) ) {
                $this->wc_cart_url = esc_url( wc_get_cart_url() );
            } else {
                $this->wc_cart_url = esc_url( WC()->cart->get_cart_url() );
            }
    
        }
    Plugin Support Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    Hey @t0str – I’ve just enabled Customizr with WC 3.4 without problem. I think doing a conflict test will be a good next step. Please make a backup before you do so.

    1. Do you have any custom code active anywhere? If so, try disabling that.

    2. If you don’t, This kind of problem is usually caused by either a conflict with another plugin. If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you while you’re logged in to that session without affecting normal visitors to your site. Note that Health Check may not count Storefront as a default theme, so you can also use Twenty Seventeen as well.

    If that resolves the issue, then one-by-one you can switch back your theme and re-enable your plugins, testing in between, until you find the one causing the conflict.

    Thread Starter t0str

    (@t0str)

    @jobthomas thanks for the quick response, I’ll try to do what you suggest and I hope that it will help!

    Plugin Support RK a11n

    (@riaanknoetze)

    Please let us know if you managed to resolve things ??

    Just a quick note: If we don’t hear anything from you in a few days. we’ll assume you’re all set and will close the thread.

    Hi, excuse me for jumping the thread – I may have the same problem. It’s only with WC 3.4, though. Up to 3.3.1 I also have problems but different ones (jQuery conflicts). (Unless there’s a connection?)

    I’m running WP 4.9.6 with WP-Rootstrap whateverthelatestversionwas on a multisite install with Woocommerce on one of the sites. I’ve already done the whole bit about switching themes for the ones recommended up-thread and switching the plugins off and on again. Health check warns me my php (5.3.29, same as @t0str’s) and MySQL (5.1.73) are out of date (something I sadly have no control over at the moment) but apart from that it’s all good, allegedly.

    I didn’t try to update Woocommerce while in Health Check’s troubleshooting mode because such an update would affect the actual site, too, wouldn’t it? All I could find out was that my 3.3.1. jQuery problem was still there. (I may ask about that seperately later, once I’m clearer on what the problem is.)

    Thread Starter t0str

    (@t0str)

    It seems that I solved the problem.

    I’m supprised that it was a thing that I didn’t even think about – updating the PHP interpreter on the server to 5.6. So @maxvaehling maybe you should try doing it too when you’ll have the chance.

    Anyway, thanks everyone for their support!

    I even wanted to suggest that, based on that we both had the same php version, but since it was higher than the one recommended for the update, I didn’t. Thanks, @t0str!

    Dang! Now I’ll have to move the site after all…

    Hey @t0str,

    Thanks for the update! Going to mark this resolved now.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WooCommerce crashing site upon activation’ is closed to new replies.