Jump to content

How to move 'choose Currency" at top of sidebar in whmcs


cumputerman

Recommended Posts

How to move 'Choose Currency" (Secondarysidebar item) to the top of PrimarySidebar (secondarySidebar) in whmcs. I have created this hook but then i am unable to open pages where SecondaySidebar is not present by default. 'Choose currency" can be seen at bottom of this page https://www.seimaxim.com/cart.php?gid=12

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar)
   {
 $ChooseCurrency = $secondarySidebar->getChild('Choose Currency');

    // Move the panel to the end of the sorting order so it's always displayed
    // as the last panel in the sidebar.
    $ChooseCurrency->moveToFront();


});
-----

Thanks.

Link to comment
Share on other sites

18 hours ago, cumputerman said:

How to move 'Choose Currency" (Secondarysidebar item) to the top of PrimarySidebar (secondarySidebar) in whmcs.

if you had to do that, then it would take some effort... but fortunately you don't have to because the Cart doesn't use Primary sidebars... therefore, you should just need to set the order value of the "Choose Currency" sidebar to zero.

<?php

# Move Choose Currency Sidebar To The Top
# Written by brian!

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) {
	
	if (!is_null($secondarySidebar->getChild('Choose Currency'))) {
		    $secondarySidebar->getChild('Choose Currency')
			->setOrder('0');
	}
}); 

as an aside, if you ever wanted to move the currency selector to the header, then I posted how to do that in the thread below... last checked on v7.3, but it should still work on later versions.

zvetFVc.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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