WildKatana Design

Ubercart Marketplace + File Downloads for Drupal 6

One of my clients recently requested the ability for his Users with a certain role to be able to sell files and get commission from their sales. The first thing that popped into my mind was Ubercart Marketplace (since we already were using Ubercart). Ubercart Marketplace is a wonderful module made by Turgrid, a very talented developer. Originally a Drupal 5.x module, he has now ported most of the functionality over to Drupal 6.x. One thing that he had in the 5.x version was the ability for sellers to sell file downloads. This hasn't been ported to the Drupal 6.x version yet though.

This was exactly the functionality that I needed, however, so I set about looking through the mp_file module in the 5.x version to see what could be done to update it. One of the major problems was the FileField API had changed considerably in the 6.x version, and since documentation was pretty scarce for it, I had to look around in the FileField files for clues. I also had to change some of the Ubercart functions and add some to work with the upgraded uc_file module.

In the end I was able to upgrade everything in mc_file.module to Drupal 6.x API, except for some of the FileField functionality. The solution is still a bit rusty and you must use this at your own risk, but here is how you can do it yourselves. First, download my version of the mp_file module. Put this module in your ubercart_marketplace module folder. Enable the module. Then go to your settings page for Ubercart Marketplace (http://www.yoursite.com/admin/store/settings/seller). Enter the name of a field you will create for the file download (I used 'download'). Make sure that the checkbox is checked to allow sellers to sell files. Now, go to edit the content-type for the product you should have already made for sellers to sell (mine was product_video) and create a new field for it (using CCK). Name the field the same thing you entered earlier in the seller settings page for the download field (mine was 'download' remember?). Make it be a FileField widget item, and set all of the settings there. Save everything and that is it. I got this to work just fine by following these steps.

If you are having any problems, just post the comments below and I will try to help you with them. And if you found this helpful, please let me know by visiting my sponsors. Thanks!


Comments:

Testimonials

Fantastic communication and worked with me all the way through the project! Great programmer will work with again.

More

Why Use Us?

  • Website Design & Development
  • Valid XHTML/CSS Coding
  • Affordable and Honest Pricing
  • E-Commerce Shopping Carts
  • Great Communication
  • Content Management Systems (CMS)
  • Search Engine Optimization (SEO)
  • Satisfaction Guaranteed!