Jump to content
Latest News: (loading..)

Archived

This topic is now archived and is closed to further replies.

sunrise99

How to setup download product in OScommerce v2.2RC2

Recommended Posts

Never thought enabling Downloadable product type in OScommerce would be so difficult. Anyway, I would like to post my nearly 3 hours’ work to reduce your frustration.

First, make sure you installed the latest version of OsCommerce and everything else is working. And you have already read the basic how-to tutorials from the official web site knowledge base at

http://www.oscommerce.info/kb/osCommerce/Administration_Tool/Configuration/162

If you do not have time to read all of the above, do not need to worry, since I will repeat the how-to in this post with more explanation.

Here is my new step by step how-to:

  • Log onto your OSCommerce back-end, Click Configuration and then click Downloadlink. On the right panel, set the value of Enable Download and Download by Redirectto True.
  • Upload your downloadable product file to the cataloag/download folder as a zip file (using no spaces in the name). If you open your web server via FTP, and notice a zip file named unreal.zip under the catalog/download folder, then you can skip this step for the testing purposes.
  • If you have not generate a product in the back-end, then do so as you would normally for any product you sell in OSCommerce.
  • Click Catalog and then Product Attributes. Under “Product Options”, create a new option called “Download” or something that you and your customer will recognize.
  • In the same Product Attributes page, create a Option Value of “Windows” or “Mac” or whatever.
  • Still in the Product Attributes page, at the bottom of the page, you will find a drop down menu of each of your products. Find the product that you wish to offer as a download and select it (like the one you created in step 3).
  • Under the Option Name, choose “Download” or whatever you used in step 4 above.
  • Under Option Value, choose “Windows” or whatever you used in step 5 above.
  • Set your price for the product or leave blank or zero 0.
  • Skip the Prefix section.
  • Type in the exact name of the download file as it is saved in your catalog/downloads folder as you did in step 2 above. Remember, no spaces in the filename and include the .zip extention. Do not put anything like http:// or path before it. (For the convenience, you can download some contributions from OSCommerce to allow you to browser uploaded files).
  • Set the number of days the purchased download will be available to your customer.
  • Set the maximum amount of downloads tries you wish to grant to your customer. You should at the very least give your customer 2 tries, in case something happens to thier connection.
  • Finally, click the “insert” button at the far right.
  • Your product is now available for download.

 

To test this, you should do a shopping and check-out as the customer. And then act as the admin to make the order status as ‘Delivered’ from the back-end. If everything is working fine, the customer should be able to see the download link from his Account page (at the bottom of history_info.php page, right below the status history list).

If not, then try to make sure the following:

  • Have you make the folders catalog/pub as 777 and catalog/download 755. If not, please use a good FTP client to do so.
  • Are the paths correct in your includes/configure.php file? if not, make sure some lines of your file look similar as
    define(‘DIR_WS_DOWNLOAD_PUBLIC’, ‘pub/’);
    define(‘DIR_FS_CATALOG’, ‘/home/sounkel6/public_html/catalog/’);
    define(‘DIR_FS_DOWNLOAD’, DIR_FS_CATALOG . ‘download/’);
    define(‘DIR_FS_DOWNLOAD_PUBLIC’, DIR_FS_CATALOG . ‘pub/’);
  • Last, if it is still not working (like it happened to me), try to check your database through PHPMyadmin or other tools.

Normally, you would find a table called orders_status and there is download_flag field inside. If the download_flag for the order_status of “Delivered” is 0, then update it to ’1′. You can directly do so in PHPMyadmin or use the following SQL:

UPDATE orders_status SET downloads_flag = ’1′

WHERE orders_status_id = 3 AND orders_status_name = ‘Delivered’;

I promise you that you might still have a lot of issues to make the download feature work, but hey you are almost there. Good Luck!

Share this post


Link to post
Share on other sites

OMG!! THANK YOU A MILLION TIMES FOR THIS POST!! It's been BY FAR the most thorough & comprehensive of all the posts I've found on the topic. It worked wonderfully for me. I did want to add something to the very last step that will make setting the order status to "Delivered":

  • In the oscommerce admin panel, go to "Localization"
  • Select "Order Status"
  • Select "Delivered"
  • Select "Edit" to edit the "Delivered" property
  • Set the "Delivered" property to "default" (if your store is 100% downloadable products as is mine) & check the other 2 boxes as well.

That's it! One last question for you, David ... My store has downloadable .mp4 video files. When I click the link to in the customer's account page to download the file, It tries to open the Quicktime player as its downloading and then an error pops up. That's when the file is not zipped. When I zip the file up, it just doesn't download at all. Any ideas? And I know the technical side of things are working because I was able to download that "unreal.zip" file just fine. So I figure it's how I've packaged the .mp4 file myself. Thanks again, man, you saved my life!!

 

Devon

Share this post


Link to post
Share on other sites

@@teamshanni

 

How big is the zipped file. I have a feeling that there may be a file size limit set by some hosts. Also have you tried turning download by rediredt to true and try downloading again. If this setting is already set to true, try turning it to false.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Hi Steve ... Thanks for responding. My file sizes range anywhere from 400 MB - 1.23 GB. I called my host and had them modify my php.ini file to handle file sizes up to 2048MB (2 gigs). I also had them modify the time out time that the script can run to 5 minutes to be sure there would be plenty of time to download the files before it timed out. Couple other things I'm gonna try & if you have any more suggestions, feel free to chime in! Again, thanks for taking the time to respond!

Share this post


Link to post
Share on other sites

I only use zipped files so am unsure of whether other file types can be used.

 

