[*] FO : Update filename if product has combinations (and files associated to them)
This commit is contained in:
@@ -269,6 +269,23 @@ class ProductDownloadCore extends ObjectModel
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
AND `active` = 1');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the filename from an id_product_attribute
|
||||
*
|
||||
* @param int $id_product Product the id
|
||||
* @param int $id_product_attribute Attribute the id
|
||||
* @return string Filename the filename for this virtual product
|
||||
*/
|
||||
public static function getFilenameFromIdAttribute($id_product, $id_product_attribute)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `filename`
|
||||
FROM `'._DB_PREFIX_.'product_download`
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
AND `id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND `active` = 1');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the display filename from a physical filename
|
||||
|
||||
Reference in New Issue
Block a user