// Bug fix when deleting a file associated to a virtual product
This commit is contained in:
@@ -152,14 +152,18 @@ class ProductDownloadCore extends ObjectModel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the file
|
* Delete the file
|
||||||
|
* @param int $id_product_download : if we need to delete a specific product attribute file
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function deleteFile()
|
public function deleteFile($id_product_download = NULL)
|
||||||
{
|
{
|
||||||
if (!$this->checkFile())
|
if (!$this->checkFile())
|
||||||
return false;
|
return false;
|
||||||
return unlink(_PS_DOWNLOAD_DIR_.$this->filename);
|
|
||||||
|
return unlink(_PS_DOWNLOAD_DIR_.$this->filename) && Db::getInstance()->Execute('DELETE
|
||||||
|
FROM `'._DB_PREFIX_.'product_download`
|
||||||
|
WHERE `id_product_download` = '.(int)$id_product_download);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user