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

#   Ability to download files from the product page after ordering

##

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 7 months ago [\#305713](#305713) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#305713 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")* was created by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")*

-- HikaShop version -- : 4.0.3

Hi,
I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

7 years 7 months ago [\#305732](#305732) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#305732 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Hello,

Your feature is a good one ! We are going to think about our idea and his integration, how to proceed etc...
Thanks for your suggestion !

Regards

The following user(s) said Thank You: [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")

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

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 5 months ago [\#307435](#307435) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  Replied by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#307435 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Hi, is there a way to take $file-&gt;download_link in listing_img_title. I want to generate the download address in both cases for free and paid files so I can integrate an audio player.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTczMDEtYWJpbGl0eS10by1kb3dubG9hZC1maWxlcy1mcm9tLXRoZS1wcm9kdWN0LXBhZ2UtYWZ0ZXItb3JkZXJpbmc/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

7 years 5 months ago [\#307443](#307443) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#307443 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Hi,

The files of products are not loaded on the listings. You would first need to run a MySQL query on the hikashop_file table to load the files of the product before you could generate the download link similarily to what's done on the product page. So it's possible, but it's not that simple. Especially for paid downloads where you need to run more MySQL queries to check the orders of the current user.

The following user(s) said Thank You: [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")

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

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 5 months ago -  7 years 5 months ago [\#307455](#307455) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  Replied by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#307455 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Thanks for the reply. I have another idea before I start doing this. Can I insert the view through this code? Code:

&lt;?php $this-&gt;setLayout('show_block_product_files'); echo $this-&gt;loadTemplate(); ?&gt;

I want to ask what is the value of $ids in Code:

$query = 'SELECT * FROM #__hikashop_order_product as op '. 'LEFT JOIN #__hikashop_order AS o ON op.order_id = o.order_id '. 'LEFT JOIN #__hikashop_product AS p ON op.product_id = p.product_id '. 'WHERE o.order_user_id = ' . $user-&gt;user_id . ' '. 'AND op.product_id IN (' . implode(',', $ids) . ') '. 'AND o.order_status IN (' . implode(',', $statuses) . ')'; $db-&gt;setQuery($query); $orders = $db-&gt;loadObjectList('order_id');

Last edit: 7 years 5 months ago by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTczMDEtYWJpbGl0eS10by1kb3dubG9hZC1maWxlcy1mcm9tLXRoZS1wcm9kdWN0LXBhZ2UtYWZ0ZXItb3JkZXJpbmc/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

7 years 5 months ago -  7 years 5 months ago [\#307457](#307457) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#307457 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Hi,

You can but it won't do anything. This view file requires that the files data is already loaded before it can display it. So again, you'll have to run MySQL queries to be able to do that.

$ids there is an array of ids of products.

Last edit: 7 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

The following user(s) said Thank You: [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")

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

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

Less More

- Posts: 432
- Thank you received: 22
-

2 years 6 months ago [\#360848](#360848) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#360848 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

> Philip wrote: Hello,
>
> Your feature is a good one ! We are going to think about our idea and his integration, how to proceed etc...
> Thanks for your suggestion !
>
> Regards

Philip, have you done some thinking about that?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTczMDEtYWJpbGl0eS10by1kb3dubG9hZC1maWxlcy1mcm9tLXRoZS1wcm9kdWN0LXBhZ2UtYWZ0ZXItb3JkZXJpbmc/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

2 years 6 months ago [\#360856](#360856) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#360856 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

Hi,

Yes. This capability was added to HikaShop a while back.
You just have to activate the setting "Purchased file download on product page" of the HikaShop configuration page.

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

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

Less More

- Posts: 432
- Thank you received: 22
-

2 years 6 months ago [\#360901](#360901) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Ability to download files from the product page after ordering](/forum/50-feature-request/897301-ability-to-download-files-from-the-product-page-after-ordering#360901 "-- HikaShop version -- : 4.0.3  Hi, I have an idea, I do not know if you will like it or it can be realized. I think it will be more convenient for you to be able to download the files on the product page after the purchase of a product, as in the free files. This will allow for easier integration for selling audio and video that require them to appear directly on the product page.")*

It realy is. Thank you.
Now we can improve this. So instead of download link to show file preview. Or both.

I sell mp3 and dont want customer downloads the file. I made override in show_block_product_files with Code:

$files[] = '&lt;a'.$attributes.' class="hikashop_product_file_link d-none" href="' . $file-&gt;download_link . '"&gt;' . $file-&gt;file_name . '&lt;/a&gt;&lt;br/&gt;&lt;audio controls&gt;&lt;source src="' . $file-&gt;download_link . '" type="audio/mpeg"&gt;Your browser does not support the audio element.&lt;/audio&gt;';

Same can be done for video, pdf ... It would be realy great addition to Hikashop.

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTczMDEtYWJpbGl0eS10by1kb3dubG9hZC1maWxlcy1mcm9tLXRoZS1wcm9kdWN0LXBhZ2UtYWZ0ZXItb3JkZXJpbmc/dG1wbD1tYXJrZG93bg==) 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?

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

Time to create page: 0.078 seconds

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