Downloads suddenly stopped working

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
7 years 9 months ago #260270

-- url of the page with the problem -- : educationlaw.org
-- HikaShop version -- : 2.61
-- Joomla version -- : 2.59
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : An error occurred while processing this request.

I am moving this support thread to the forum. We have been communicating via e-mail. Our client operates a bookstore and has a small section selling e-books. These are shipped via a download link in the order confirmation e-mail. Two weeks ago for no obvious reason the download links being received by purchasers stopped working. The error message is: "An error occurred while processing this request." We were advised to update to the latest version of Hikashop. We did so but it broke the store and we had to revert. The latest version is not compatible with Joomla 2.59. We are stuck for now at that version because to update to the latest version of Joomla is a major undertaking which also will require updating of many other apps. It can't be done quickly.
To solve the problem now, we eventually were advised by Jerome that this appears to be an SEF issue. Joomla SEF for whatever reason decided to start modifying the native download link being generated by Hikashop. The native download link is fine. But it will have been subtly edited by Joomla SEF in the process of embedding it in the order confirmation e-mail. Jerome advised that "using a view override or email customization, it would be possible to change how the URL are generated." This could be an answer. We have asked for detail on how to implement it. In the meantime, has anyone else experienced this?
Thank you,
-Jim G.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #260272

Hi,

The links in the emails are generated in the preload section of the emails that you can find when you edit them via the menu System > Emails.

It's done by this code:

	if(empty($customer->user_cms_id))
		$file_pos .= '&email=' . $customer->user_email;
	$oid = $data->order_id;
	if(!empty($data->cart->order_parent_id))
		$oid = $data->cart->order_parent_id;
	$t .= '<a href="'.hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=download&file_id='.$file->file_id.'&order_id='.$oid.$file_pos.$url_itemid).'">'.$fileName.'</a><br/>';
You would have to change it to something like that:
	if(empty($customer->user_cms_id))
		$file_pos .= '?email=' . $customer->user_email;
	$oid = $data->order_id;
	if(!empty($data->cart->order_parent_id))
		$oid = $data->cart->order_parent_id;
	$t .= '<a href="'.hikashop_frontendLink('index.php?option=com_hikashop&ctrl=order&task=download&file_id='.$file->file_id.'&order_id='.$oid.$url_itemid).$file_pos.'">'.$fileName.'</a><br/>';
And that should fix the problem.
But you need to be sure to have the SEF activated, otherwise you will have two "?" in the URL and it won't be valid anymore.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 317
  • Thank you received: 20
  • Hikashop Business
7 years 9 months ago #260307

Thank you, Jerome. This looks promising. I will try it tomorrow and report back. Meanwhile, the client today approved the big Joomla update sometime in the next couple weeks. So hopefully we won't need this stopgap solution very long.
-Jim G.

Last edit: 7 years 9 months ago by jgribble.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum