Nyan Posted October 17, 2016 Share Posted October 17, 2016 I must set JPY and USD in Currencies for SSL Pligin for WHMCS. But I want to deal only JPY. I want to hide currency-related displays in ClientArea. Maybe currency-related displays are two places. I want to hide Register Currency. I think there is a way to use the Hook. Please tell me how to hide Register Currency. Any help would be greatly appreciated!! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 17, 2016 Share Posted October 17, 2016 the sidebar can be removed using a hook, check out the first post in the thread below... https://forum.whmcs.com/showthread.php?113791-Hiding-Currency-from-SideBar-Menu-how-to-hide-the-currency&p=461307#post461307 for complicated variations, read the entire thread - though probably unnecessary in your situation. for the client registration page, just edit clientregister.tpl and change... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/foreach} </select> </div> {/if} to... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} {if $curr.code eq 'JPY'} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/if} {/foreach} </select> </div> {/if} 0 Quote Link to comment Share on other sites More sharing options...
Nyan Posted October 18, 2016 Author Share Posted October 18, 2016 I appreciate your kindness. I can delete Register Currency in Register page and SideBar Menu. But It didn't work on responsive mode to SideBar Menu. I use WHMCS7.0.1. /templates/orderforms/standard_cart/sidebar-categories-collapsed.tpl <!--Delete Register Currency-- {if !$loggedin && $currencies} <div class="pull-right form-inline"> <form method="post" action="cart.php{if $action}?a={$action}{elseif $gid}?gid={$gid}{/if}"> <select name="currency" onchange="submit()" class="form-control"> <option value="">{$LANG.choosecurrency}</option> {foreach from=$currencies item=listcurr} <option value="{$listcurr.id}"{if $listcurr.id == $currency.id} selected{/if}>{$listcurr.code}</option> {/foreach} </select> </form> </div> {/if} --Delete Register Currency//--> /templates/six/clientregister.tpl <!--Delete Register Currency-- {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/foreach} </select> </div> {/if} --Delete Register Currency//--> /includes/hooks/RegisterCurrency.php <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function (MenuItem $secondarySidebar) { $secondarySidebar->removeChild('Choose Currency'); }); 0 Quote Link to comment Share on other sites More sharing options...
Nyan Posted October 18, 2016 Author Share Posted October 18, 2016 I am sorry. I was mistaken. It work on responsive mode to SideBar Menu. 0 Quote Link to comment Share on other sites More sharing options...
M. Rahman Posted May 21, 2021 Share Posted May 21, 2021 On 10/17/2016 at 4:05 PM, brian! said: the sidebar can be removed using a hook, check out the first post in the thread below... https://community.whmcs.com/showthread.php?113791-Hiding-Currency-from-SideBar-Menu-how-to-hide-the-currency&p=461307#post461307 for complicated variations, read the entire thread - though probably unnecessary in your situation. for the client registration page, just edit clientregister.tpl and change... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/foreach} </select> </div> {/if} to... {if $currencies} <div class="form-group"> <label for="currency" class="control-label">{$LANG.choosecurrency}</label> <select id="currency" name="currency" class="form-control"> {foreach from=$currencies item=curr} {if $curr.code eq 'JPY'} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/if} {/foreach} </select> </div> {/if} I want to apply this on the "twenty-one" template. It will work now? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 31, 2021 Share Posted May 31, 2021 On 21/05/2021 at 16:39, M. Rahman said: I want to apply this on the "twenty-one" template. It will work now? the hook should still work on any theme (though haven't checked). the ideas would still work on 21, but the code will be different depending on exactly what you want to do. 0 Quote Link to comment Share on other sites More sharing options...
crispy24 Posted July 5, 2021 Share Posted July 5, 2021 Hi, In the earlier versions of WHMCS I used a similar code from a post from the WHMCS community on the register and the checkout page (if the client would register on that page) to hide a currency and only let the clients choose a certain currency for invoicing, but in the 21 version in the child theme I can't seem to get it to work (I also tried in the parent theme and it didn't show up there either), but only in the checkout.tpl. In the normal register.tpl page it works with the first code below, which I used in the earlier versions of WHMCS. I tried putting the code where the custom fields show up on the page, at the top of the page, outside "if's" etc. but to no avail... The field won't show up whatever I try. I also cleared the template cache multiple times, but I don't know what I'm doing wrong. For example I'd want EUR as the only available option on the checkout registration page and these are two versions of the code that I used: {if $currencies} <div class="col-sm-6"> <label for="inputCurrency">Choose currency</label> <div class="form-group prepend-icon"> <label for="inputCurrency" class="field-icon"> <i class="far fa-money-bill-alt"></i> </label> <select id="inputCurrency" name="currency" class="field form-control"> {foreach $currencies as $curr} {if $curr.code eq 'EUR'} <option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option> {/if} {/foreach} </select> </div> </div> {/if} {if !$loggedin && $currencies} // I also tried without !@loggedin <div class="pull-right form-inline float-right"> <label for="inputCurrency" class="field-icon"> <i class="far fa-money-bill-alt"></i> </label> <select name="currency" id="inputCurrency" class="field form-control"> <option value="">{$LANG.choosecurrency}</option> {foreach from=$currencies item=listcurr} {if $listcurr.code eq 'EUR'} <option value="{$listcurr.id}"{if $listcurr.id == $currency.id} selected{/if}>{$listcurr.code}</option> {/if} {/foreach} </select> </div> {/if} Any ideas what I'm doing wrong/why it isn't working? Thank you 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.