Jump to content

Clear smarty cache leads to Call for undefined method Shop


Recommended Posts

This seems an unusual problem.

 

I've moved a prestashop 1.5.6 installation from one server location to another, retaining the same database. I copied all files and changed URL locations in the database. Logging into the back office poses no problem, the shop shows up, no problem.

 

Until I clear the Smarty Cache.

 

Then I get the following error message:

 

"Fatal error: Call to undefined method Shop::initialize() in /hermes/bosweb25a/b56/nf.logorythm/public_html/crotchetquaver.com/shop/config/config.inc.php on line 95"

 

 

The code at line 95 config.inc.php is:

 

$context->shop = Shop::initialize();
if (Tools::isEmpty($theme_name = $context->shop->getTheme()) && !defined('_PS_ADMIN_DIR_'))
  throw new PrestaShopException(Tools::displayError('Current theme unselected. Please check your theme configuration.'));

 

 

The problem can be cleared by deleting >> class_index.php << in the cache folder. Of course I can manually clear the cache every time I want to recompile, but not only is it inconvenient, it's not addressing the cause of the problem, which may lead to a later problem (I don't know).
 
I would be most grateful if someone can point me to a potential solution to this.
 
 
Many thanks in advance.
 
Link to comment
Share on other sites

  • 4 months later...
  • 10 months later...

I never found a permanent solution.

 

You can solve the problem by deleting the file class_index.php in cache folder and then clear your cache manually:

 

>> cache/smarty/compile
>> cache/smarty/cache
>> img/tmp
Delete all the files in the folders, except for index.php.
Link to comment
Share on other sites

×
×
  • Create New...