Hi,
An easiest solution could be to createa little plugin which will add the attachment to the mail if there is a download link, and remove this download link in the email.
Here is how the plugin must looks like:
<?php
class plgHikashopBccMail extends JPlugin
{
function plgHikashopBccMail(&$subject, $config){
parent::__construct($subject, $config);
if(!isset($this->params)){
$plugin = JPluginHelper::getPlugin('hikashop', 'bccmail');
if(version_compare(JVERSION,'2.5','<')){
jimport('joomla.html.parameter');
$this->params = new JParameter($plugin->params);
} else {
$this->params = new JRegistry($plugin->params);
}
}
}
function onBeforeMailSend(&$mail,&$mailer){
// Your custom code.
}
}
In his function $mailer is the Joomla mailer system, and $mail the current mail.
So you have to parse the content of the mail, get the download link, retrieve the file name, and add it to the mail.