- Posts: 11
- Thank you received: 0
Use a button for free downloads
11 years 11 months ago #174328
by aran-rad
Use a button for free downloads was created by aran-rad
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174396
by nicolas
Replied by nicolas on topic Use a button for free downloads
Hi,
To add a free download file to you products, simply check the "free download" checkbox, when you upload your files in your product edition screen under the "Files" area.
If you want to change the link so that it is a button instead of a link, as our tutorial explains, you need to edit the file "show_block_product_files" via the menu Display>Views and change the code there.
The modification is actually quite easy.
Change the line:
$fileHtml = '<a class="hikashop_product_file_link" href="' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '">' . $file->file_name . '</a><br/>';
to:
$fileHtml = '<input type="button" onclick="window.location=\'' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '\'" value="' . $file->file_name . '"/><br/>';
and that should do it.
To add a free download file to you products, simply check the "free download" checkbox, when you upload your files in your product edition screen under the "Files" area.
If you want to change the link so that it is a button instead of a link, as our tutorial explains, you need to edit the file "show_block_product_files" via the menu Display>Views and change the code there.
The modification is actually quite easy.
Change the line:
$fileHtml = '<a class="hikashop_product_file_link" href="' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '">' . $file->file_name . '</a><br/>';
to:
$fileHtml = '<input type="button" onclick="window.location=\'' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '\'" value="' . $file->file_name . '"/><br/>';
and that should do it.
The following user(s) said Thank You: aran-rad
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174708
by aran-rad
Replied by aran-rad on topic Use a button for free downloads
Thanks to nice cooperation.
Please Log in or Create an account to join the conversation.
Time to create page: 0.194 seconds