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

#   create task=showcart url with menu itemid

##

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

Less More

- Posts: 3
- Thank you received: 0
-
-

5 years 11 months ago [\#326084](#326084) by [grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")  *[create task=showcart url with menu itemid](/forum/31-development/901251-create-task-showcart-url-with-menu-itemid#326084 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.2 -- Browser(s) name and version -- : chrome  Hello, I am changing the lnk from cart module to go to showcart page instead of checkout. this is what I found in module:  Now this does take me to the cart page, but with itemid of menu item for the shop. But I have created menu item specifically for the cart page. Can I route this link to get the right itemid?  Thanks")* was created by *[grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")*

-- HikaShop version -- : 4.3
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.2
-- Browser(s) name and version -- : chrome

Hello,
I am changing the lnk from cart module to go to showcart page instead of checkout.
this is what I found in module: Code:

$link = hikashop_completeLink('cart&amp;task=showcart&amp;cart_id='.$this-&gt;element-&gt;cart_id.'&amp;cart_type='.$this-&gt;element-&gt;cart_type . $this-&gt;cart_itemid);

Now this does take me to the cart page, but with itemid of menu item for the shop.
But I have created menu item specifically for the cart page.
Can I route this link to get the right itemid?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMTI1MS1jcmVhdGUtdGFzay1zaG93Y2FydC11cmwtd2l0aC1tZW51LWl0ZW1pZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

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

5 years 11 months ago [\#326095](#326095) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[create task=showcart url with menu itemid](/forum/31-development/901251-create-task-showcart-url-with-menu-itemid#326095 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.2 -- Browser(s) name and version -- : chrome  Hello, I am changing the lnk from cart module to go to showcart page instead of checkout. this is what I found in module:  Now this does take me to the cart page, but with itemid of menu item for the shop. But I have created menu item specifically for the cart page. Can I route this link to get the right itemid?  Thanks")*

Hi,

Yes. You need to change $this-&gt;cart_itemid by '&amp;Itemid=xx' where xx is the id of the menu item you created for the cart page.

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

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

Less More

- Posts: 3
- Thank you received: 0
-
-

5 years 11 months ago [\#326125](#326125) by [grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")  Replied by *[grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")* on topic *[create task=showcart url with menu itemid](/forum/31-development/901251-create-task-showcart-url-with-menu-itemid#326125 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.2 -- Browser(s) name and version -- : chrome  Hello, I am changing the lnk from cart module to go to showcart page instead of checkout. this is what I found in module:  Now this does take me to the cart page, but with itemid of menu item for the shop. But I have created menu item specifically for the cart page. Can I route this link to get the right itemid?  Thanks")*

Thanks,
well this is obvious, but I do not want to add Itemid number manually, what if I change it tomorrow?
The routing is supposed to take Itemid (if such menu exists) automatically. This is what usually happens with joomla.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMTI1MS1jcmVhdGUtdGFzay1zaG93Y2FydC11cmwtd2l0aC1tZW51LWl0ZW1pZD90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

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

5 years 11 months ago -  5 years 11 months ago [\#326127](#326127) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[create task=showcart url with menu itemid](/forum/31-development/901251-create-task-showcart-url-with-menu-itemid#326127 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.2 -- Browser(s) name and version -- : chrome  Hello, I am changing the lnk from cart module to go to showcart page instead of checkout. this is what I found in module:  Now this does take me to the cart page, but with itemid of menu item for the shop. But I have created menu item specifically for the cart page. Can I route this link to get the right itemid?  Thanks")*

Hi,

There is no such mechanism as far as I know that auto detects which menu item to use.
Normally in Joomla, the links generated on a page uses the current menu item and that's it.
Automatically calculating the menu item to use would require a few dozen lines of code along with a MySQL query and it's not that easy. For example, the system would have to check if the menu item's access is available to the current user as the cart page menu item that might be created in the backend might be only for registered users, and you might be not logged in. And that's just one example of what needs to be checked. Another one would be the language issue.
That's why there are many menu item selection options to tell the system what menu item to use.
For example, you have the "force a menu on checkout" setting in the HikaShop configuration which allows you to select a menu item to use on the checkout.
And if you leave that setting empty, it will stay on the current menu item when reaching the checkout, even if you have a HikaShop checkout menu item created.
So to me it looks normal to have the menu item id in hard there. But you sure can write the few dozen of lines of code to search in the menu table of Joomla for the menu item to get its id and set it there dynamically. As a basis, you can check the code in the file administrator/components/com_hikashop/classes/menus.php where you'll find some functions we wrote to check the menu items and try to auto select them for some URLs generated in some places of HikaShop. For example to check that the menu item selected in the "force a menu on checkout" setting is a valid one we have the getCheckoutURL and loadAMenuItemId functions.

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

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

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

Less More

- Posts: 3
- Thank you received: 0
-
-

5 years 11 months ago [\#326164](#326164) by [grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")  Replied by *[grantissimo](/forum/user/60363-grantissimo "View grantissimo's Profile")* on topic *[create task=showcart url with menu itemid](/forum/31-development/901251-create-task-showcart-url-with-menu-itemid#326164 "-- HikaShop version -- : 4.3 -- Joomla version -- : 3.9.19 -- PHP version -- : 7.2 -- Browser(s) name and version -- : chrome  Hello, I am changing the lnk from cart module to go to showcart page instead of checkout. this is what I found in module:  Now this does take me to the cart page, but with itemid of menu item for the shop. But I have created menu item specifically for the cart page. Can I route this link to get the right itemid?  Thanks")*

I understand,
I thought there is a joomla routing function that does that..
I think I can manage to do this with sh404sef component.

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

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