Jump to content
web2008

Custom code configuredomains.tpl

Recommended Posts

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}

Share this post


Link to post
Share on other sites

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>

...

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by leemahoney3

Share this post


Link to post
Share on other sites

With these variables, the calendar does not work under Add Payment in the Admin Area.

Any idea what's missing?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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