Jump to content

Using WHMCS Smarty Variables in a {PHP} Block


LordV

Recommended Posts

Hi, I'm doing a template for a friend running WHMCS and have never worked with it or Smarty before.

 

Basically I need to be able to get the subvariable name from {$product} (so {$product.name} from the product page). From here i will be putting the value through my own PHP script, but i need to know how to allow the use of the {$product.name} variable within a {PHP} block.

Link to comment
Share on other sites

While this is the long way, it will work.

{php}
global $smarty;
...
$product = $smarty->get_template_vars('product');
echo $product['name'];
{/php}

 

Thanks i might have to try this. The other option i guess would be to use all smarty commands, but this would put me more in home field.

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