public static function getAttributeOptionDownloadFolderByProducts($cid)
{
// Admin information for deleting folders when products are deleted
$db = Factory::getDBO();
if (count($cid)) {
ArrayHelper::toInteger($cid);
$cids = implode(',', $cid);
$query = ' SELECT av.download_folder FROM #__phocacart_attribute_values AS av' . ' LEFT JOIN #__phocacart_attributes AS a ON a.id = av.attribute_id' . ' LEFT JOIN #__phocacart_products AS p ON p.id = a.product_id' . ' WHERE p.id IN ( ' . $cids . ' ) ORDER BY p.id';
$db->setQuery($query);
$folders = $db->loadColumn();
return $folders;
}
}