Jump to content

How to add parent menu item in sidebar


Recommended Posts

Hi everyone,

I have been configuring and testing my newly installed whmcs before releasing in production.

Now I have one problem here is that my clients can't change/choose currency in their client page. So I want to add "Choose currency" menu item in client page's sidebar. In order to do that I found that you need to use hook files.

But when I am searching, I just find topics about adding child item in parent menu item,  not about adding parent item.

Can't I just choose which menu item you want to show it to clients and add it on their sidebar? By choosing or configuring on my whmcs admin web, not on code level.

I am not a developer, and I have very little knowledge about API or php coding, so I need your help guys.

Any answer will be appreciated 🙂

 

Cheers

BR, Nyamkhand

Link to comment
Share on other sites

Hi @Nyamkhand

8 hours ago, Nyamkhand said:

Now I have one problem here is that my clients can't change/choose currency in their client page. So I want to add "Choose currency" menu item in client page's sidebar. In order to do that I found that you need to use hook files.

you have a bigger problem - in WHMCS, clients CANNOT change their currency (it's always been this way).. that's why when they are logged in, there is no currency sidebar shown for them to switch between currencies... if I ordered a service from your site, and I choose to pay in Mongolian tögrög, then all my future orders will be in tögrög - I can't decide tomorrow to order a product and pay in USD - I won't even see USD pricing... and even if you could fix it to show a currency sidebar, the tögrög will still be the client's selected currency in WHMCS.

if a client registers with you, and is assigned your default currency (i'm assuming tögrög) but hasn't yet made any orders... then you, as an admin, could change their currency to INR, USD or whatever without issue.

however, if they have already ordered in one currency, then even as an admin you should NOT change their currency - probably no need to go into the technical reasons, but basically currencies are assigned to clients, not to orders - so if a client makes an order worth 10000 tögrög, but then you change their currency to USD... that initial order will then appear to be $10,000 USD and not the 10,000MNT ($3.77USD) originally stored... so could cause all sorts of complications in the background when you try to calculate your income.

8 hours ago, Nyamkhand said:

But when I am searching, I just find topics about adding child item in parent menu item,  not about adding parent item.

they're basically the same - a parent item is just a orphan child item... if you know how to add a child item,  then you can add a parent item.... plenty of example hooks in this place that can do that - i've posted numerous currency sidebar hooks.

you could even add a currency selector to the header if you wanted to...

... but for the reasons i've stated above, it's only for those who are not logged in... even if you tweaked it to show for logged in clients, it would probably cause errors as WHMCS has other measures in place to prevent clients ordering in currencies that are not theirs.

8 hours ago, Nyamkhand said:

Can't I just choose which menu item you want to show it to clients and add it on their sidebar? By choosing or configuring on my whmcs admin web, not on code level.

no - this menu system was brought in when v6 was released in 2015 without any admin configuration options - and in the 4 years since, they haven't added any admin options to modify it. 🙄

effectively, you have two options...

  1. use action hooks to modify/create/delete the navbar and sidebars.... it sounds like you've already found the documentation on that, and i've posted hundreds (or seems like it!) of working hooks over the last few years.
  2. buy a third-party addon from Marketplace - there are a few available, e.g Advanced Menu Manager (though they tend to focus on the navbar rather than the sidebars.
8 hours ago, Nyamkhand said:

I am not a developer, and I have very little knowledge about API or php coding, so I need your help guys.

for the specific issue of wanting clients to be able to change currencies (or order in different currencies), there is probably little you can do - any realistic solution would be very complicated.

Link to comment
Share on other sites

Hello Brian,

Thank you very much for your very detailed response.

I understand now.

I've set client's default currency to MNT again and saved the profile. Now everything on clients page is in MNT.

Somehow clients profile wasn't set properly before, I think.

BR, Nyamkhand 

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated