[Skip to main content](#vessel-content)

#   Make file Free download by default

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

13 years 5 months ago [\#102335](#102335) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Make file Free download by default](/forum/23-market-how-to/81392-make-file-free-download-by-default#102335 "My hikamarket user is uploading files for each product but they all get switched to &quot;non free download&quot; by default, and I don't see where to change this from the hikamarket side.  Can I configure all uploaded files to be &quot;Free download&quot; by default?")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

My hikamarket user is uploading files for each product but they all get switched to "non free download" by default, and I don't see where to change this from the hikamarket side.

Can I configure all uploaded files to be "Free download" by default?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODEzOTItbWFrZS1maWxlLWZyZWUtZG93bmxvYWQtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 5 months ago [\#102352](#102352) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Make file Free download by default](/forum/23-market-how-to/81392-make-file-free-download-by-default#102352 "My hikamarket user is uploading files for each product but they all get switched to &quot;non free download&quot; by default, and I don't see where to change this from the hikamarket side.  Can I configure all uploaded files to be &quot;Free download&quot; by default?")*

Hi,

In the file "components/com_hikamarket/controllers/product.php" replace Code:

$product_id = JRequest::getInt('product_id', 0); $file_type = JRequest::getVar('file_type', 'product');

By: Code:

$config = hikamarket::config(); $product_id = JRequest::getInt('product_id', 0); $file_type = JRequest::getVar('file_type', 'product');

And Code:

$params-&gt;file_free_download = false;

By: Code:

$params-&gt;file_free_download = $config-&gt;get('upload_file_free_download', false);

After that, you have to add a new entry in the table "hikamarket_config".
Open the url : "administrator/index.php?option=com_hikamarket&amp;ctrl=config&amp;task=sql" and use this query: Code:

INSERT INTO #__hikamarket_config (&#96;config_namekey&#96;,&#96;config_value&#96;,&#96;config_default&#96;) VALUES ('upload_file_free_download',1,1);

In the next version of HikaMarket, this option would be accessible directly in the backend configuration.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODEzOTItbWFrZS1maWxlLWZyZWUtZG93bmxvYWQtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[centerit](/forum/user/38346-centerit "View centerit's Profile")**
- [![centerit's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38346-centerit "View centerit's Profile")
- [ Offline](/forum/user/38346-centerit)

Less More

- Posts: 1
- Thank you received: 0
-
-

11 years 2 months ago [\#211573](#211573) by [centerit](/forum/user/38346-centerit "View centerit's Profile")  Replied by *[centerit](/forum/user/38346-centerit "View centerit's Profile")* on topic *[Make file Free download by default](/forum/23-market-how-to/81392-make-file-free-download-by-default#211573 "My hikamarket user is uploading files for each product but they all get switched to &quot;non free download&quot; by default, and I don't see where to change this from the hikamarket side.  Can I configure all uploaded files to be &quot;Free download&quot; by default?")*

Hi,

I want to ask you where can i find the option in the backend to make every file free for download by default? I import my products from a csv file. Or should i modify the code as you mentioned in your post.

Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODEzOTItbWFrZS1maWxlLWZyZWUtZG93bmxvYWQtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 2 months ago [\#211578](#211578) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Make file Free download by default](/forum/23-market-how-to/81392-make-file-free-download-by-default#211578 "My hikamarket user is uploading files for each product but they all get switched to &quot;non free download&quot; by default, and I don't see where to change this from the hikamarket side.  Can I configure all uploaded files to be &quot;Free download&quot; by default?")*

If you import the files, you can use the "files_free_download" column of your CSV in order to specify the value of the files during the import.
If you don't, the file is made as not "free download".
If you want to do it without having to specify the files_free_download column in your CSV, you would have to change the line:
$file-&gt;file_free_download = 0;
to:
$file-&gt;file_free_download = 1;
in the file administrator/components/com_hikashop/helpers/import.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODEzOTItbWFrZS1maWxlLWZyZWUtZG93bmxvYWQtYnktZGVmYXVsdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.136 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
