- Posts: 640
- Thank you received: 16
Make file Free download by default
- PeterChain
-
Topic Author
- Offline
Less
More
13 years 4 months ago #102335
by PeterChain
Make file Free download by default was created by PeterChain
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?
Can I configure all uploaded files to be "Free download" by default?
Please Log in or Create an account to join the conversation.
13 years 4 months ago #102352
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Make file Free download by default
Hi,
In the file "components/com_hikamarket/controllers/product.php" replace
By:
And
By:
After that, you have to add a new entry in the table "hikamarket_config".
Open the url : "administrator/index.php?option=com_hikamarket&ctrl=config&task=sql" and use this query:
In the next version of HikaMarket, this option would be accessible directly in the backend configuration.
Regards,
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');
Code:
$config = hikamarket::config();
$product_id = JRequest::getInt('product_id', 0);
$file_type = JRequest::getVar('file_type', 'product');
Code:
$params->file_free_download = false;
Code:
$params->file_free_download = $config->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&ctrl=config&task=sql" and use this query:
Code:
INSERT INTO #__hikamarket_config (`config_namekey`,`config_value`,`config_default`) 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 & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain
Please Log in or Create an account to join the conversation.
11 years 1 month ago #211573
by centerit
Replied by centerit on topic Make file Free download 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!
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 or Create an account to join the conversation.
11 years 1 month ago #211578
by nicolas
Replied by nicolas on topic Make file Free download 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->file_free_download = 0;
to:
$file->file_free_download = 1;
in the file administrator/components/com_hikashop/helpers/import.php
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->file_free_download = 0;
to:
$file->file_free_download = 1;
in the file administrator/components/com_hikashop/helpers/import.php
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.202 seconds