jonah Posted March 19, 2010 Share Posted March 19, 2010 I know that topic title isn't clear but I didn't know how to word it... really.What I need is a way to allow free products that are downloaded without a checkout.If I need to make a module some pointers would be great.Also I would like it if it didn't reduce stock levels as the free downloads are unlimited.Thanks.Jonah Link to comment Share on other sites More sharing options...
razaro Posted March 19, 2010 Share Posted March 19, 2010 I don't know if this is right way or if it has some security flows,but here is code you can put in your theme folder , file product.tplhttp://paste2.org/p/725004It checks if there is zip file, with same name as product, in your download folder.You can change type and folder Link to comment Share on other sites More sharing options...
jonah Posted March 19, 2010 Author Share Posted March 19, 2010 When I look in my download folder I see a file that has a long file name like: 6959bbae9c89914e59fec6039a522fa7bd65b1c7 . no file extension. How do i decrypt this for that code? Link to comment Share on other sites More sharing options...
jonah Posted March 19, 2010 Author Share Posted March 19, 2010 I tried the code but I am not sure where download files go on the server. When I left the code by itself nothing showed up on my store. Can I get more help. Link to comment Share on other sites More sharing options...
razaro Posted March 19, 2010 Share Posted March 19, 2010 Sorry i totally misunderstood your question, my bad :red: Will let you know if i think of something. Link to comment Share on other sites More sharing options...
razaro Posted March 20, 2010 Share Posted March 20, 2010 It can be done but with a changes of core files and that is not recommended.Problem is in getfile.php and format of key./* Key format: - */http://***/get-file.php?key=ef0e829558bb8cc7ac20f4e1d6451c91396be3c8-3e4e91a849b2305a878d18c0cafaf59f32b438d6And hashOrder is generated after checkout.Following code is for test purpose only, it skips all validation, so use it on localhost/test server.In getfile.php (see atachment) i commented out most of code and added $file = _PS_DOWNLOAD_DIR_.$key; $filename = ProductDownload::getFilenameFromFilename($key); Then in product.php after line 116 $smarty->assign('virtual', ProductDownload::getIdFromIdProduct(intval($product->id))); add $smarty->assign('dp', ProductDownload::getFilenameFromIdProduct(intval($product->id))); Then in product.tpl in your theme folder add following code where you wanthttp://paste2.org/p/726236ex. after Link to comment Share on other sites More sharing options...
Recommended Posts