Ability to download files from the product page after ordering

  • Posts: 325
  • Thank you received: 13
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Subscription Hikashop Business
2 months 2 weeks ago #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.

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

  • Posts: 2161
  • Thank you received: 290
  • MODERATOR
2 months 1 week ago #305732

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

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

  • Posts: 325
  • Thank you received: 13
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Subscription Hikashop Business
2 weeks 22 hours ago #307435

Hi, is there a way to take $file->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 or Create an account to join the conversation.

  • Posts: 66037
  • Thank you received: 9666
  • MODERATOR
2 weeks 11 hours ago #307443

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

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

  • Posts: 325
  • Thank you received: 13
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Subscription Hikashop Business
2 weeks 11 hours ago #307455

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

<?php
	$this->setLayout('show_block_product_files');
	echo $this->loadTemplate();
?>

I want to ask what is the value of $ids in
$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->user_id . ' '.
'AND op.product_id IN (' . implode(',', $ids) . ') '.
'AND o.order_status IN (' . implode(',', $statuses) . ')';
$db->setQuery($query);
$orders = $db->loadObjectList('order_id');

Last edit: 2 weeks 6 hours ago by neo191987.

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

  • Posts: 66037
  • Thank you received: 9666
  • MODERATOR
2 weeks 2 hours ago #307457

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: 2 weeks 6 hours ago by nicolas.
The following user(s) said Thank You: neo191987

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

Time to create page: 0.063 seconds
Powered by Kunena Forum