Ragonz Posted August 7, 2019 Share Posted August 7, 2019 Good morning Along a similar line to Is it possible to remove the option for a client to use the upgrade/downgrade button to change product? We still need them to be able to use the upgrade/downgrade button to change configurable options but not the first section where they can change the product. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 7, 2019 Share Posted August 7, 2019 19 minutes ago, Ragonz said: Is it possible to remove the option for a client to use the upgrade/downgrade button to change product? We still need them to be able to use the upgrade/downgrade button to change configurable options but not the first section where they can change the product. three options that I can think of - any or all may be required depending on how thorough you want to be with this... primary sidebar hook to remove the "Upgrade/Downgrade" link from the actions sidebar - the code to do that will almost certainly have been posted previously. remove / change links in any of the templates to that page... e.g the cpanel overview.tpl page has coded links to the page you want to avoid, as has clientareaproductdetails.tpl too. use a ClientAreaPageUpgrade hook to redirect visitors sent to upgrade.php?type=package&id=x onto upgrade.php?type=configoptions&id=x (or elsewhere)... I think that would be doable and would make options 1 & 2 only required to ensure clarity to the user. 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted August 7, 2019 Author Share Posted August 7, 2019 I didnt even realize that there was a seperate option for options, shows how often I log in as a client... I'd be looking for option 1, I've had a search around and cant seem to find the code, Attempted to do it myself and ended up breaking WHMCS lol. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 7, 2019 Share Posted August 7, 2019 16 minutes ago, Ragonz said: I'd be looking for option 1, I've had a search around and cant seem to find the code, Attempted to do it myself and ended up breaking WHMCS lol. one way would be to tweak the hook in the thread below... that originally added icons to this sidebar, but we'll change it to remove children instead... <?php # Add Icons To Service Actions Sidebar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $ActionDetails = $primarySidebar->getChild("Service Details Actions"); if (empty($ActionDetails)) { return; } $ActionDetailsChildren = $ActionDetails->getChildren(); $kidsToIcon = array("Upgrade/Downgrade"); foreach($ActionDetailsChildren as $key => $Action_details_child) { if (in_array($key, $kidsToIcon)) { $ActionDetails->removeChild($key); } } }); 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted August 7, 2019 Author Share Posted August 7, 2019 Thats the one, cheers once again brian 👍 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted September 4, 2019 Author Share Posted September 4, 2019 So I'm not sure if it was the latest update or just somthing we have overlooked but the button highlighted takes users to where they can change the product as well, which needs to not do that and take them to the area they can change the configurable options instead. 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted September 4, 2019 Author Share Posted September 4, 2019 Sorted it, went into the templates clientareaproductdetails.tpl file and changed <a href="upgrade.php?type=package&id={$id}" to <a href="upgrade.php?type=configoptions&id={$id}" 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 4, 2019 Share Posted September 4, 2019 5 hours ago, Ragonz said: So I'm not sure if it was the latest update or just somthing we have overlooked but the button highlighted takes users to where they can change the product as well, which needs to not do that and take them to the area they can change the configurable options instead. it was option 2 on my list above.. 🙂 On 07/08/2019 at 10:45, brian! said: remove / change links in any of the templates to that page... e.g the cpanel overview.tpl page has coded links to the page you want to avoid, as has clientareaproductdetails.tpl too. 4 hours ago, Ragonz said: Sorted it, went into the templates clientareaproductdetails.tpl file and changed <a href="upgrade.php?type=package&id={$id}" to <a href="upgrade.php?type=configoptions&id={$id}" that will do it. 😎 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.