Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Check/Money Order (Auto-Downloads)


anothermethod

Recommended Posts

Hey. I was wondering if anyone had a solution for this:

 

I have a downloadable product and when you select Check/Money Order for payment and submit, it gives you the address to send the check to, but it also lets you download the product right then. Is there a way to get this module to allow me to authorize a download after the money has cleared? Or, is there another module that does this already?

 

Thanks in advance ;)

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Another way is ...

 

in the file catalog/include/modules/downloads.php

about line 25

 

add the column field , orders_status in the sql statment.

 

just like this:

$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays, orders_status from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

 

 

 

in the beginning of <!-- left box -->, (same php page)

 

insert in the if -> ($downloads['orders_status'] == 3 ), for me the state is 'Delivered', so when the state

is 'Delivered' the field 'orders_status' is equal to 3.

 

 

 

<?php
// The link will appear only if:
// - Download remaining count is > 0, AND
// - The file is present in the DOWNLOAD directory, AND EITHER
// - No expiry date is enforced (maxdays == 0), OR
// - The expiry date is not reached
  //cealex: added --> ($downloads['orders_status'] == 3 )			
  if ( ($downloads['orders_status'] == 3 ) &&  
	  ($downloads['download_count'] > 0) && 
		  (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) 
			  && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) {
	echo '			<td class="main"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a></td>' . "\n";
	echo '			<td class="main">' . TABLE_HEADING_DOWNLOAD_DATE . tep_date_long($download_expiry) . '</td>' . "\n" .
		 '			<td class="main" align="right">' . $downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n";

  } else {
	echo '			<td class="main">' . $downloads['products_name'] . '</td>' . "\n" .
	 		 '			<td colspan=2 class="main">' . TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID . '</td>' . "\n";
  }
?>
<!-- right box -->
<?php	  
	echo  '		  </tr>' . "\n";
}
?>

 

Note that the "<td's>" was changed, put all the code above. It's necessary to define

TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID in all languagens.

Don't forget to backup your code :) , before the changes.

 

for example,

 

//cealex: added

//cealex: change the text ....

define('TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID', 'Download available after complete transaction payment');

 

 

Hope this help,

hasta.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...