web2008 Posted March 30, 2019 Share Posted March 30, 2019 In Standard Cart/sidebar-categories-collapsed.tpl the link to Register a New Doman "cart.php?a=add&domain=register" hardcoded. Does anyone know how to change this link to e.g domainchecker.php? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 30, 2019 Share Posted March 30, 2019 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'); } }); 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 30, 2019 Author Share Posted March 30, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 31, 2019 Share Posted March 31, 2019 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 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 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted March 31, 2019 Author Share Posted March 31, 2019 Again, thank you very much, Brian! I combined yours and my .TPL and now it works the way I wanted! 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.