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

#   Link to order in email

##

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

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329440](#329440) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  *[Link to order in email](/forum/26-product-category-display/901901-link-to-order-in-email#329440 "-- 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&#95;HEADER&#95;URL}  But where can I change that?  Kind regards Thomas")* was created by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")*

-- 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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDE5MDEtbGluay10by1vcmRlci1pbi1lbWFpbC8zMjk0NDc/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: 86583
- Thank you received: 14324
-
-

5 years 9 months ago [\#329447](#329447) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Link to order in email](/forum/26-product-category-display/901901-link-to-order-in-email#329447 "-- 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&#95;HEADER&#95;URL}  But where can I change that?  Kind regards Thomas")*

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: Code:

global $Itemid; $url = ''; if(!empty($Itemid)) $url='&amp;Itemid='.$Itemid; if(isset($order-&gt;url_itemid)) $url = (!empty($order-&gt;url_itemid) ? '&amp;Itemid=':'') . $order-&gt;url_itemid; if((empty($order-&gt;customer-&gt;user_cms_id) &#124;&#124; (int)$order-&gt;customer-&gt;user_cms_id == 0) &amp;&amp; !empty($order-&gt;order_token)) { $url .= '&amp;order_token='.urlencode($order-&gt;order_token); } $order-&gt;order_url = hikashop_contentLink('order&amp;task=show&amp;cid[]='.$order-&gt;order_id.$url, $order, false, false, false, true);

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.

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

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

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329481](#329481) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Link to order in email](/forum/26-product-category-display/901901-link-to-order-in-email#329481 "-- 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&#95;HEADER&#95;URL}  But where can I change that?  Kind regards Thomas")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDE5MDEtbGluay10by1vcmRlci1pbi1lbWFpbC8zMjk0NDc/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: 86583
- Thank you received: 14324
-
-

5 years 9 months ago [\#329499](#329499) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Link to order in email](/forum/26-product-category-display/901901-link-to-order-in-email#329499 "-- 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&#95;HEADER&#95;URL}  But where can I change that?  Kind regards Thomas")*

Hi,

Edit, the email via the menu System&gt;Emails, and at the beginning of the preload section, add such line of code: Code:

&lt;?php if((empty($data-&gt;customer-&gt;user_cms_id) &#124;&#124; (int)$data-&gt;customer-&gt;user_cms_id == 0) &amp;&amp; !empty($data-&gt;order_token)) { $url .= '&amp;order_token='.urlencode($data-&gt;order_token); } $data-&gt;order_url = hikashop_contentLink('order&amp;task=show&amp;cid[]='.$order-&gt;order_id.$url.'&amp;Itemid=XX', $order, false, false, false, true); ?&gt;

where XX is the id of the menu item you want to use.

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

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

Less More

- Posts: 366
- Thank you received: 26
-
-

5 years 9 months ago [\#329514](#329514) by [Thrane](/forum/user/31786-thrane "View Thrane's Profile")  Replied by *[Thrane](/forum/user/31786-thrane "View Thrane's Profile")* on topic *[Link to order in email](/forum/26-product-category-display/901901-link-to-order-in-email#329514 "-- 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&#95;HEADER&#95;URL}  But where can I change that?  Kind regards Thomas")*

Thanks, will have a look ![:-)](/media/kunena/emoticons/3.png ":-)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDE5MDEtbGluay10by1vcmRlci1pbi1lbWFpbC8zMjk0NDc/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.052 seconds

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