// Fix download products

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8080 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-16 16:22:13 +00:00
parent 28025e0ff6
commit e86d668a49
4 changed files with 14 additions and 5 deletions
+4 -1
View File
@@ -100,6 +100,9 @@ class ProductDownloadCore extends ObjectModel
public function getFields()
{
$this->validateFields();
if (!$this->date_expiration)
$this->date_expiration = '0000-00-00 00:00:00';
$fields['id_product'] = (int)($this->id_product);
$fields['display_filename'] = pSQL($this->display_filename);
@@ -205,7 +208,7 @@ class ProductDownloadCore extends ObjectModel
public function getTextLink($admin=true, $hash=false)
{
$key = $this->physically_filename . '-' . ($hash ? $hash : 'orderdetail');
$link = ($admin) ? './index.php?controller=get-file-admin' : Tools::getHttpHost(true, true).'index.php?controller=get-file';
$link = ($admin) ? 'get-file-admin.php?' : Tools::getHttpHost(true, true).'index.php?controller=get-file&';
$link .= ($admin) ? 'file='.$this->physically_filename : 'key='.$key;
return $link;
}