Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    I believe this is a theme issue: I cannot replicate this on my own install.

    Which theme do you use? And which version of WordPress / WooCommerce?

    Thanks!
    Ewout

    Thread Starter themarcopolo

    (@themarcopolo)

    Tesseract theme, wp 4.2.2 , wc 2.3.8

    Plugin Contributor Ewout

    (@pomegranate)

    Do you also get this error with another theme (like Twenty Fifteen)?

    Thread Starter themarcopolo

    (@themarcopolo)

    Error is not happening again so can’t test with other theme

    Hey themarcopolo, what was the fix for this error? I’m having the same error on same theme.

    Thread Starter themarcopolo

    (@themarcopolo)

    Hi I didn’t do anything special to be honest just deactivated and when asked to try on other theme I activated it again and tried first on original theme and the error did not happen any more.

    I got the same error after activating BridgeDD. Are your plugin using any of this variables: “WordPress plugins cannot use constants defined by phpBB, and certain class and variable names should not be used. In particular, use of the class names $db, $auth, and $cache, and the variable name $config, can potentially cause issues.”

    Best Regards

    I just did a quick check and this is a bug in WooCommerce itself. This is the offending code:

    // Classes/actions loaded for the frontend and for ajax requests
    		if ( $this->is_request( 'frontend' ) ) {
    			// Session class, handles session data for users - can be overwritten if custom handler is needed
    			$session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
    
    			// Class instances
    			$this->session  = new $session_class();
    			$this->cart     = new WC_Cart();                                    // Cart class, stores the cart contents
    			$this->customer = new WC_Customer();                                // Customer class, handles data such as customer location
    		}

    In the file mentioned in the error message, here is what causes the error:

    $menu_item = array(
    				'cart_url'				=> $woocommerce->cart->get_cart_url(),
    				'shop_page_url'			=> get_permalink( woocommerce_get_page_id( 'shop' ) ),
    				'cart_contents_count'	=> $woocommerce->cart->get_cart_contents_count(),
    				'cart_total'			=> strip_tags( $cart_contents_total ),
    			);

    Your menu plugin is calling functions in WooCommerce that aren’t loaded in the admin panel. Whether it’s a bug in WooCommerce or the menu plugin can be decided between the authors of the two plugins. But it’s a bug in one of them, and that bug is causing the error encountered.

    PS: So please check for the existence of the $woocommerce->cart class, and if it doesn’t exist, please create an instance.

    Plugin Contributor Ewout

    (@pomegranate)

    @leinad4mind
    Thank you so much for the heads up on this! I still cannot replicate the bug, but I will make sure this gets fixed in the next release!

    Have a fantastic weekend!
    Ewout

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Activation breaks customise’ is closed to new replies.