Jump to content

Fatal error Mailchimp (language) : impossible de charger module


Recommended Posts

Bonjour à tous,

J'essaye d'importer le module mailchimp (https://addons.prestashop.com/en/newsletter-sms/26957-mailchimp.html) sur mon 1.6.0.9. Impossible, voici ce que j'obtiens :

Fatal error: Call to undefined method Language::getIDs() in /home/xxxxx/www/modules/mailchimppro/src/PrestaChamps/PrestaShop/Tab/TabInstaller.php on line 54
[PrestaShop] Fatal error in module TabInstaller:
Call to undefined method Language::getIDs()

Que puis-je faire pour que cela fonctionne ?

Merci d'avance.
Sandrine.

Share this post


Link to post
Share on other sites

OK. I know we have a difference in language here, and I'm in the process of throwing PrestaShop away and moving to WooCommerce.  Here's what I found; hopefully it helps.  It worked for me.

I'm currently on PrestaShop 1.6.0.14.  That particular version did not have the getIDs() function in the /classes/Language.php file.  I went and looked at the github repository for PrestaShop, and just looked at version 1.6.1.1.  I found the missing function and did the following:

  1. In cPanel, open your File Manager.
  2. Navigate to the classes/Language.php file.
  3. Make a backup!
  4. Edit the file.
  5. Locate the getLanguages function (mine was line 578).
  6. Replace that function with the following, then save the file.
  7. Try to install again.
    public static function getLanguages($active = true, $id_shop = false, $ids_only = false)
    {
        if (!self::$_LANGUAGES) {
            Language::loadLanguages();
        }
        $languages = array();
        foreach (self::$_LANGUAGES as $language) {
            if ($active && !$language['active'] || ($id_shop && !isset($language['shops'][(int)$id_shop]))) {
                continue;
            }
            $languages[] = $ids_only ? $language['id_lang'] : $language;
        }
        return $languages;
    }
    
    public static function getIDs($active = true, $id_shop = false)
    {
        return self::getLanguages($active, $id_shop, true);
    }

Share this post


Link to post
Share on other sites
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More