Guest vivaigiochi Posted July 8, 2011 Share Posted July 8, 2011 i want add my a little php source into content.product.php but the source is'nt parsed (it's show on html page). but is content.product.php a php file or not? Quote Link to comment Share on other sites More sharing options...
Guest hennaboy Posted July 8, 2011 Share Posted July 8, 2011 CC5 uses smarty template engine. http://www.smarty.net/documentation Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 8, 2011 Share Posted July 8, 2011 my php code contain this: { this symbol is (i think) tha actual delimitator need to smarty. how i can change into my code? what is the substiture of { ? or i need thìo change the delimitator used from smarty? i can chance it on the fly and after change at the end of my code to return to {? SO AFTER MY SEARCH I KNOW: How to add PHP code to your Smarty Templates SolutionIf you would like to add php code to your smarty templates, you can do so by adding the {php} tag directly into your template. In this example, we will include an outside php script directly into our template {php} include('path/to/myscript.php'); {/php} You can also add custom PHP code into your templates, as long as you use the {php} tag. In the following example, we will use php code to print out the date... {php} echo(date("l dS \of F Y h:i:s A") . "<br />");{/php} For more information about the {php} tag, you can view the Smarty Manual Here BUT AT THIS TIME NON WORK WELL!!! CC5 uses smarty template engine. http://www.smarty.net/documentation Quote Link to comment Share on other sites More sharing options...
Guest hennaboy Posted July 8, 2011 Share Posted July 8, 2011 If you turned on debugging in your admin your will get this [Exception] /home/yourdirectory/public_html/includes/lib/smarty/plugins/block.php.php:21 - {php} is deprecated, set allow_php_tag = true to enable Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 8, 2011 Share Posted July 8, 2011 ok but what is the substitute to include miltiple line of php code contain the simbol {? If you turned on debugging in your admin your will get this [Exception] /home/yourdirectory/public_html/includes/lib/smarty/plugins/block.php.php:21 - {php} is deprecated, set allow_php_tag = true to enable Quote Link to comment Share on other sites More sharing options...
Guest hennaboy Posted July 8, 2011 Share Posted July 8, 2011 The solution would be to edit the class files or include files and add your code in there instead. Then refer to it in the template file Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 8, 2011 Share Posted July 8, 2011 thanks but i dont find what is the class or the include ok but what is the substitute to include miltiple line of php code contain the simbol {? If you turned on debugging in your admin your will get this [Exception] /home/yourdirectory/public_html/includes/lib/smarty/plugins/block.php.php:21 - {php} is deprecated, set allow_php_tag = true to enable Quote Link to comment Share on other sites More sharing options...
Guest hennaboy Posted July 8, 2011 Share Posted July 8, 2011 You need to determine where in the code you wish to add your own code. So main page , cart , admin , menu and so on. Then you can determine which class or included php file is the correct one to amend. Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 8, 2011 Share Posted July 8, 2011 i wrote that i need modify content.product.php but i seek into /class /lib /lib/smarty/...and so on but i dont find anything related with word product. what is? You need to determine where in the code you wish to add your own code. So main page , cart , admin , menu and so on. Then you can determine which class or included php file is the correct one to amend. Quote Link to comment Share on other sites More sharing options...
Guest hennaboy Posted July 9, 2011 Share Posted July 9, 2011 Well I dont see how anyone will be able to help you if you do not wish to say what your trying to do. Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 9, 2011 Share Posted July 9, 2011 it's simple at all!!!!!!! it's simple simple simple what i want. So have you seen the file content.product.php? it's the template to recreate the content of product info (where is the button add to basket). so i want substitute the string {$PRODUCT.description} with my own code to show the description field. BUT i have changed the line with my own php code source and nothing happen (list the source into the final html !!!!!!!! much bad!!!) if have delimited my source with several tags but it's not interpreted correctly by php..... In any case i have searched into other dir to find some include or class related to but nothing.... now you understand? i did not believe that is very difficult. but consider that i din't know smarty first of your suggestion. hovewer thanks. Well I dont see how anyone will be able to help you if you do not wish to say what your trying to do. Quote Link to comment Share on other sites More sharing options...
Homar Posted July 9, 2011 Share Posted July 9, 2011 See this bug report: http://bugs.cubecart.com/view.php?id=2677 Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 9, 2011 Share Posted July 9, 2011 /httpdocs/store/includes/lib/smarty/sysplugins/ modify smarty_security.php? or where i must write this line? $GLOBALS['smarty']->php_handling = Smarty::PHP_ALLOW See this bug report: http://bugs.cubecart.com/view.php?id=2677 Quote Link to comment Share on other sites More sharing options...
Guest vivaigiochi Posted July 11, 2011 Share Posted July 11, 2011 who know where i must write this line $GLOBALS['smarty']->php_handling = Smarty::PHP_ALLOW it 's related with php enable into smarty. /httpdocs/store/includes/lib/smarty/sysplugins/ modify smarty_security.php? or where i must write this line? $GLOBALS['smarty']->php_handling = Smarty::PHP_ALLOW See this bug report: http://bugs.cubecart.com/view.php?id=2677 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.