thedoctor Posted January 24, 2010 Share Posted January 24, 2010 I posted this elsewhere in a different area, put so far I have no response so thought I would try here Hi I am setting up a site that will allow users to download files either free or paid for, depending on the product.I can't seem to get this to work where the user gets redirected straight to confirmation page if the download is free.This is the mod I have been trying it, but firefox just doesn't like it //**si** 04-11-05 No Payment screen if order+shipping are ZERO if ( $order->info['subtotal']+$order->info['shipping_cost']==0 ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, NULL, 'SSL'));} //**si** end It keeps coming up with the error Anyone know what I am doing wrong here? Any help is greatly appreciated The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. I have since changed the code by Si to //**si** 04-11-05 No Payment screen if order+shipping are ZERO if ( $order->info['subtotal']+$order->info['shipping_cost']==0.00 ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, NULL, 'SSL'));} //**si** end The error has now stopped, but it is still asking for payment even if the product is free. I will still be charging for some downloads, but a lot of what I do I will be offering for free with the option to donate. Many thanks in advance. Link to comment Share on other sites More sharing options...
thedoctor Posted January 24, 2010 Author Share Posted January 24, 2010 I might add this has been added in checkout_payment.php Any help would be greatly received. Many thanks in advance Link to comment Share on other sites More sharing options...
germ Posted January 24, 2010 Share Posted January 24, 2010 I might add this has been added in checkout_payment.php Any help would be greatly received. Many thanks in advance If the product is free and "downloadable", where is the logic in checking $order->info['shipping_cost'] ? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
thedoctor Posted January 24, 2010 Author Share Posted January 24, 2010 That was in the original modification script. By I presume someone called Simon. I have modified it to get to the success page now without going to taking payment, but the download isn't actually available to download. I am looking at removing all the references to buy it now unless the value is greater than $0.00 and have a direct link, however I am not really satisfied with that solution because people will be able to directly link to the mod with more ease. Many thanks in advance, and thank you for your time. Link to comment Share on other sites More sharing options...
thedoctor Posted January 24, 2010 Author Share Posted January 24, 2010 This is what I have now //**si** 04-11-05 No Payment screen if order+shipping are ZERO if ( $order->info['subtotal']+$order->info['shipping_cost']==0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, NULL, 'SSL')); } //**si** end If anyone has any ideas on how to get this working it would be appreciated. I can't remember if last time I did it if I needed to set something in admin which has just occurred to me. Will look into it Link to comment Share on other sites More sharing options...
sky_diver Posted January 24, 2010 Share Posted January 24, 2010 You should probably create a new payment status in admin, such as free download and set it to allow downloads at that level, then configure the code in checkout_confirmation to set a zero price product at the freedownload status when inserted into the orders table. Link to comment Share on other sites More sharing options...
germ Posted January 24, 2010 Share Posted January 24, 2010 Try: //**si** 04-11-05 No Payment screen if order+shipping are ZERO if ( $order->info['subtotal'] < 0.01 ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, NULL, 'SSL')); } //**si** end The logic of checking $order->info['shipping_cost'] still escapes me if the product(s) is (are) free and downloads?? :blink: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
thedoctor Posted January 24, 2010 Author Share Posted January 24, 2010 Looking at it, it doesn't make much sense, it's just what was in that mod. I have found two mods which I used in the last release which I used, I am going to try and implement them tomorrow, then update these to the current files which are being used and put them up as a new mod. I have seen a few people trying to do this, but are doing hacks which I wouldn't like to use. I want to know who has downloaded what, where these other hacks don't allow that. Link to comment Share on other sites More sharing options...
thedoctor Posted February 18, 2010 Author Share Posted February 18, 2010 I have put several mods together to make a download tool that does what I want. I allows you to offer free downloads, paid downloads and physical products. Hope it helps you to http://addons.oscommerce.com/info/7248 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.