Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * - 1 votes

OsCommerce Download Feature


189 replies to this topic

#1 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 10 November 2006, 16:01

For those experiencing problems using the download feature in osCommerce.
  • Enable downloads in the admin/configure/downloads section of your store,
  • Upload your product to the cataloag/downloads folder as a zip file (using no spaces in the name)
  • Create a products page as you would normally for any product you sell
  • Go to admin/catalog/product attributes page. 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 "YEs" or "Only" 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.
  • Under the Option Name, choose "Download" or whatever you used in step 4 above.
  • Under Option Value, choose "yes" or whatever you used in step 5 above.
  • Set your price for the product or leave blank.
  • 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.
  • 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.
:thumbsup:

Good Luck,
Bill Kellum
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#2 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 10 November 2006, 16:05

Troubleshooting if download link does not work:



In your catalog/includes/configure.php file, down in the downloads section, their maybe a

missing "/" in your catalog name:

  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/');

It should be:

  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/');

Where "catalog" is the name of your store.

Now your download link will work perfectly. Yippee!! Woo Hoo!!!
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#3 shazzed

  • Community Member
  • 1 posts
  • Real Name:Shannon

Posted 13 December 2006, 04:08

Great guide.

Does anyone know why the download is accessible on pending status and not delivered!?

Seems stupid especially if you are using a manual CC entry system. Credit Cards that are bogous or the fake test number could allow people to steal your download without payment.

If anyone has a work around that works so you can change the Status that the link is active for download that would be super.

Have tried replacing this code in the dowload.php from >>HERE<<

CODE USED:
// 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.order_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 != ''");

ERROR:
1054 - Unknown column 'o.order_status' in 'where clause'

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 orders o, orders_products op, orders_products_download opd where o.customers_id = '2' and o.orders_id = '3' and o.order_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '3' and opd.orders_products_filename != ''

[TEP STOP]


#4 Bluntknife

  • Community Member
  • 22 posts
  • Real Name:Paul

Posted 03 January 2007, 16:13

View Postshazzed, on Dec 13 2006, 04:08 AM, said:

Great guide.

Does anyone know why the download is accessible on pending status and not delivered!?

Seems stupid especially if you are using a manual CC entry system. Credit Cards that are bogous or the fake test number could allow people to steal your download without payment.

If anyone has a work around that works so you can change the Status that the link is active for download that would be super.

Have tried replacing this code in the dowload.php from >>HERE<<

CODE USED:
// 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.order_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 != ''");

ERROR:
1054 - Unknown column 'o.order_status' in 'where clause'

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 orders o, orders_products op, orders_products_download opd where o.customers_id = '2' and o.orders_id = '3' and o.order_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '3' and opd.orders_products_filename != ''

[TEP STOP]


I came across this error. I checked the db and noticed that o.order_status doesn't exist, it should be o.orderS_status (plural of order)

#5 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 03 January 2007, 22:24

View PostBluntknife, on Jan 3 2007, 10:13 AM, said:

I came across this error. I checked the db and noticed that o.order_status doesn't exist, it should be o.orderS_status (plural of order)
try setting in downloads redirect to false
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#6 hostyork

  • Community Member
  • 23 posts
  • Real Name:Andrew
  • Gender:Male

Posted 07 January 2007, 01:45

View Postbkellum, on Jan 3 2007, 10:24 PM, said:

try setting in downloads redirect to false

Don't quite understand whay you mean. Downloads redirect is on flase and I still get the above error.

Can anyone above get the code working right? I also have mail in payment as an option but it allows them to download before they have mailed in the payment. Kinda silly actually, but a fix like this would be spot on.

Anyone?

Andrew
www.hostyorkshire.com

Edited by hostyork, 07 January 2007, 01:46.

Andrew

#7 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 07 January 2007, 04:02

Any more trouble shooting ideas Bill?

I still can't get the actual download link to show.
For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#8 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 07 January 2007, 04:32

To all who continue to have download issues:

I was able to get my downloads to work without any issues using my step by step above. I did not have to edit any code in order to get it to work other than correcting the slash "/" after the word catalog as mentioned above.

Check that you have at least followed my step by step first. Then be sure your download file is named using either all upper or all lowercase letters with no spaces and ends with the extension ".zip".

