Jump to content

Link Sidebar


web2008

Recommended Posts

2 hours ago, web2008 said:

Does anyone know how to change this link to e.g domainchecker.php?

I should add that for anyone using the Six template, then domainchecker.php basically redirects back to cart.php?a=add&domain=register anyway, so changing the link for them would have limited use.

however, as you're using a custom theme, that may not apply...

<?php

# Change Domain Registration Sidebar Link Hook
# Written by brian!

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar)
{
	$actions = $secondarySidebar->getChild('Actions');
	if (empty($actions)) {
		return;
	}
	if (!is_null($actions->getChild('Domain Registration'))) {
		$actions->getChild('Domain Registration')->setURI('domainchecker.php');
	}
});
Link to comment
Share on other sites

Thank you very much, brian!

Sorry, it might be a bad example to call the file to be redirected to domainchecker.php, so we can call it something else, since I also have a RewriteRule in htaccess.

But whatever,  the hook does not work and sidebar-categories-collapsed.tpl from Six and my custom only have design differences after what I can see.

Link to comment
Share on other sites

17 hours ago, web2008 said:

But whatever,  the hook does not work and sidebar-categories-collapsed.tpl from Six and my custom only have design differences after what I can see.

it works 100% using Six & Standard_cart on both my dev and your live site (when I switch it to use Six & SC)... that link is definitely now pointing to domainchecker.php and not to cart.php?a=add&domain=register

s6pJ08Q.png

but I now see that i'm answering the wrong question! 🙄

now the thing about your custom theme and custom version of standard_cart v4 is that it doesn't show any true sidebars in the cart, so sidebar hooks are irrelevant and it's going to be a Smarty / jQuery issue... as you say, that link is hardcoded (as is the transfer link too)... perhaps you can change the specific URL with jQuery, or certainly by rewriting the entire onchange dropdown that switches the URL...

i've attached a modified sidebar-categories-collapsed.tpl template from SC v7.7.1 where i've modified the cart links (the renewals link might need playing with for your settings), but it should work (and does locally for me)...

sidebar-categories-collapsed.tpl

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.

×
×
  • 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