Thanks for contributing with your help. I could do that script but that solution wont be useful because I import the catalog each hour.
I figured out a solution and it was adding some changes to the Import module, so now the module before import an url it checks file_exists()
and instead of throw a new exception will do unset()
for that image url so with that is enough for my solution. Thanks all.
THis is the code:
// Get images real path, and check exists
foreach ($images as $key => $img) {
/*if (preg_match('/:\/\//', $images[$key]->value)) {
continue;
}*/
$url = $images[$key]->value;
$filename = explode('=',$url)[1];
$images[$key]->value = _PS_ROOT_DIR_.'/testimg/'.$filename.'.jpg';
if (!file_exists($images[$key]->value))
{
unset($images[$key]);
//throw new Exception("File {$images[$key]->value} not found.");
}
}