Jump to content

content.product.php is php or?


Guest vivaigiochi

Recommended Posts

Guest vivaigiochi

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?

Link to comment
Share on other sites

Guest vivaigiochi

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

Link to comment
Share on other sites

Guest hennaboy

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

Link to comment
Share on other sites

Guest vivaigiochi

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

Link to comment
Share on other sites

Guest hennaboy

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

Link to comment
Share on other sites

Guest vivaigiochi

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

Link to comment
Share on other sites

Guest hennaboy

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.

Link to comment
Share on other sites

Guest vivaigiochi

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.

Link to comment
Share on other sites

Guest vivaigiochi

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.

Link to comment
Share on other sites

Guest vivaigiochi

/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

Link to comment
Share on other sites

Guest vivaigiochi

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

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.

×
×
  • Create New...