Jump to content

Download virtual product


c.nguyen

Recommended Posts

Hi , 

 

In Prestashop 1.7  , we only can have upload a  single virtual product  for 1 product . We can't upload "multiples virtual product"  ( multiple files ) 

But Prestashop offers ( EDIT PRODUCT   then  , in Options )   possibility to have multiple files    . The problem is que theses files ( multiple ) are only for Catalog , "how to use this poduct( free ) .

 

 

I changed OrderHistory.php  class  to have several files  ( A single virtual product  and several files ( at first these are free: Catalog ) .

 

After payment,  in mail , I have some links to download for the customer  . All links work: 

 

-  a  download link for virtual product  ( with  

- somes links for files ( before it was files for Catalog , documentation FREE ) 

 

The problem  is all links are for the virtual product ( a single file  ).

 

All links have the same "hash"  . that 's why I don' arrive to have different links  but always the same link   

 

 

this is the link  in ProductDownload.php 

 

$key = $this->filename.'-'.($hash ? $hash : 'orderdetail');
        $link = ($admin) ? 'get-file-admin.php?' : _PS_BASE_URL_.__PS_BASE_URI__.'index.php?controller=get-file&';
        $link .= ($admin) ? 'file='.$this->filename : 'key='.$key;

 

 

I wait your reply 

 

thanks in advance 

 

Link to comment
Share on other sites

  • 3 weeks later...

In Prestashop you have also "attachments". These are files that you put on your product page and that serve as documentation. You can have more than one of them per product and they can also be shared between products.

Prestashop uses the same upload mechanism for attachments and for virtual products. That is what you see. But you can have only product file per virtual product.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...