Jump to content



Latest News: (loading..)

- - - - -

[Contribution] Super Download Store for Version 2.3.x


  • Please log in to reply
142 replies to this topic

#21 ONLINE   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,076 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 14 February 2011 - 11:12 AM

Forgot to add

Because of this error, the download status is still at pending.

This is probably something i have done and not your contribution.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder, so dont bother sending PMs asking for help as you wont get any.  

OSC has a steep learning curve, but in general the program does work.  If it doesnt work, the chances are it is something you have done.

#22   burt

burt

    Code Monkey

  • Community Team
  • 7,745 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 14 February 2011 - 11:21 AM

Chris, you might as well rip out the mysql 3 compatibility code, and use interval instead.  Is anyone still on 3?  I'm fairly positive the team removed compatibility for mysql 3 anyway.

Edit:  It was compat for php3 that was ripped out.  Even so, I don't think it's worth retaining compat for old mysql - what do you/others think?

Edited by burt, 14 February 2011 - 11:28 AM.

Dummies guide to designing osCommerce 2.3 Click Me

Or maybe a ready made theme for your shop ??

Warning: My posts may contain Horsemeat.

#23   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,724 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 14 February 2011 - 08:47 PM

Burt,

Perhaps when I get time, but as of right now I am too busy to re-do it.  If anyone else wishes to make a revision, please feel free.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#24   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 14 February 2011 - 11:18 PM

View Post14steve14, on 14 February 2011 - 10:38 AM, said:

Chris

I have just installed this contribution on my relatively new store.  I have used your files supplied and dropped them on top of my files, and added the extra bits as required.  I have entered the product info, and added the attribute.  The file to be downloaded is definately in the folder and the file name is correct.  The item enters the cart fine and the checkout process is carried through.  The item is a free download, and no shipping or payment methods are required.  Downloads are enabled and the standard 7 days and five downloads are set.

Now, when the process is completed the checkout sucess page has all the information that it should, but the download link is not available.  There is a warning above the link that says

Warning: mktime() expects parameter 6 to be long, string given in /home/railway1/public_html/catalog/includes/modules/downloads.php on line 48

Line 48 is the one marked in the below code


<!-- list of products -->
<?php
    while ($downloads = tep_db_fetch_array($downloads_query)) {
// MySQL 3.22 does not have INTERVAL
      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);      
$download_expiry = date('Y-m-d H:i:s', $download_timestamp);
?>
          <tr class="infoBoxContents">
<!-- left box -->

Do you have any idea that may be causing this.  I have checked the insall and everything seems to be fine.

There are a couple needed instructions in addition to those included in the contribution.  Rather than spend time tinkering with someone else's contrib and uploading a new mod, I'll post those changes on the forum and hope that others find the post and can make the fixes.  Perhaps, the contributor will make the necessary changes and upload a package with the patches.

1.  In catalog/includes/modules/download.php around line 48,

find:

	  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

replace with:

		  $dty = intval($dt_year);
		  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dty);

2.  In catalog/checkout_process.php around line 118

find:

						  'date_purchased' => 'now()', 

Add the following line AFTER the above code:

						  'last_modified' => 'now()', 

The first change will fix the time error.  The second change will fix the problem with missing download links and bad expiration dates (which you won't notice until after you get past the time error).

I think these were the only things that I ran across.  I'll keep an eye on this thread.  If you run into any other problems, it might be something that I also ran across and if I have a fix for it, I'll get it posted.

Jetta

#25 ONLINE   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,076 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 15 February 2011 - 09:34 AM

Jetta

That seems to have worked.  many thanks for the advice.

Any idea how to change the button to the new type rather than an image.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder, so dont bother sending PMs asking for help as you wont get any.  

OSC has a steep learning curve, but in general the program does work.  If it doesnt work, the chances are it is something you have done.

#26   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 15 February 2011 - 06:42 PM

View Post14steve14, on 15 February 2011 - 09:34 AM, said:

Jetta

That seems to have worked.  many thanks for the advice.

Any idea how to change the button to the new type rather than an image.

catalog/includes/languages/english.php

Find:

define('IMAGE_BUTTON_DELETE', 'Delete');
Add the following after:

define('IMAGE_BUTTON_DOWNLOAD', 'Download Now!');
catalog/includes/modules/downloads.php

Find around line 101:

		  echo '			<td class="main" align="center">' . $downloads['products_name'] . ' - <a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $file_array['download_group_file_description'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";
Replace with:

		  echo '			<td class="main" align="center">' . $downloads['products_name'] . ' - <a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $file_array['download_group_file_description'] . '</a><br>' . tep_draw_button(IMAGE_BUTTON_DOWNLOAD, 'triangle-1-e', tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']), 'primary') . '<br>' . $file_size . '</td>' . "\n";
