- Posts: 366
- Thank you received: 26
Link to order in email
5 years 7 months ago #329440
by Thrane
Link to order in email was created by Thrane
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4
Hi
My frontpage has no area for a component, so the order link in the emails to my customers fails.
I see the link is from this in the emails:
{VAR:TPL_HEADER_URL}
But where can I change that?
Kind regards
Thomas
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4
Hi
My frontpage has no area for a component, so the order link in the emails to my customers fails.
I see the link is from this in the emails:
{VAR:TPL_HEADER_URL}
But where can I change that?
Kind regards
Thomas
Please Log in or Create an account to join the conversation.
5 years 7 months ago #329447
by nicolas
Replied by nicolas on topic Link to order in email
Hi,
Well, it depends.
First, normally, HikaShop uses the current menu item.
So if the email is sent when the order is created on the checkout, it will take the menu item used for the checkout, and thus you shouldn't have the problem.
Similarily, for the email sent when the order is confirmed automatically by a payment plugin, it uses the menu item of the checkout.
So you shouldn't have a problem here either.
But for the same emails, you could have a problem with the "preview" button, since the preview is generated in the backend, or if you manually change the status of the order in the backend.
So the first question is where are the emails generated. You might be thinking that the links have a wrong menu item because you're testing the links generated from the preview while it might actually work fine as your customers get the emails generated from the checkout, with a correct menu item.
The link you get in TPL_HEADER_URL is generated in the file administrator/components/com_hikashop/classes/order.php with the code:
So you could theoretically force it there.
But I would rather recommend to have an area for a component on your homepage and configure its menu item to be of a type not displaying anything. For example an empty joomla article.
Well, it depends.
First, normally, HikaShop uses the current menu item.
So if the email is sent when the order is created on the checkout, it will take the menu item used for the checkout, and thus you shouldn't have the problem.
Similarily, for the email sent when the order is confirmed automatically by a payment plugin, it uses the menu item of the checkout.
So you shouldn't have a problem here either.
But for the same emails, you could have a problem with the "preview" button, since the preview is generated in the backend, or if you manually change the status of the order in the backend.
So the first question is where are the emails generated. You might be thinking that the links have a wrong menu item because you're testing the links generated from the preview while it might actually work fine as your customers get the emails generated from the checkout, with a correct menu item.
The link you get in TPL_HEADER_URL is generated in the file administrator/components/com_hikashop/classes/order.php with the code:
Code:
global $Itemid;
$url = '';
if(!empty($Itemid))
$url='&Itemid='.$Itemid;
if(isset($order->url_itemid))
$url = (!empty($order->url_itemid) ? '&Itemid=':'') . $order->url_itemid;
if((empty($order->customer->user_cms_id) || (int)$order->customer->user_cms_id == 0) && !empty($order->order_token)) {
$url .= '&order_token='.urlencode($order->order_token);
}
$order->order_url = hikashop_contentLink('order&task=show&cid[]='.$order->order_id.$url, $order, false, false, false, true);
But I would rather recommend to have an area for a component on your homepage and configure its menu item to be of a type not displaying anything. For example an empty joomla article.
Please Log in or Create an account to join the conversation.
5 years 7 months ago #329481
by Thrane
Replied by Thrane on topic Link to order in email
Hi
Thanks for explaining, but I'm not quite sure I understand.
I have tested the link in the email sent to the customer, not from the backend - and still just get the frontpage, not the order it self.
I would to rather have the menu item, but I'm not sure what I have to do to achieve this.
/Thomas
Thanks for explaining, but I'm not quite sure I understand.
I have tested the link in the email sent to the customer, not from the backend - and still just get the frontpage, not the order it self.
I would to rather have the menu item, but I'm not sure what I have to do to achieve this.
/Thomas
Please Log in or Create an account to join the conversation.
5 years 7 months ago #329499
by nicolas
Replied by nicolas on topic Link to order in email
Hi,
Edit, the email via the menu System>Emails, and at the beginning of the preload section, add such line of code:
where XX is the id of the menu item you want to use.
Edit, the email via the menu System>Emails, and at the beginning of the preload section, add such line of code:
Code:
<?php
if((empty($data->customer->user_cms_id) || (int)$data->customer->user_cms_id == 0) && !empty($data->order_token)) {
$url .= '&order_token='.urlencode($data->order_token);
}
$data->order_url = hikashop_contentLink('order&task=show&cid[]='.$order->order_id.$url.'&Itemid=XX', $order, false, false, false, true); ?>
Please Log in or Create an account to join the conversation.
5 years 7 months ago #329514
by Thrane
Replied by Thrane on topic Link to order in email
Thanks, will have a look
Please Log in or Create an account to join the conversation.
Time to create page: 0.203 seconds