Jump to content

Smarty Error


DigitalEnigma

Recommended Posts

Hi,

 

I have been trying to add some code that replaces the text entry for the expiry year on cards with a drop down for the client to select from.

 

When I add the code the creditcard.php page fails to load, with error display enabled I get the following error:

 

Fatal error: Smarty error: [in /home/********/public_html/development/templates/portal/creditcard.tpl line 113]: syntax error: unrecognized tag 'html_options' (Smarty_Compiler.class.php, line 590) in /home/********/public_html/development/includes/smarty/Smarty.class.php on line 1093

 

Any one any idea why smarty is not liking the html_option tag?

Link to comment
Share on other sites

Hi,

 

As a test I removed my code and put in code from the smarty manual, results in the same error. The code from there I had entered in the template was as follows:-

 

{php}
$smarty->assign('myOptions', array(
                               1800 => 'Joe Schmoe',
                               9904 => 'Jack Smith',
                               2003 => 'Charlie Brown')
                               );
$smarty->assign('mySelect', 9904);
{/php}

{html_options name=foo options=$myOptions selected=$mySelect}

Link to comment
Share on other sites

I see that the function.html_options.php file isn't included in the default WHMCS installation. You can just get it from the original Smarty package and place it in the /includes/smarty/plugins/ folder.

Link to comment
Share on other sites

look closer at the error

unrecognized tag 'html_options'
check in the includes/smarty/plugins directory for function.html_options.php

It's attached here if its missing (rename it by removing the .txt)

also change $smarty to $this or add global $smarty; just under the {php}

 

 

EDIT: Looks like I took too long to post

function.html_options.php.txt

Edited by sparky
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