Find around line 103:

		  echo '			<td class="main" align="center"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '<br>' . tep_image_button('button_download.gif', 'Download') . '</a> - ' . $file_size . '</td>' . "\n";
Replace with:

		  echo '			<td class="main" align="center"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a><br>' . tep_draw_button(IMAGE_BUTTON_DOWNLOAD, 'triangle-1-e', tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']), 'primary') . '<br>' . $file_size . '</td>' . "\n";

catalog/includes/languages/english/images/buttons/button_download.gif

delete that image file.

Worked for me.  Save a copy of your files before making changes though.

#27   musician

musician
  • Members
  • 1 posts
  • Real Name:Koos

Posted 13 March 2011 - 04:52 PM

I just installed a clean version of osCommermerce. I try to install this contribution but there's something that's not working. When I tried to execute the SQL Setup_Orders_Status, my Phpadmin said the following, #1054 - Unknown column 'public_flag' in 'field list'. Would anyone help me further?

#28   AlexStudio

AlexStudio
  • Members
  • 1,092 posts
  • Real Name:Alex Li
  • Gender:Male
  • Location:Taipei, Taiwan

Posted 04 April 2011 - 03:11 AM

Chris,

Do you really fully understand the original code I wrote for SDS?
Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

#29   fa_demion

fa_demion
  • Members
  • 2 posts
  • Real Name:Holger

Posted 12 May 2011 - 02:13 PM

Hi folks,

i'm a little confused, how this contribution should work correctly.

I spend very much time to find the error, because in the last published version, buyers got an instand download without paying and so on.

in catalog/download.php
$downloads_query = tep_db_query("select date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, o.orders_status, 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 >= '0' 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 != ''");

o.orders_status >= '0'

See the red marked Value!!
How should this work with Download Controller?

The orders_status would be allways greater as 0

I think the correct Value should be: o.orders_status >= DOWNLOADS_CONTROLLER_ORDERS_STATUS

The same is in catalog/includes/modules/download.php

Greetings,
Holger

#30   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,724 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 20 May 2011 - 09:07 PM

I have updated this contribution to reflect the code edits suggested by Raiwa and Fa_Demion.  The new download is available here:  Super Download Store v2.3.x (R1)




Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#31   infodel

infodel
  • Members
  • 8 posts
  • Real Name:Aj

Posted 13 June 2011 - 11:29 AM

Set up the superdownload store as instructed in addon folder.

While running catalog/admin/filegroup_db_setup.php

Getting the error:


1146 - Table 'kmdb.products_attributes_download_groups' doesn't exist

select * from products_attributes_download_groups where download_group_id = 0 and language_id = '1'

[TEP STOP]



Any advice?
Best.
Aj :-)



View PostDunWeb, on 21 January 2011 - 07:18 AM, said:

This is the Official Support Thread for Super Download Store for osCommerce 2.3.x


This contribution is based on Super Download Shop for version 2.2 RC2a (http://addons.oscommerce.com/info/4868)
----------------------------------------------------
Super Download Shop contribution is an enhancement of the osCommerce download module and download file management, including following features:

* Secure download for pending orders based on DownLoads Controller v5.3 by Linda McGrath which was the best solution to secure downloads. Without similar control, customers could get their downloads before they actually pay.

* Group files download per product which enable download shops to offer multiple files in a single product. With this ability, shop owners can:

- Break a large download file into a group of files, to prevent problems like insufficient resource, time out errors...etc.
- Bundle multiple downloads in one package to increase sells.

* Store download files in sub folders under the download directory to improve the file management.

* Built-in superior file management interface in admin panel.

------------------------------------------------------------------------------------------------
Changes include:

* File changes to work with the 960 Grid System
* Creation of an Order Status SQL to set the orders status automatically
* Rewrite of the installation file
* Addition of Manual Installation Instructions


#32   infodel

infodel
  • Members
  • 8 posts
  • Real Name:Aj

Posted 13 June 2011 - 08:06 PM

OK what I did was I ignored STEP 3.2 - in install.html and overwrote the files. Now I did as directed but getting the error below while trying to run - catalog/admin/filegroup_db_setup.php



Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /public_html/km/admin/includes/database_tables.php:66) in /public_html/km/admin/includes/functions/sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /public_html/km/admin/includes/database_tables.php:66) in /public_html/km/admin/includes/functions/general.php on line 34


