Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

download link of digital goods help needed and info


Guest

Recommended Posts

Posted

Doing even more research after my previous post, I found an old tip from someone and it was working pretty good...got the dl link to the products to finally show up after payment (not only right there where their confirmation of the purchase is, but also they can dl later in MY ACCOUNT, if you have given them more than one chance to dl) , customer is redirected back fine, however, when I click on the dl link, I am getting a syntax error. Im am almost positive that I have a stupid space or apostrophe where I shouldnt. Sometimes its hard to tell if there is a space or not when you print these things off to have right in front of you when you're messing with the codes.

 

The post also listed code addition/change to keep ppl from being able to abuse the downloaded products.

 

Here is the c/p post from cyber2000 (rj):

 

Ok guys,

 

whilst looking on here for help in other areas, i still see that some are having problems in being able to get the downloads to work. Soo herre is the info for you thanks to my research on here and those that posted them in the first place:

 

Have you downloads activated??

 

If not you have to do this via the admin panel. In the 'Configuration' panel click 'Download'. Once you have that done click 'Enable download' and set it to 'true'.

 

You then have associate the sownloadable file to the product so you have to go into the 'Catalog' menu and click the 'Product Attributes' link. When you get to this page you will see three options 'Product Options', 'Option Values' and 'Products Attributes'. In the 'Product Options' menu enter a new option name called 'Download'. Once you have that entered go over to the 'Option Values' and enter in 'Yes' for the 'Download' option. Once you have all that done now you can go to the 'Product Attributes' panel and select your pruduct. Set the 'Option Value' for 'Download' and set the 'Option Value' to 'Yes'. Directly below the 'Option Name' there is a text window called 'Filename:'. Here you have to enter the name of the file thats associated with your product. Then just enter the expiry times etc and bobs your uncle.

 

Of course all this is useless if you do not have your product uploaded to the correct directory. The default directory is called 'download' but since you are selling a digital product I would reccommend that you change the name of the folder as this is the first place any hacker would look to get your stuff for free. If you do decide to change the name of the folder you will also have to change the name in 'includes/configure.php' to reflect the changes you made to the download folder.

 

no once you have done this the downloads will automatically be available upon a credit card payment. So, test cards will still allow them to steal the download for free. To ensure that the customer can only download once you have physically been paid add the foolowing code:

 

If you have the default osc catalog\download.php file try changing first sql query to this:

CODE

 

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

 

 

This code should only allow the d/l if the order is set to delivered. so in admin control panel, if you click on the customer orders and then set the order from pending to delivered, the customer ONLY then will be allowed to click the link and download their order.

 

This STOPS ALL customer from sttealing your downloads by using the test credit card number (which I wont display even you know it as it is not fair).

 

Hope you get it and it works as I am using it and it works great.

 

 

Thanks

 

 

RJ

 

 

 

In doing these steps, I have made GREAT progress, however, the error is still hanging me up. Question: in between the periods and apostrophes and quotes, should there be spaces? Also, as you see at the end of the changed code, there is a semicolon. Should that be there? Is that causing the problem? Should the remaining original code AFTER this stay?

 

Here is mine:

 

// 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 ! = ''"; " . TABLE_ORDERS_STATUS . " os where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' 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 != ''"); and o.orders_status = os.orders_status_id and os.downloads_flag = '1' and os.language_id = '" . (int)$languages_id . "'");

if (!tep_db_num_rows($downloads_query)) die;

$downloads = tep_db_fetch_array($downloads_query);

 

Should the latter part remain (which I have in a larger font)? Have I flubbed up with a space or something?

 

YOU GUYS ARE GREAT AND I APPRECIATE ANY HELP YOU CAN GIVE!

 

Michelle

Archived

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

×
×
  • Create New...