0

I'm using CartThrob v2.71 (the last available v2.x?) on EE v2.11.7 (the latest available v2.x) under PHP 7.0 (just upgraded) and now getting CP errors:

A PHP Error was encountered
Severity: 8192
Message: Non-static method Cartthrob_mcp::module_enabled() should not be called statically
Filename: cartthrob/mcp.cartthrob.php
Line Number: 264 [...and 251...]

Any suggested fix for this or am I being a cheapskate by not upgrading both EE and CartThrob to v3...?

0

Following the comment in the file, this seems to be a fix to remove the errors (though I don't use the Subscriptions addon):

/system/expressionengine/third_party/cartthrob/mcp.cartthrob.php

line 240:

    /*
    // EE chokes in template publishing with any CT tag on _validate when we're loading ct payments lib
    $EE->load->library('cartthrob_payments');

    if ($EE->cartthrob_payments->module_enabled('subscriptions'))
    {
        self::$nav['subscriptions_settings'] = array('subscriptions_settings' => '');
    }
    */

    $EE->load->library('cartthrob_payments');

    // if (self::module_enabled('subscriptions'))
    if ($EE->cartthrob_payments->module_enabled('subscriptions'))
    {
        self::$nav['subscriptions_settings'] = array('subscriptions_settings' => '');
    }       

    $modules = array(
        'Cartthrob_order_manager'   => 'om_sales_dashboard',
        'Ct_admin' => 'order_admin',
        'Cartthrob_item_options' => 'global_item_options',
    );

    foreach ($modules as $key => $module)
    {
        if ($EE->cartthrob_payments->module_enabled($key, NULL))
        // if (self::module_enabled($key, NULL))
        {
            self::$nav['modules'][$key] = array( $key => $modules[$key]);
        }
    }
    return self::$nav;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.