Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Regenerate images in Prestashop from command line
define('_PS_ROOT_DIR_', '/path/to/prestashop/root');
define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder');
class Employee2 extends EmployeeCore
public function isSuperAdmin()
return true;
public function isLoggedBack()
return true;
class AdminImagesController extends AdminImagesControllerCore
function regenerate()
$this->_regenerateThumbnails('all', true);
$context = Context::getContext();
$context->employee = new Employee2(1);
$aic = new AdminImagesController();
echo "Starting regeneration\n";
echo "Done regenerating\n";
Copy link

evgenij-sobolev commented Mar 25, 2020

Great job!
Could you update the script for prestop 1.7.6.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment