// Added automatic smarty cache clearing after catalog import (csv)

This commit is contained in:
Damien Metzger committed 2013-08-20 10:45:55 +02:00
1 parent c5f635f967
commit 496db1d13e
2 files changed
+12 -1

No files matched your search

@@ -2659,6 +2659,13 @@ class AdminImportControllerCore extends AdminController
return true; return true;
} }
public function clearSmartyCache()
{
Tools::enableCache();
Tools::clearCache($this->context->smarty);
Tools::restoreCacheSettings();
}
public function postProcess() public function postProcess()
{ {
/* PrestaShop demo mode */ /* PrestaShop demo mode */
@@ -2715,10 +2722,12 @@ class AdminImportControllerCore extends AdminController
{ {
case $this->entities[$import_type = $this->l('Categories')]: case $this->entities[$import_type = $this->l('Categories')]:
$this->categoryImport(); $this->categoryImport();
$this->clearSmartyCache();
break; break;
case $this->entities[$import_type = $this->l('Products')]: case $this->entities[$import_type = $this->l('Products')]:
$import_type = $this->l('Categories'); $import_type = $this->l('Categories');
$this->productImport(); $this->productImport();
$this->clearSmartyCache();
break; break;
case $this->entities[$import_type = $this->l('Customers')]: case $this->entities[$import_type = $this->l('Customers')]:
$this->customerImport(); $this->customerImport();
@@ -2728,12 +2737,15 @@ class AdminImportControllerCore extends AdminController
break; break;
case $this->entities[$import_type = $this->l('Combinations')]: case $this->entities[$import_type = $this->l('Combinations')]:
$this->attributeImport(); $this->attributeImport();
$this->clearSmartyCache();
break; break;
case $this->entities[$import_type = $this->l('Manufacturers')]: case $this->entities[$import_type = $this->l('Manufacturers')]:
$this->manufacturerImport(); $this->manufacturerImport();
$this->clearSmartyCache();
break; break;
case $this->entities[$import_type = $this->l('Suppliers')]: case $this->entities[$import_type = $this->l('Suppliers')]:
$this->supplierImport(); $this->supplierImport();
$this->clearSmartyCache();
break; break;
// @since 1.5.0 // @since 1.5.0
case $this->entities[$import_type = $this->l('Supply Orders')]: case $this->entities[$import_type = $this->l('Supply Orders')]:
@@ -470,7 +470,6 @@ class AdminMetaControllerCore extends AdminController
else else
Configuration::updateValue('PS_ROUTE_'.$route_id, $rule); Configuration::updateValue('PS_ROUTE_'.$route_id, $rule);
} }
} }
/** /**