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…
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 Download link. On the right panel, set the value of Enable Download and Download by Redirect to 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.
Some other issues:
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!
Tags: download, oscommerce
aoa dear sir i have a problem with download module of oscommerce .
when i made a product to download for payed customer then i appears to all customer without update their order status.i want this product show only for those customer that have pay for that product not for all customer.
note
i am using no payment method except bank account.
how to solve this problem plz help.
Thanks
[Reply]
Please check the version of your OSCommeerce. I believe the problem you mentioned has been resolved in the latest version.
[Reply]
i went to Order_Status table, but i do not have a column call ” Download_flag”,. what should i do??
[Reply]
Great Post. Spent many more hours than I can recall trying to set this up. Took me all of 5 minutes following your post.
[Reply]
my downloadable products are available for dawmloading before de credit card approval, no matter the status. any ideas?
[Reply]
thank you so much for your post! I’ve spent ages following instructions in so many forums but NONE of them told me about the download_flag in mysql… this is what fixed it!
thanks so much
[Reply]
With the RC versions you need to set the download flag from the osc Admin->Localization->Orders Status. In this case you should not need to use mysql queries or database tools to do the update unlike the article here suggests.
The problem is by default some payment modules switch the order status to a state where the download is allowed without the store owner having a chance to control it. So you will have to create a new order status specific for downloads and disable the download from any other order status.
If you are using MS2.2 then you will need to change the sql query and allow a specific order status for downloads.
// Check that order_id, customer_id and filename match
$downloads_query = tep_db_query(“select date_format(o.date_purchased, ‘%Y-%m-%d’) as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from ” . TABLE_ORDERS . ” o, ” . TABLE_ORDERS_PRODUCTS . ” op, ” . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ” opd where o.customers_id = ‘” . $customer_id . “‘ and o.orders_id = ‘” . (int)$HTTP_GET_VARS['order'] . “‘ and o.orders_status = ’3′ and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = ‘” . (int)$HTTP_GET_VARS['id'] . “‘ and opd.orders_products_filename != ””);
Where the orders_status is set to 3. You need to set it to the value you want for the download.
Reference:
http://forums.oscommerce.com/index.php?showtopic=178935
[Reply]
I have a fully functional website on oscommerce v2.2 rc 2.
However, i would like to add an option for my customer for PWA(pruchase without account) as lots of customers are driving away due to hassel in creating an account. Can pse anyone help me as to how i can do that? I remember in oscommerce v2.2 it was very simple to do that, one has to in configuration/accounts and this option was available. However with RC2 this is not there..
I would appreciate a help please.
Tina
[Reply]
Kudos from one braniac to another.
[Reply]
Hello , I want to add multiple zip files for download, as one zip file will make file very big, how can I do this?
Thanks,
shirish
[Reply]
You know, if everybody on the web took the time to post stuff like this, the web would truly benefit. Thanks!
[Reply]
I wish others took the time to write blog posts like this.
[Reply]
great post !
Works great !
Maybe one thing missed ..;
Make new unique order status under localization and enable just this one to DL & Public.
The DL link will become active only if this order status is set to order
Have fun
[Reply]
I have recently started a web site, the information you offer on this website has helped me greatly. Thank you for all of your time & work.
[Reply]
Hi, great post. Thanks.
[Reply]
Great step by step instructions. Fixed a couple of settings however still not downloading. Problem I have found is the download link is not the same as the file name. eg. File in download folder is named dolphin.zip but link on page after payment is looking for dolphin_zip Any ideas would be much appreciatated.
[Reply]
Is this Grant Teaff’s last game?
[Reply]
“Matter” lesson with 2nd grade buddies.
[Reply]
Superb web site! I really appreciate how it really is straightforward on my eyes it is. I’m wondering how I could possibly be notified whenever a brand new post has been created. I have subscribed for your feed which could do the trick? Have a good day!
[Reply]
I see something genuinely special in this site.
[Reply]