NemoPS Posted July 13, 2012 Share Posted July 13, 2012 Hey there, i'm assuming the prestashop addons store is using prestashop itselft (why not to believe in their own software?) and for that reason my question is this: - you can download free products directly from the addons store. No registration, no checkout process. Just direct dowload. It is possible in prestashop? I tried adding free digital products (setting price to 0), but i still have to go through the checkout process. I just want to substitute the "add to cart" with "download for free" in product page, and allow customers to directly download from there. So, again, is this possible? Fabio Link to comment Share on other sites More sharing options...
Carl Favre Posted July 13, 2012 Share Posted July 13, 2012 Hi Nemo1, Yes it is technically possible. As you say we are using PrestaShop to do it, even if it is quite heavily modified, it is still PrestaShop. So with some work you should be able to do the same . 1 Link to comment Share on other sites More sharing options...
BWT Posted July 13, 2012 Share Posted July 13, 2012 I searched the form for results, Maybe this can help you. http://www.prestashop.com/forums/topic/32246-how-to-remove-shipping-address-and-skip-address-step-in-checkout 1 Link to comment Share on other sites More sharing options...
NemoPS Posted July 13, 2012 Author Share Posted July 13, 2012 Hi, Thanks for the answers to both 1 Link to comment Share on other sites More sharing options...
razaro Posted July 13, 2012 Share Posted July 13, 2012 Hi One of workarounds is to use attachment feature like rocky used on his website http://www.nethercottconstructions.com/en/prestashop-modules/4-product-links.html Code is already in product.tpl (section with tabs) it only need some styling. Something like this : {if $attachments} {foreach from=$attachments item=attachment} <p><a href="{$link->getPageLink('attachment.php', true)}?id_attachment={$attachment.id_attachment}"><img src="{$img_dir}download.png" alt="{$attachment.name|escape:'htmlall':'UTF-8'}" title="{$attachment.description|escape:'htmlall':'UTF-8'}"></img></a></p> {/foreach} {else} <form id="buy_block" ... .... {/if} And you can use some additional if/else conditions like if $virtual depending how you set product. 1 Link to comment Share on other sites More sharing options...
girlsgirl12 Posted July 20, 2012 Share Posted July 20, 2012 Razaro- your link is for next and previous links module FREE however how would you change those links so that they are linked to "download product" each specific product that is downloadable???? Thanks Link to comment Share on other sites More sharing options...
razaro Posted July 20, 2012 Share Posted July 20, 2012 (edited) Here is maybe better solution, that works for downloadable products. In attachment there are files download-file.php and ProductController.php. File download-file.php should be copied in root directory of prestashop installation. ProductController.php goes to override/controllers/ folder. If there is already one there code should be megred. Finialy product.tpl in theme folder should be edited. I choose to hide whole buy_block. Changed {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> to {if $virtual AND $product->getPrice(true, $smarty.const.NULL) == 0} <a href="{$link->getPageLink('download-file.php', true)}?file={$product_filename|escape:'htmlall':'UTF-8'}" title="{l s='download this product'}" class="button">{l s='Free Download!'}</a> {elseif ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> Note only that this doesn't take in consideration downloadable product options like number of downloads, expiration date and number of days. @girlsgirl12 I didn't quite understand your question, but did you mean something like this ? directdownload.zip Edited September 26, 2012 by razaro (see edit history) 3 Link to comment Share on other sites More sharing options...
Daniel - PrestaBR Posted September 26, 2012 Share Posted September 26, 2012 In attachment there are files download-file.php and ProductController.php. Hi there, razaro Where do I find these files? Thanks Link to comment Share on other sites More sharing options...
razaro Posted September 26, 2012 Share Posted September 26, 2012 Hi DGV, I edited post, not sure what happened before. Maybe I forgot to attach file or some forum glitch. 1 Link to comment Share on other sites More sharing options...
er10harsha Posted December 20, 2012 Share Posted December 20, 2012 Hi, I want if product is downloadable then it should not update cart more than one. Please help me... Link to comment Share on other sites More sharing options...
parttyshop Posted January 25, 2013 Share Posted January 25, 2013 Here is maybe better solution, that works for downloadable products. In attachment there are files download-file.php and ProductController.php. File download-file.php should be copied in root directory of prestashop installation. ProductController.php goes to override/controllers/ folder. If there is already one there code should be megred. Finialy product.tpl in theme folder should be edited. I choose to hide whole buy_block. Changed {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> to {if $virtual AND $product->getPrice(true, $smarty.const.NULL) == 0} <a href="{$link->getPageLink('download-file.php', true)}?file={$product_filename|escape:'htmlall':'UTF-8'}" title="{l s='download this product'}" class="button">{l s='Free Download!'}</a> {elseif ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> Note only that this doesn't take in consideration downloadable product options like number of downloads, expiration date and number of days. @girlsgirl12 I didn't quite understand your question, but did you mean something like this ? Hi, I did this as you explain, and I get a "Download this product!" button in my free downloads, but when I click this button it gets me to an error page. What is wrong? Do I have to change anything else? I'm using PS v. 1.5.2 You can see it in http://www.partty.es/es/48-lista-de-invitados-gratis.html Thanks!! Link to comment Share on other sites More sharing options...
razaro Posted January 26, 2013 Share Posted January 26, 2013 This was working in 1.4 version but in 1.5 there were some changes, so my previous solution is not working. When I find solution for 1.5 will post here. 1 Link to comment Share on other sites More sharing options...
parttyshop Posted January 28, 2013 Share Posted January 28, 2013 This was working in 1.4 version but in 1.5 there were some changes, so my previous solution is not working. When I find solution for 1.5 will post here. Thanks for your reply. This is a very useful module, I hope you can make it work, I can't find any other way to make free downloads easy to my shop customers. Anyway, thanks for the good job made with the module. Link to comment Share on other sites More sharing options...
razaro Posted January 28, 2013 Share Posted January 28, 2013 (edited) Here is modification for Prestashop version 1.5. Files should be copied with same file structure like in zip file. So download-file.php should go to root of websites where are rest of main php files. DownloadFileController.php should be copied to controllers/front folder and file ProductController.php to override/controllers/front if it not exists there. If file exists code should be compared and copied apropriate lines. Last step is to change code in product.tpl in current theme folder. This could be done in different way but here is one. In default theme, for example, find code arround line 259 {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> and replace it with {assign var='virtualproductPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {if $product->is_virtual AND $virtualproductPrice == 0 } <a href="{$link->getPageLink('download-file', true,NULL,"file={$product_download->filename}")}" title="{l s='download this product'}" class="button">{l s='Free Download!'}</a> {elseif ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> And now you have direct download of free virtual products. free download.zip Edited January 28, 2013 by razaro (see edit history) 2 Link to comment Share on other sites More sharing options...
parttyshop Posted January 29, 2013 Share Posted January 29, 2013 (edited) Hi Razaro, thank you very much for your help. It works great. I have been searching for this function for a long time...and finally you got it!! The only thing I miss is that this don't changes the 'Add to cart' buttons in products categories page, and it will be a little confusing for the users...but I'm not a programmer so I don't know if this is difficult or easy to do (or maybe not possible) You can see it here http://www.partty.es...escargas-gratis Anyway, thanks again for your great and fast job!! If you don't mind I will share it in the spanish forum, I know that some people where searching for this function too. Edited January 29, 2013 by parttyshop (see edit history) Link to comment Share on other sites More sharing options...
MSS77 Posted August 22, 2013 Share Posted August 22, 2013 razaro Nice!! Congratulations! But if I show my product category (ie. 'Free products') where I have all my free products, then every product still show "add cart" button. Only when you enter the specific product the button is "Free Download!". Is possible to put "Free Download!" button in every free product when are showed in the category level ? I guess I have to go to category.tpl (or similar) and find the code referenced and changed...but how I do this? Thanks! Link to comment Share on other sites More sharing options...
cajuma2012 Posted December 23, 2013 Share Posted December 23, 2013 (edited) Hi, for me isn't working. My free products download, but 0 bytes... You can see it in: http://www.agenciapressphoto.com/store/home/601-colombia-muere-diomedes-diaz-luto-en-el-vallenato.html My Prestashop is 1.5.3.1 Can I you help me please... Edited December 23, 2013 by cajuma2012 (see edit history) Link to comment Share on other sites More sharing options...
nisfize Posted January 6, 2014 Share Posted January 6, 2014 Here is maybe better solution, that works for downloadable products. In attachment there are files download-file.php and ProductController.php. File download-file.php should be copied in root directory of prestashop installation. ProductController.php goes to override/controllers/ folder. If there is already one there code should be megred. Finialy product.tpl in theme folder should be edited. I choose to hide whole buy_block. Changed {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> to {if $virtual AND $product->getPrice(true, $smarty.const.NULL) == 0} <a href="{$link->getPageLink('download-file.php', true)}?file={$product_filename|escape:'htmlall':'UTF-8'}" title="{l s='download this product'}" class="button">{l s='Free Download!'}</a> {elseif ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form-->Note only that this doesn't take in consideration downloadable product options like number of downloads, expiration date and number of days. @girlsgirl12 I didn't quite understand your question, but did you mean something like this ? how to edit product-list.tpl. so it looks like product.tpl i using presta 1.4 help me please 1 Link to comment Share on other sites More sharing options...
iltecnobadante Posted April 2, 2014 Share Posted April 2, 2014 Hi, thank you very much for code But, I've need to enable direct download only when customer are loggef, it's possible? 1 Link to comment Share on other sites More sharing options...
demaerd Posted June 20, 2014 Share Posted June 20, 2014 It woud be nice to make it for 1.6 version) 1 Link to comment Share on other sites More sharing options...
recoil Posted June 22, 2014 Share Posted June 22, 2014 I second that. Link to comment Share on other sites More sharing options...
iltecnobadante Posted July 11, 2014 Share Posted July 11, 2014 Hi, I have need a method for track free products download, have you an idea? Best regards 1 Link to comment Share on other sites More sharing options...
ElenaMas Posted July 30, 2014 Share Posted July 30, 2014 Thanks so much for the code. But I have some problem, when you press the button "download" you go to other link and don't download anything. You can see it: at this link. Link to comment Share on other sites More sharing options...
Bonifero Posted December 3, 2014 Share Posted December 3, 2014 Hi, is this code also available for ps v.1.6? Thanks Link to comment Share on other sites More sharing options...
wlabs Posted February 25, 2015 Share Posted February 25, 2015 Like @iltecnobadante, I'm also looking for a way to track free downloads via the back-office. Anyone have ideas? Link to comment Share on other sites More sharing options...
wdcurry Posted April 29, 2016 Share Posted April 29, 2016 Unless i miss the gist of the thread, there seems to be a logic path missing here: say i offer one free ebook. Store the big file up on AWS for example, create a thank you file with details of the download link. Price it at 0$ as a virtual product. Run through the check out to increase your customer base. They should not receive 3 emails for the cart process (payment accepted) and i would argue, as well, the Order Confirmation. It seems heavy. Thoughts? Link to comment Share on other sites More sharing options...
Newspower.ir Posted October 29, 2019 Share Posted October 29, 2019 On 1/28/2013 at 9:08 PM, razaro said: Here is modification for Prestashop version 1.5. Files should be copied with same file structure like in zip file. So download-file.php should go to root of websites where are rest of main php files. DownloadFileController.php should be copied to controllers/front folder and file ProductController.php to override/controllers/front if it not exists there. If file exists code should be compared and copied apropriate lines. Last step is to change code in product.tpl in current theme folder. This could be done in different way but here is one. In default theme, for example, find code arround line 259 {if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> and replace it with {assign var='virtualproductPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {if $product->is_virtual AND $virtualproductPrice == 0 } <a href="{$link->getPageLink('download-file', true,NULL,"file={$product_download->filename}")}" title="{l s='download this product'}" class="button">{l s='Free Download!'}</a> {elseif ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)} <!-- add to cart form--> hi . can u please help me? my store is on PS 1.6.1.24 i did all these things. but i faced with fatal error : in address bar : http://newspower.ir/index.php?controller=download-file&file= in white page with these words : FATAL ERROR And now you have direct download of free virtual products. free download.zip 5.49 kB · 248 downloads Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now