Jump to content

Hook to change existing Smarty variables


Recommended Posts

Dear all,

I tried the following hook to simply change $companyname but it does not work:

add_hook('ClientAreaPage', 1, function($vars) {
    global $smarty;
    $vars['companyname'] = 'Acme Ltd';
    $vars['companyname2'] = 'Acme Ltd';
    $smarty->assign('companyname', 'Acme Ltd');
    return $vars;
});

When using {debug}, $companyname2 is set to 'Acme Ltd', but $companyname is still set to the company name defined in WHMCS.

So I'd like to know if you know a way to change existing Smarty variables. $companyname is just an example, I want to do to more complicated stuff with WHMCS variables so please do not let me know how to change $companyname 😉

Thanks :)

Link to comment
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