web2008 Posted August 6, 2022 Share Posted August 6, 2022 Hello, I had a custom code in configuredomains.tpl that doesn't work anymore. Is there someone who can help? {if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if} 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 8, 2022 Share Posted August 8, 2022 Hi there, You need to add the following to your configuration.php file due to the Smarty Security Policy (https://docs.whmcs.com/Smarty_Security_Policy). $smarty_security_policy = [ 'system' => [ 'enabled_special_smarty_vars' => [ 'session' ], ] ]; Make sure to put your code in the {foreach $domains as $num => $domain} loop for it to work as it references $num e.g. {foreach $domains as $num => $domain} <div class="sub-heading"> <span class="primary-bg-color">{$domain.domain} ({if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if})</span> </div> ... 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 9, 2022 Author Share Posted August 9, 2022 Hi, Thanks for the help! When I add the code to configuration.php I get a blank Shopping cart. Any idea what could be causing this? 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 9, 2022 Share Posted August 9, 2022 Strange, if you remove your code from the smarty template, does the white screen remain? What version of WHMCS are you running? 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 10, 2022 Author Share Posted August 10, 2022 If I add the Smarty Security Policy code to configuration.php the Shpping Cart only show header and footer. I use WHMCS version 8.5.1 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 10, 2022 Share Posted August 10, 2022 (edited) Sorry, I meant if you remove the following from your configuredomains.tpl file, does the same issue occur {if $smarty.session.cart.domains.{$num}.type eq "transfer"}This is a transfer!!!!!{elseif $smarty.session.cart.domains.{$num}.type eq "register"}This is a new registration!!!{/if} If so, do you have any other custom code in that template or any other modules or hooks that may be conflicting with the security policy? Perhaps you may need to add more variables to the security policy such as $smarty_security_policy = [ 'system' => [ 'enabled_special_smarty_vars' => [ 'session', 'cookies', 'server' ] ] ]; You may need to play around with it, more details can be found at https://docs.whmcs.com/Smarty_Security_Policy Edited August 10, 2022 by leemahoney3 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 10, 2022 Author Share Posted August 10, 2022 Thank you very much, now it works when I add the variables you suggested ! 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 13, 2022 Author Share Posted August 13, 2022 With these variables, the calendar does not work under Add Payment in the Admin Area. Any idea what's missing? 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 13, 2022 Author Share Posted August 13, 2022 When I add 'now' the calendar works. 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.