Jump to content

Disable Product Change


Ragonz

Recommended Posts

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.

 

Link to comment
Share on other sites

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

  1. 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.
    luEU8UB.png
  2. 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.
  3. 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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);
		}
	}
});

W007SYI.png

Link to comment
Share on other sites

  • 4 weeks later...

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.

Screenshot 2019-09-04 10.23.58.png

Link to comment
Share on other sites

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&amp;id={$id}"  to <a href="upgrade.php?type=configoptions&amp;id={$id}"

that will do it. 😎

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