I take it you can upload the file to your computer using ftp and can open the files.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Well I zipped up a file. Made a test purchase & now I get a "decompression failed" error message. I'm tinkering with the gzip compression settings in the admin but going to have to do some research as to their significance. Thanks again for any help.

Share this post


Link to post
Share on other sites

Hey Steve! I got it all worked out! Turns out I just needed to disable Gzip compression because all browsers can't handle it. Everything is working GREAT now. Thanks again!

Share this post


Link to post
Share on other sites

I have read this and I have put the zip file on my webhost ftp site (which is what I believe you mean by "back-end"), but I have 1 issue:

 

http://i.imgur.com/ubVgcGF.jpg

 

I do not see any place for downloadable products. Yes I went to the Configuration tab on the far left and there are a couple options for download there, but this is where my leads end!

Share this post


Link to post
Share on other sites

The downlaodable product has to added as a product attribute, and when creating the product has to have a zero weight.

 

On the image that you supplied you would add the name of the file plus the file extension in the filemane box and then click add.

 

When you then return to the product info page for that product you should see an additional area that includes options.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

1 last thing: I need help with files that are over 100MB in size, because for whatever reason, I cannot upload this. It keeps acting like the forms I filled out (and double-checked) are invalid or like I didn't fill any of them out. I checked the zero-weight, the attribute seems to be as OK as far as I can understand, but Steve, the rest of your wording confuses me!

 

I have tried using both pdf and zip files, and neither of them seemed to be uploaded. Or is the "Large Image" not the way to go with the full 18-page zip/pdf?

Share this post


Link to post
Share on other sites

Also, I am not sure, but I'm guessing that

"

  • Type in the exact name of the download file as it is saved in your catalog/downloads folder as you did in step 2 above. Remember, no spaces in the filename and include the .zip extention. Do not put anything like http:// or path before it. (For the convenience, you can download some contributions from OSCommerce to allow you to browser uploaded files).

"

 

Judging by this, I am guessing that an example product name is something like "public_html/oscom/catalog/download/examplename.zip" and even if this is correct, where do I plug in that information? The "HTML Content" segment beneath the Large Image drop-down?

Share this post


Link to post
Share on other sites

A download file is added on the products_attribute.php page,


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

I found it! But when I opened it using my Admin powers, I got awash in a sea of code! I mean, of all the language that's in public_html/oscom/admin/products_attributes.php, I do not know where to go in this sea of variables and switches to say I want this specific file to be a downloadable. For the same of example, let's use public_html/oscom/download/unreal.zip which is the one that's always existent by default...And I'd mark that particular file for download. How would I mark that unreal.zip for download? Specifically, where in/on the products_attribute.php page do I "Type in the exact name of the download file as it is saved in your catalog/downloads folder..."?

 

If I figure it out before I get a response, I will update appropriately. Until then, all help will be appreciated as I swim through this sea of code and cap-lock variables.

Share this post


Link to post
Share on other sites

If you have read and followed the first post of this thread, you must be very close to getting everything set up correctly.

 

On the products_attribute page that you have opened in your admin area, there is a box called products options. In there you add a new option called download.

 

To the right of that box there is another called option values. There you enter a value for your downloads. I have downloads in different scales so I use that, if you want to use downloads again do so.

 

Below these two boxes there is one called product attributes. In this area you enter all the information to add the download to a products. Sop in the drop down list of products select the product that you want to attatch the download to. In the next dropdown box select download. Then in the nex box select the option value that you just entered. Then add the additional cost to purchase this item if there is one, if not leave it blank. The days and downloads should automatically fill taken from your settings in the configuation area. The next line down there is a box with the title filemane. In the text area you enter the name of the file, plus the file extension that you saved to your downbloads file. so something like download.zip or real.zip. Then you click the insert button.

 

If you now return to your store and select the product that you have added the download to, you should de an area with the option of a download listed. If not, you have done something wrong. You must also make sure that the products has been added with a zero weight otherwise oscommerce will not know that the product is a virtual product.

 

When you add this product to your cart, it should add it as a download not a physical item and allow checkout. Once everything had been paid for, you should then be able to download the item. There are several addons that may or may not be necessary to ease the problems with downloads. The first is http://addons.oscommerce.com/info/7783

which will automate the whole download selling process, and the other is http://addons.oscommerce.com/info/6410. I have both of these working with 2.3, but do not know whether they will work with the newest version.

 

I hope this helps. There are also thousands of pages which can be found using google for download setup help for oscommerce.


REMEMBER BACKUP, BACKUP AND BACKUP

Before installing the official version of oscommerce first look at a responsive version here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

I tried replacing my files with the ones packaged in http://addons.oscommerce.com/info/7783 in my public_html/oscom/ area, but all that did was screw up everything (Unable to connect to database server). Now I need to repair this by hopefully copying the previously working files (which usually doesn't work as well as it sounds like it should).

 

Well actually, it only gives me that error when connecting to my admin. The store itself http://www.supergoldenknight.com/oscom/ seems OK.

Share this post


Link to post
Share on other sites

I've followed all the steps, but still no luck with having the download link appear after the order process. I am just kind of stumped.

 

Any help much appreciated!

 

V1Audio:)

Share this post


Link to post
Share on other sites

@V1AUDIO GOT IT!! It was the (file permissions) on the folder access in file manager. ((Have you make the folders catalog/pub as 777 and catalog/download 755))

Change the permissions like sunrise99 said and it works correctly!

 

What a life saver his post is! THANK YOU Sunrise99!!

 

V1Audio

Share this post


Link to post
Share on other sites

Still an empty zip file.  I'm going to check with my hosting provider support to see if they have a solution.  Thanks!  If anyone else has an answer please post it.

Share this post


Link to post
Share on other sites

×