- Posts: 22
- Thank you received: 0
Add file for download on product page
- Nikajoloem
-
Topic Author
- Offline
I'm trying to add a file for download, visible on the product page for all site visitors (so not linked to a purchase).
Can this be done through custom fields or in any other way? I can't seem to find the solution...
Please Log in or Create an account to join the conversation.
You can just upload the file via the joomla media manager and then add a link to it in the description of the product.
Please Log in or Create an account to join the conversation.
- Nikajoloem
-
Topic Author
- Offline
- Posts: 22
- Thank you received: 0
I'm uploading hundreds of products through csv.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
function download(){
$file_id = JRequest::getInt('file_id');
if(!$file_id){ return false; }
$fileClass = hikashop::get('class.file');
$fileClass->download($file_id);
return true;
}
(you also need to add that function name in the display array. Then, you can use the url :...ctrl=product&task=download&file_id=XX
but you will have to modify the function download of the file administrator/components/com_hikashop/classes/file.php in order to check if the file requested is attached to a product as a "public" file before authorizing the download for security reasons.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I started looking at it but didn't had much time yet. I'll try to integrate your changes in HikaShop. On a first look, it's seems to be exactly how I was seeing it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Once I realized this, I began making sure to check the free option yet most of my products show no files. Any ideas?
I'd be glad to share login info if wanted.
Please Log in or Create an account to join the conversation.
Could you give an access to your back end so that we can check a product where it doesn't work ?
Please Log in or Create an account to join the conversation.
Also, where would I look to change the default for files to free? We will never sell files on this site, only use them for manuals.
BTW, thanks for the quick responses. It's so unusual to actually get help without waiting days. It's one of the reasons I went with HikaShop over Tienda.
Please Log in or Create an account to join the conversation.
If you want to set it to free by default, you need to edit the file selectfile via the menu Display->Views and add the line:
<?php if(!isset($this->element->file_free_download)) $this->element->file_free_download = 1; ?>
before the line:
<?php echo JHTML::_('select.booleanlist', "data[file][file_free_download]" , '',@$this->element->file_free_download ); ?>
Please Log in or Create an account to join the conversation.
Since I don't want to edit the default pages, what do I need to do to make this change in an override page?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.