Use a button for free downloads

  • Posts: 11
  • Thank you received: 0
10 years 1 month ago #174328

-- HikaShop version -- : 2.3.3

Hello.I want to use button at hikashop,for free download.but I dont know it.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
10 years 1 month ago #174396

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.

The following user(s) said Thank You: aran-rad

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
10 years 1 month ago #174708

Thanks to nice cooperation. :cheer:

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum