isixhosting Posted August 1, 2017 Share Posted August 1, 2017 Hi, I would like to change the name of the 'Store' category to 'Products'. Tried the hook provided on the developers page, but it didn't work. Can somebody help please? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 1, 2017 Share Posted August 1, 2017 just use a Language Override to change it - in your overrides file(s), add... $_LANG['navStore'] = "Products"; 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 1, 2017 Author Share Posted August 1, 2017 Thank you Brian, I have this in the override file, but it doesn't work: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); $_LANG['locale'] = "en_GB"; $_LANG['globalsystemname'] = "Home"; $_LANG['ordercategories'] = "Products"; $_LANG['knowledgebasecategories'] = "Knowledgebase"; $_LANG['navStore'] = "Products"; I use a custom template called 'Control' from the marketplace. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 1, 2017 Share Posted August 1, 2017 it works locally on the dev using "Six"... <?php $_LANG['navStore'] = "Products"; but if your custom template is using hooks to generate the menu (though it's possibly just a css/template change to make it vertical), then you could try the hook below and see if that changes it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->getChild('Store') ->setLabel('Products'); } }); if it doesn't, then you may need to contact the theme's developers for help. 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 1, 2017 Author Share Posted August 1, 2017 Thank you Brian. Doesn't work. I have contacted the template developer. Thanks 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 2, 2017 Author Share Posted August 2, 2017 So I'm back. Contacted the template developer, but he provided me with the same solutions like mentionted earlier - and it still doesn't change the category name from Store to Products. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 2, 2017 Share Posted August 2, 2017 i'm not overly convinced that there isn't a bug in their template code... that }"="" looks iffy to me... now perhaps it does something clever in the template, but it just looks wrong - the same error is in the demo and your site, so whether that's causing the language override and/or hook not to trigger, I don't know. you might need to go back to the developer about this - though there would be one quick test to try first... go to your WHMCS site and add cart.php?gid=1&systpl=six to the URL. that will allow you to see the site using the six template - now if the language override and/or hook is working, then "Store" will be renamed to whatever you want it to be (as per my previous image)... if it isn't, then something weird is going on. 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 2, 2017 Author Share Posted August 2, 2017 though there would be one quick test to try first... go to your WHMCS site and add cart.php?gid=1&systpl=six to the URL. that will allow you to see the site using the six template - now if the language override and/or hook is working, then "Store" will be renamed to whatever you want it to be (as per my previous image)... if it isn't, then something weird is going on. Hi Brian, no does nothing. Stll the 'Store' name... Also I tried to switch to SIX before as you mentionted, but nothing. I will forward your post to the developer again. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 2, 2017 Share Posted August 2, 2017 it's weird it doesn't work in Six... that means there's something else going on causing this unrelated to control... one last throw of the dice regarding control... what happens if you edit /includes/navbar-main.tpl and change ~line119... {$item->getLabel()} to {if $item->getLabel() eq 'Store'}Products{else}{$item->getLabel()}{/if} 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 2, 2017 Author Share Posted August 2, 2017 It's funy - I don't have the file '/includes/navbar-main.tpl' there. But I have a hook named 'product-categories-hook.php' and inside this: <?php use WHMCS\View\Menu\Item as MenuItem; use Illuminate\Database\Capsule\Manager as Capsule; add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { if (is_null($secondarySidebar->getChild('Categories'))) { $ProductGroups = Capsule::table('tblproductgroups') ->where('tblproductgroups.hidden', '0') ->select('order', 'id', 'name') ->get(); $secondarySidebar->addChild('Product Groups', array( 'label' => Lang::trans('ordercategories'), 'icon' => 'fa-shopping-cart', )); foreach ($ProductGroups as $row){ $secondarySidebar->getChild('Product Groups') ->addChild($row->name, array( 'label' => $row->name, 'uri' => 'cart.php?gid='.$row->id, 'order' => $row->order, )); } } }); I don't know if it's related to this issue... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 2, 2017 Share Posted August 2, 2017 It's funny - I don't have the file '/includes/navbar-main.tpl' there. not even at... /customer/templates/control/includes/navbar-main.tpl ?? But I have a hook named 'product-categories-hook.php' and inside this:I don't know if it's related to this issue... I recognise that hook.... https://forum.whmcs.com/showthread.php?126670-Product-categories-menu-on-other-pages&p=507202#post507202 it shouldn't be causing this issue as it's a sidebar, and your issue is with the navbar... you could rename it's extension to .php9 and that would disable it from loading. 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 2, 2017 Author Share Posted August 2, 2017 Ok, the file 'navbar-main.tpl' is present in the Control template. Now I changed it with your code and yes - it works! The developer wrote back with: I am aware of the syntax error in the navigation menu, we've just fixed this in our latest udpate which we're packaging at for present. I've attached the updated file which fixes this error, please replace the file control/includes/navbar-main.tpl with the attached updated version, however, it is unlikely that this will have any impact on the language variables or the issue at hand. Did you try the guidance supplied by WHMCS support? If you view your site with the default six theme as they suggested , I still see the "Store" menu item unchanged: xyz.com/customer/cart.php?gid=1&systpl=six Therefore this would suggest that the issue is not related to Control theme. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2017 Share Posted August 3, 2017 the developer is right in that there is an issue with your site if a hook/language override wouldn't even change the navbar in "Six".... chances are it will be another hook or addon taking precedence. so the template edit I gave you above is only a temporary fix until you resolve where the issue lies... once fixed, it shouldn't be necessary. 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 3, 2017 Author Share Posted August 3, 2017 the developer is right in that there is an issue with your site if a hook/language override wouldn't even change the navbar in "Six".... chances are it will be another hook or addon taking precedence. so the template edit I gave you above is only a temporary fix until you resolve where the issue lies... once fixed, it shouldn't be necessary. Uhh... I don't think I will find it out... I din't make any changes by myself as I'm really not familiar with the new WHMCS code and absolutely don't understand the hooks... And all addons I do have are official WHMCS market plugins or default built in addons in WHMCS package. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2017 Share Posted August 3, 2017 And all addons I do have are official WHMCS market plugins or default built in addons in WHMCS package. they're not "official" in the sense that WHMCS verify the products in Marketplace as working - they don't do that and probably never will... and just because they're from Marketplace, doesn't mean they're bug-free or tested to work in anything other than "Six"! you could try the include/hooks folder and see if there are any navbar hooks in there... or perhaps enable hook debug mode in setup -> general settings -> other and view the logs to see if that gives a clue... I suspect even if you contacted support about this, they'd tell you to disable the addons before they would even look at it. 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 3, 2017 Author Share Posted August 3, 2017 Ok, thank you Brian! 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted August 3, 2017 Author Share Posted August 3, 2017 Issue solved - I'm an idiot. I'm doing all code changes via Dreamweaver and changed files will be uploaded to the server automatically after saving via FTP. BUT - I chose the wrong upload folder in the FTP settings of Dreamweaver. That's it. Now all things are working as the language overriding as well. Thanks Brian! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2017 Share Posted August 3, 2017 i'm glad you solved the mystery! 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.