Any resolution?
Best.
Aj :-)

#33   b0rdpladen

b0rdpladen
  • Members
  • 18 posts
  • Real Name:Mark

Posted 26 June 2011 - 05:15 PM

Hi,
First off, thanks for the free addon.

However, I wouldnt be posting just for that, sad world, I know.
I have this issue, with redirect disabled (didnt work on linux os), that file downloads get merged with themselves.
EG: Download mp3 on 4.4 megs, receive 8.8 with track looping twice, same with raw text files containing 123, gets to 123123 upon receiving.

Any chance for some help here?

Best Regards,
Mark

#34   b0rdpladen

b0rdpladen
  • Members
  • 18 posts
  • Real Name:Mark

Posted 27 June 2011 - 05:33 PM

View Postb0rdpladen, on 26 June 2011 - 05:15 PM, said:

Hi,
First off, thanks for the free addon.

However, I wouldnt be posting just for that, sad world, I know.
I have this issue, with redirect disabled (didnt work on linux os), that file downloads get merged with themselves.
EG: Download mp3 on 4.4 megs, receive 8.8 with track looping twice, same with raw text files containing 123, gets to 123123 upon receiving.

Any chance for some help here?

Best Regards,
Mark

Figured out a few things.

Made som changes in catalog/download.php
First off, changed $buffersize to whatever 1024*1024 equals.
Also, I added a few lines  in the header file, to allow proper mp3, zip, and more fileformats.
Apparently the current upload script appends a line of text at the beginning of each download.

// Now send the file with header() magic
  header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
  header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
  header("Cache-Control: no-cache, must-revalidate");
  header("Pragma: public");
  header("Content-Transfer-Encoding: binary");
  header("Content-Type: application/zip");
  header("Content-disposition: attachment; filename=\"" . $file_name . "\"");
	ob_clean();
	flush();
	echo readfile("$file_name");

With the flush and ob_clean command, things are working for me :-)

#35   talbot649

talbot649
  • Members
  • 52 posts
  • Real Name:Andrew Talbot
  • Gender:Male

Posted 01 July 2011 - 11:26 AM

I've installed this contribution and everything works great - thank you!

My only issue is that the download link is not available automatically after ordering - I have to update the order status for it to appear.

I've got the order status 'Download Now Available' (ID=15) to be the automatic status once a PayPal order is completed, and also set this to default. I have also set order id 15 as the value for 'Downloads Controller Orders Status Value' in Configuration>Download.

When I manually update the order status the link appears, but on completion of the order this doesn't happen automatically - can anyone help please?
hor-i-zon

#36   talbot649

talbot649
  • Members
  • 52 posts
  • Real Name:Andrew Talbot
  • Gender:Male

Posted 04 July 2011 - 12:26 PM

Bump
hor-i-zon

#37   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,724 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 04 July 2011 - 02:11 PM

Andrew,


Ensure the order status values are set correctly and that the, nothing below 10 will allow for downloads.  Also ensure you have downloads enabled in admin>> configuration>> downloads





Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#38   talbot649

talbot649
  • Members
  • 52 posts
  • Real Name:Andrew Talbot
  • Gender:Male

Posted 13 July 2011 - 08:52 AM

Hi Chris,

Enable download is set to true. And I thought I had the other settings correct also - I've added screenshots below:

http://awesomescreenshot.com/0c0gigvaa
http://awesomescreenshot.com/052gigy3b

Could you have a look and advise if anything is wrong?
hor-i-zon

#39   talbot649

talbot649
  • Members
  • 52 posts
  • Real Name:Andrew Talbot
  • Gender:Male

Posted 13 July 2011 - 09:12 AM

Another screenshot that might help is of the screen you get when confirming the order. It looks like the system wants to provide a download link, but doesn't:

http://awesomescreenshot.com/0fbgihycc

And when I switch the status to pending and then back to 'Download Available' it works ok...


http://awesomescreenshot.com/05fgii7c7
hor-i-zon

#40   talbot649

talbot649
  • Members
  • 52 posts
  • Real Name:Andrew Talbot
  • Gender:Male

Posted 13 July 2011 - 06:19 PM

I've just noticed that the download expiry date on the order confirmation screen is 7/12/1999, but on the account screen it's correctly 20/7/2011 - this is probably the issue. Can anyone suggest why the order is returning from PayPal with that expiry date?
hor-i-zon