Jump to content

Hook to High "Change Password" in Product Details


dpgthing

Recommended Posts

8 hours ago, dpgthing said:

Hello, I'm looking to make a hook to hide the "Change Password" button on the sidebar in the client area when they view their product details.

if all you want to do is hide it for everyone, e.g you don't need to use conditions based on other factors such as products, you could add the code below to your custom.css file and that would hidee the sidebar child...

#Primary_Sidebar-Service_Details_Actions-Change_Password { display: none; }

if you really want to use a hook...

<?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 = ["Change Password"];
	foreach($ActionDetailsChildren as $key => $Action_details_child) {
		if (in_array($key, $kidsToIcon)) {
			$ActionDetails->removeChild($key);
		}
	}
});
Link to comment
Share on other sites

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