For example: download123.zip
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#9 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 07 January 2007, 04:39

Bill,

Can you tell me what this error means at least?

Fatal error: Call to undefined function tep_get_configuration_key_value() in /home/mpmorg/public_html/shop_dev/admin/orders.php on line 56

I get this when I change the order status through the admin/customer/orders

It is my only clue to why downloads won't work for me!
For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#10 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 07 January 2007, 04:40

Also,

Here are some more tips:

Check your permissions for your download and pub directories.
You can use a ftp program like http://www.smartftp.com to change the permissions of those folders if you don't have access to the server root. It is called CHMOD.

The product you want people to download has to be in the download folder.

Did you turn the download function on in the store admin under "configuration"?

Did you setup the product to be downloaded in the products attributes section?

Again make sure the pub and download directory has permissions of 777 or 755.
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#11 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 07 January 2007, 04:41

View Posthostyork, on Jan 6 2007, 07:45 PM, said:

Don't quite understand whay you mean. Downloads redirect is on flase and I still get the above error.

Andrew
www.hostyorkshire.com
Yeah, that is what I meant...to set the "Download Redirect" to "FALSE" in your admin.
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#12 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 07 January 2007, 04:43

Oops! Never mind - error was left over code from Download Controller 5.3.

Still no download though

Edited by mpm, 07 January 2007, 04:46.

For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#13 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 07 January 2007, 04:51

View Postmpm, on Jan 6 2007, 10:39 PM, said:

Bill,

Can you tell me what this error means at least?

Fatal error: Call to undefined function tep_get_configuration_key_value() in /home/mpmorg/public_html/shop_dev/admin/orders.php on line 56

I get this when I change the order status through the admin/customer/orders

It is my only clue to why downloads won't work for me!
MPM, did you try installing the "Download Conroller" contribution or some other type of modification to the order/payment process? The error that includes "tep_get_configuration_key_value" is not a default line of code in a standard osCommerce store.

It appears you did not either complete the modifications for the contribution or did not install it correctly.

Do a file compare using Winmerge or Beyond Compare to compare your files with the attempted contributions install files.
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#14 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 07 January 2007, 04:53

MPM....opps, we must have replied at the same time.

Edited by bkellum, 07 January 2007, 04:57.

Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#15 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 07 January 2007, 04:57

Bill,

I must have posted while you were writing a reply.

I did install the download controller but then went back to basics, and that error was because of the code left in orders.php, yes.
For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#16 willwatson

  • Community Member
  • 67 posts
  • Real Name:Will Watson

Posted 09 January 2007, 09:24

Hi Bill, everything listed here is what ive tried already, so i tried it again a few times and still no joy. i dont know why its suddenly just stopped. The folder permissions are set. the filenames are correct. there is a '/' after my catalogue directory and downloads are enabled and not set for redirect...

im loosing my hair over this thing!

#17 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 11 January 2007, 22:55

Bill,

I use STS 3.2 - when I delete my product_info file I get the download link and product availability options.

However, I want to be able to have customisable product info pages.

Do you have any recommendations on what I should be looking at next?
For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#18 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 12 January 2007, 00:45

View Postmpm, on Jan 11 2007, 04:55 PM, said:

Bill,

I use STS 3.2 - when I delete my product_info file I get the download link and product availability options.

However, I want to be able to have customisable product info pages.

Do you have any recommendations on what I should be looking at next?
Mike, do you mean you use STSv 4.2? The product_info.php file should not effect your download link or your product attributes.
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

#19 mpm

  • Community Member
  • 314 posts
  • Real Name:mike
  • Location:Australia

Posted 12 January 2007, 00:49

Nah still using the previous version. If I remove the file - I get a download link. If I leave it in - no link.

Edited by mpm, 12 January 2007, 00:50.

For my contribution (to society) see my profile link.
--
my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

#20 bkellum

  • Community Member
  • 4,893 posts
  • Real Name:Bill Kellum
  • Gender:Male
  • Location:Chicago

Posted 12 January 2007, 01:19

View Postmpm, on Jan 11 2007, 06:49 PM, said:

Nah still using the previous version. If I remove the file - I get a download link. If I leave it in - no link.
Try comparing your product_info.php with a stock osC version to see what is in yours that is causing the problem.
Bill Kellum

Sounds Good Productions
STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE