0

I am making a files selling website with Drupal 7.41. Using the Commerce Files / Commerce License Modules, I have been able to setup the after payment completes, allow file download functionality.

However the files that becomes available to download is just the raw file. I want the file, which becomes available for download to be a zip/tar file which consists the

  1. File sold
  2. A simple readme.txt
  3. A pdf file consisting license information, made for that particular user transaction. Like Envato!

Is this automation possible? Can anybody please guide me on how I may be able to achieve this? Even pointing out the path would be helpful!

1

Here's what you need to get started.

You'll need to create a new license type and extend the CommerceLicenseBase class (or the file class). When your license class (whose parent class is CommerceLicenseBase) gets activated, the ->activate() method ends up calling ->save(). Your new class will implement ->save() and within that function you can:

  1. Generate a PDF.
  2. Generate or load a README.txt.
  3. Create a Zip file.
  4. Store that file and attach it to some entity, email it, etc.
  • Hi, Thank you for pointing out the way! This looks achievable! Will update the post after getting it done! Thanks a lot! – aniki47 Dec 6 '15 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.