Closed (fixed)
Project:
e-Commerce
Version:
6.x-4.x-dev
Component:
file
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Jan 2009 at 15:46 UTC
Updated:
16 Jun 2009 at 13:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
mhreynolds commentedyes, ecommerce 6 is incomplete - the file module is no longer needed but the shipping module is not yet complete. probably a few other things missing too...
Comment #2
bluecafe commentedHi ... thanks for your reply. How can I create a downloadable product without the file module?
Thanks for any hint ... !
Comment #3
gordon commentedThere have been some changes to e-Commerce see http://groups.drupal.org/node/17110 which will explain more.
The file module is one that has been removed from core, and if someone would like to become the maintainer of the ec_file module then it will continue. See http://groups.drupal.org/node/17377 for more information of which modules are available to be adopted.
The ec_file module is quite simple so it could be easily convert from 5.x-4.x-dev to 6.x-4.x-dev. I was rewritten and is quite small now.
Gordon.
Comment #4
ctmattice1 commentedGordon,
If I were to take on the conversion of file downloads to 6.0 port, could I get a little help or hints, if needed.
I need this module for a few sites and am willing to take it on or help with the port. Someone originally was going to do this, been several weeks without any confirmation, so I'll jump in.
Comment #5
gordon commentedI actually got an email from @rpardun http://drupal.org/user/282543 this morning asking the same thing.
I did start working on updating ec_file to D6, but I didn't get it finished. What I gave @rpardun was what I had done, and I am uploading it here as well.
If you want to take it and run with it please do.
Gordon.
Comment #6
burningdog commentedThanks gordon - I've just downloaded the ec_file and have started looking through it. My first step has been to add setup instructions to the README file in detail (mainly to help my own thought process - and hopefully to help people after me who use it). So at some point I'd like to set up an ec_file module on drupal.org and then upload the module there (guess that starts with getting a cvs account, right?).
I've pasted in below what I've added so far - can you confirm that this is how ec_file is meant to work? Obviously it needs some coding to get to the place where file downloads can be supported - I'm figuring out where in the code to start (I'm using the latest dev version of e-commerce 4).
Right now I can add a file download product type which supports the feature "file downloads", and then link that into a content type. I can then buy a file download product and go through the checkout process (which completes, but with 2 warnings) and the transaction is added into the database (with some missing info).
*****************************************************
Enable the ec_file module.
If you haven't already, create a Content type for your file download
by going to
Administer > Content Management > Content types > Add content type
Now add a Product type to link to your Content type by going to:
> e-Commerce configuration > Products
and click on "Add".
Give your file download product type a name, like "File download."
In "Type" put in something like "file_download".
Put in a description and select the content type/s which you'd like
to enable file downloads for and click "Submit product type".
Edit your new product type and click "Add feature". Select
"File download product" and click "Add product feature."
Edit your file download content type and under "Product" select
the product type you've just created and click "Save content type".
Great! You now have a content type and a product type which lets a
customer buy your file download product.
Take a moment to bask in the glow of your monitor.
To create a node, go to
Create content > your-content-type
and under "File attachments" upload a file. Make sure that at least
"Private" and "Sell" are checked. Save your node. Customers can
now buy your file download by clicking "Add to cart" on your node.
You can change the permissions for which roles can create a file
download at
Administer > User management > Permissions
*****************************************************
Comment #7
artatac commentedDear Burningdog
your instructions above are really useful, and got me to the stage of creating a downloadable product, which I see is then added to sites/default/files/private folder. But when I edit the product node [list] and [private] are ticked but [sell] will not remain ticked. If I then act as a buyer (paypal sandbox) all appears to go ok and the buyer gets a paypal receipt but no instructions on how to download the file. any pointers please
Comment #8
burningdog commented@artatac: I've got to the same point you've got to - I can create a downloadable product - it just doesn't *work*! I really need this module for a project I'm working on, so I'm doing some development on it right now. I hope to get it finished really soon, but it's my first foray into drupal module development, so am trying to get some help from anyone who can.
I'm just not sure where to start - I've verified that gordon has done all the correct stuff in updating ec_file to use drupal 6 code, so at least it runs with no problems - so now it's over to figuring out the functionality. Wish me luck! Or join me in figuring this out! :)
Comment #9
burningdog commented@artatac: once you've gone through the process of selling the file (and going through paypal) it's supposed to work like this:
log in as your user who has bought the file. Under "My account" there should be a new tab/link saying "My files" - which should then have a link to the file which they've bought. That is, if the module is working :)
Comment #10
dublin drupaller commentedI was having a look at this recently and I ran out of time and had to move on to something else, but, I did notice that the my_files_overview function didn't look complete. If someone can point me to the very latest version of the ec_file.module I will try and have a look later.
In the same breath...I really would like to change the way that function works from being reliant on recurring payments (which doesn't make sense with most downloadable product sales) to being reliant on a drop down setting on the ec_file settings page, which specifies how long a download is available for.
In other words, the shop admin can simply specify 12, 24, 48, 36 or 72 hours...for when downloads are available for customers to download and then they "expire". So the my_files_overview function simply checks to see if (a) which products has this user purchased? and (b) have they expired?
hope that makes sense
Dub
Comment #11
burningdog commentedYes, that does make sense. The latest version of the ec_file.module is the one that gordon has posted earlier in this thread - that's the version I'm working off. I haven't made any changes to it yet - just figuring out how it works for now (see the "readme" bit I posted above).
The my_files_overview function seems to be one you've added in yourself, Dublin Drupaller?
Specific questions I'm busy figuring out the answers to:
- when editing a node with the file_download product type enabled, the "sell" checkbox doesn't remember its "checked" setting
- in checkout, when buying a file_download, we can skip the "billing address" screen (how?)
- when adding a file download to the cart, we don't need a "quantity" column
- on "place order" I get these 2 errors:
* warning: Attempt to assign property of non-object in sites/all/modules/ecommerce/ec_store/ec_store.inc on line 21.
* warning: Attempt to assign property of non-object in sites/all/modules/ecommerce/ec_store/ec_store.inc on line 35.
- ec_file doesn't insert much detail about the transaction into the database (like the user_id) of who bought the product
Also, the module seems to work the database table "ec_file_new" rather than "ec_file" - but both tables are in ec_file.install
I'm guessing gordon has done that to provide an upgrade path once the development is done?
I'm on irc as "burningdog" hanging out in the drupal-ecommerce channel.
Comment #12
burningdog commentedI'm continuing development on this - and it's going kinda slowly. Maybe we can use this thread to centralise efforts - that is, until we register ec_file as a new module - then we can continue talking in the issue queue there. I'd appreciate any guidance from experienced dev's - am right now waiting for gordon to confirm that the readme I posted above is indeed how the module should work.
Comment #13
v8powerage commentedI badly need this module as well, whole site is completed only this module is missing (plus image.module which is impossible to update, but that's different story). Anyway, I do hope It'll be soon completed, and attached into ecommerce package.
Comment #14
PGiro commentedHas any further work been done on this issue ? I need this too.
Could you all post your patches as they currently stand, I could pick up on the patch that's farthest down the road.
Thanks
Comment #15
burningdog commentedI've just started work on this - don't have anything I can share with you yet - am hanging out in the #drupal-ecommerce channel on irc.freenode.net if you'd like to co-ordinate development efforts.
Comment #16
burningdog commentedw00t! I'm done upgrading the module and I'm sure there will be some changes needed (and there's no upgrade path and we should probably be using the ec_file table instead of ec_file_new, so insert disclaimer about this being an alpha version with no upgrade path and all that).
I've attached the files.
Comment #17
burningdog commentedEnable ec_file in the module list, add a new product type ("Download") and then add a new feature: "File download" and link it to a content type. Then add a new node of that content type, upload a file, mark it to sell and proceed with checkout normally.
Gordon, do I need to apply for a cvs account so as to register a new module (ec_file)?
Comment #18
gordon commentedYes you need to apply for a cvs account and then you will be able to create a new project page for ec_file, in which you will be able to maintain an issue queue and do all the releases.
Comment #19
burningdog commentedThanks, will do.
Comment #20
Phillip Mc commented@burningdog: thanks so much for pushing the development of this.
quick question. I've been able to install the module, create a file download content type etc. but when I run through a test order...the link under MY ACCOUNT -> STORE -> MY FILES is showing up blank. i.e. "no files to download".
I'm using the ec_paper_payments.module (the new version of cod.module) to test the shopping process.
When I go to ecommerce -> receipts the order is marked as COMPLETED.
Any ideas why the MY FILES page is showing up blank?
Comment #21
burningdog commentedSounds like you've followed the correct steps, Phillip. When you uploaded the file, did you mark it as "Private" and "Sell"? And can you access the file as a user who can view file uploads and the node (you shouldn't be able to)?
Comment #22
Phillip Mc commentedthanks for the quick response and thanks also for upgrading this module.
I uploaded the file as a normal file attachment so it is available to download by anyone. is there another option for uploading?
Comment #23
Phillip Mc commentedd'oh!
just clicked on edit for the file product node and see the Sell and private option now.
It's working now.
these are probably stupid questions but:
(a) how do I set the expiry date/time on the download?
(b) Can I add more files to the same node (e.g. selling video downloads in different formats) like subproducts with different prices?
thanks again for doing the module
Comment #24
burningdog commentedGlad you got it working :)
There should be an expiry option on the download but I haven't figured out how to set it yet. I think that should probably be on a configuration screen somewhere so that admins can set the option (globally) to have downloads or not.
I haven't tried adding more than one file to a product yet, but it should work fine. Keep in mind that once the product (i.e. the node) is bought, *all* files attached to it can be accessed by the buyer.
Comment #25
dublin drupaller commentedgreat work burningdog. looking good. Just to confirm - I had the same problem as Phil...i.e. no download link when a file product node is purchased...no expiry date.
If it's of interest, I have modified the 3.x version of file module for Amazon aws integration. I haven't submitted a patch for that yet, but, do you want me to send the module on to you to add it in as an optional extra for the new version?
I've also included an expiry date option on the file product settings page, so the site admin can override the ec_recurring.module and just specify 12 or 24 (or more) hours before the download link expires.
let me know if you want a copy of that burningdog.
dub
edited: When I said Amazon aws, I meant Amazon S3 integration (Amazons simple storage services http://aws.amazon.com/s3/ )...which is great for a site selling large downloads particularly if their drupal site is on shared or vps hosting. i.e. very quick downloads and very cheap storage space/bandwidth.
Comment #26
burningdog commentedThanks Dublin Drupaller - the Amazon S3 integration sounds brilliant and I think it makes sense to add it into the functionality. Please send me the 3.x module and I'll update 4.x to use it (although if you'd like to do that update yourself and send me a patch, that would be welcome!). You can email me here: roger at burningdog dot co dot za
With regards to no download link for your purchased product - have you marked that workflow status for that transaction as "completed"? As for the expiry date, the module currently doesn't support that functionality, but I guess this is commonly used. Would having a sitewide expiry option (of, say, 3 days) be how you'd expect this to work?
Comment #27
burningdog commentedBtw, ec_file currently uses the database table ec_file_new - which I think Gordon added so he could play with a new table structure while keeping the old ec_file table around for reference (and upgrading) purposes. At some point I'll need to create an upgrade path from 3.x to 4.x, and I expect that will mean simply using the ec_file table instead of ec_file_new. What that means for anybody who has downloaded and installed the above version of ec_file is that at some point you'll need to manually rename ec_file_new to ec_file. I'll let you know (in this thread) when that point is reached, as I'm waiting for a CVS account so I can create this as a project and manage an issue queue.
Comment #28
dublin drupaller commented@burningdog #26
Will email you through the ec file.module for 3.x with the Amazon s3 integration included. Have attached a screenshot of the file settings page for that module to illustrate what I mean.
The way the Amazon s3 integration works is that you use the normal file path to test out your shop (with small dummy .zip files, for example) and then onece it's all done and dusted, you upload the correct files (with the same filenames as the dummy .zip files) up to your amazon s3 bucket using something like S3FOX. Then you just activate the Amazon S3 override, enter in your access code + secrat access key + bucket name and away you go. The Amazon s3 function generates an expiring link that lasts for an hour, but, the file download link respects the expiry date set on the settings page.
I thought about integrating an upload through the file.module, but, I concluded that might be a waste of time (and code) and perhaps more suitable for the private_upload.module, so it's available to an entire drupal site rather than just file products.
I think that makes sense. Like I said..I'll email you through the file.module for 3.x with the S3 integration + simple file expiry settings in a few minutes.
Comment #29
dublin drupaller commented@burningdog
Ideally there should be a site-wide setting with drop down options (like in the screen shot I posted in my previous comment) with a per node override (so a site admin can override the sitewide expiry date for a specific file).
Seeing that there is still work going on with the db structure, an extra "expiry" column would solve where the expiry date per node goes, while the site-wide setting could jsut sit in the variable table.
The question is, where do you put the setting page. At first glance at your module, I was thinking a new feature might be the way to go..e.g. site admin adds an "expiry" or "amazon s3" feature when setting up the file download content type, but, perhaps it might be simpler and more intuitive to just create a file download settings page under the ecommerce config menu.
That said...I haven't had a chance to look at the new ecommerce API in a few weeks, so, maybe you or gordon will have a more qualified opinion on that.
dub
Comment #30
dublin drupaller commented@burningdog. Just to let you know, I've uploaded the patch + module + include and attached them to this comment: http://drupal.org/node/471678
I hope it's of use.
Dub
Comment #31
burningdog commentedReferring to #27: I've updated the module to install and use the table ec_file instead of ec_file_new. For everyone who's used the above version, please deleted the ec_file table (or rename it to ec_file_OLD if you'd still like to keep it around), rename ec_file_new to ec_file, and use the attached module instead.
Comment #32
burningdog commentedec_file now has its own project page here: http://drupal.org/project/ec_file
I'm working on the development version (which should be available for download when the packaging scripts next run - it's available in cvs right now); as soon as I'm happy with a few things I'll create a release candidate. Most important is that I need to figure out how to handle upgrading from 3.x and what's the best database structure to use. gordon, some advice would be appreciated here!
Please put all bug reports and feature requests in the issue queue. I've also changed my username from burningdog to something less animal-unfriendly (and because my wife used her puppy eyes on me) - just in case someone arrives at this issue queue sometime in the future and wonders who "burningdog" is.
@Dublin Drupaller: no need to repost the Amazon S3 integration as a feature request - I've taken note of it :) But it'll probably be in the 2.x release rather than 1.x.
I'm working on a project where I'm allowing users to upload files which are then sold - for that I need to have upload integration between drupal and S3 (instead of using S3Fox) - it would be nice for private_upload to allow for that.
You also said: "perhaps it might be simpler and more intuitive to just create a file download settings page under the ecommerce config menu." I'm not sure which is the best way to go about this yet, simply because the 3.x version of ec_file depends upon ec_recurring to manage the expiry options, and ec_recurring isn't yet in 4.x. gordon, do you have an opinion on what is the best way to go forward for handling expiry dates on file downloads?
@Phillip Mc: I've wondered about allowing for integration with a CCK file upload widget like filefield, since upload.module doesn't cover all use cases. If this is functionality you'd like, post a feature request :)
Comment #33
dublin drupaller commentedHi Roger,
Thanks for the update.
re: upgrading.
I don't think there's going to be a standard upgrade facility (using update.php) between 3.x and the new Drupal eCommerce API (4.x) so I think you're pretty much working with a blank canvas Roger..when it comes to worrying about ec_recurring.module etc.
On the topic of upgrading...instead of veering away from the core topic, I've started a new thread on that topic here: upgrade strategy from eC 3.x to the new Drupal eCommerce API 4.x.
re: Amazon s3 integration
I think you're right..i.e. putting that into the private_upload.module so it's available for all other Drupal modules.
re: file expiry dates
I've never used the ec_recurring module for setting file expiry dates. A drop down list where you can select 12, 24, 48 house or 3 days is far more intuitive.
re: file subproducts
Is that feature going to be available with the new version? e.g. selling video/music downloads in different formats. such as 128kbps, 320kbps and FLAC or for video..you could have HD, Standard, Mpeg, MOV, AVID etc.
Comment #34
burningdog commentedre: upgrading.
Will comment on the new issue you mentioned.
re: file expiry dates
Maybe mentioning ec_recurring wasn't helpful here - I only bring it up because as I was fixing the version which gordon gave me to work on, it seemed as though ec_file used ec_recurring to calculate expiry dates, even if that wasn't obvious to the user. I'll go and take a closer look to how that worked in 3.x
Using a drop-down list is the best way of choosing when your files expire, I agree. Again, I'll need to look at how this was implemented in 3.x to see what the best way to do it in 4.x is.
re: file subproducts
I haven't played with this, to be honest. Is the use case this: an admin uploads, say, 3 different versions of a file to a product node - say it's a movie and there are 3 versions: low, medium and high quality. Each of these files has a different price associated with it, so that I could buy the low-quality movie for $1, the medium-quality version for 3$ and the high quality one for $10?
Comment #35
dublin drupaller commentedre: file subproducts
Is the use case this: an admin uploads, say, 3 different versions of a file to a product node - say it's a movie and there are 3 versions: low, medium and high quality. Each of these files has a different price associated with it, so that I could buy the low-quality movie for $1, the medium-quality version for 3$ and the high quality one for $10?
Almost.
With ec 3.x (using the following patch: http://drupal.org/node/195869 )
The method you suggested sounds much easier...i.e. instead of the subproduct being a seperate node, it could be just an "alternative file path" that is submitted with the file product node, with a price variation attached.
Or in other words:
What do you think?
Dub
Comment #36
burningdog commentedre: Amazon s3 integration
There are a few modules around which have S3 integration. s3saver is proof-of-concept only and requires patching core and doesn't have a D6 release. Media Mover looks very promising - one of its stated functions is to "move a file to Amazon's S3 service" after it's been uploaded. It's in beta right now - if and when ec_file needs to move uploaded files to S3 this is the module I'll look at integrating with. It might be a bit heavy, because it has lots of functionality, but hey, people might find that stuff useful.
Comment #37
burningdog commentedIn reply to #35: so with the above patch applied to ec 3.x, 3 nodes are created for a single product - so that's 4 nodes in total? A product node and 3 sub-product nodes? If so, that's going to play havoc with views and searching (due to perceived duplicate products showing up), unless subproduct content types are somehow excluded from views and searches. But I guess this is the way that ec_subproduct works? (I haven't used ec3 much, so forgive me if I ask obvious questions about it). Is a relationship created between the product and the subproduct, in the same sort of way that nodereference works?
As to uploading all files to a "Private" folder outside of the root folder - using private upload, this is unnecessary, since Drupal takes care of all the permission checking for those files. If a file is marked as "Private" and "Sell", only people who have bought the node associated with that file can download it.
This is why file subproducts work by creating separate nodes for each sellable file, since the permissions model is to give access to *all* sellable files attached to a node - in our use case we might want someone to buy the medium-quality movie, and then NOT to be allowed to download the high-quality movie. The only way to do this right now is to have separate nodes for each sellable file.
As far as I understand the API, each node can only have a single price associated with it - it's not possible to have multiple prices associated with a single node (and I'd expect the 4.x version of subproduct, once it's upgraded, to work in the same way). It would probably be a theming nightmare to have, say, 3 different prices for a single node - which one would you display? Well, that would be context-specific...plus we'd have to have a way of associating a specific uploaded file with a price (and trying to get the upload.module interface working with the price options fieldset is definitely non-trivial) and suddenly the complexity of this solution increases. Occam's Razor saves us! Separate nodes per file subproduct it is!
So, my proposed solution of having price variations inside a single node is...complex. It depends upon how subproduct is implemented.
Comment #38
Phillip Mc commentedthis is great. Having s3 integration with the private_uploads.module would be amazing, but the patch submitted by Dub makes a lot of sense, unless it's registered users who are uploading content i.e. it's not the site admin.
Also I agree that file expiry date suggestion by dub is far better than using ec_recurring.module. Admins are therefore not relying on 2 modules to be updated.
file subproducts would be an amazing feature but I can see the issues that may arise trying to combine it all into the same node. hopefully subproducts.module will be updated with the ability for file subproducts.
Comment #39
burningdog commentedYes, the S3 patch assumes the site admin is uploading the content, and then manually linking it to S3. For some sites (like one of mine) I need users to upload the content. Still, S3 integration is a start!
I'm not sure exactly how ec_recurring was used in ec 3 for file expiry. When I get some time I'll take a look through Dub's patch - I prefer less dependencies, unless there's a super-good reason.
I'm leaving file subproducts alone for now - at least, until a subproducts module is ported.