Jump to content

PHP in site document.


Recommended Posts

This is the code, it is a much more sophisticated contact form that I have been using on my old site.


$contact_form = 1; // set desired form number.

$contact_form_path = '/var/www/vhosts/mysite.com/httpdocs/contact-files/'; // set path to /contact-files/ with slash on end.

require $contact_form_path . 'contact-form-run.php';


Thank you.

Link to comment
Share on other sites

You are probably going to need to have that PHP code output to a smarty variable using a code snippit or hook. You can merge the contact-form-run.php file contents with your PHP code. Then, all you need in your document is the smarty variable, something like {$MY_VARIABLE}

The complexity really depends on what is in your PHP files you are including.

Link to comment
Share on other sites

Putting PHP code in a Document, a product's Description, or a category's Description is nearly impossible. The text is treated by CubeCart as a value to assign to a variable. This variable and assigned text value never sees anything that could execute embedded PHP code.

As mentioned by Noodleman, there is a way by using hooks to get the results of what you may be wanting.

Feel free to send me a PM if you want to learn how to do this.

Link to comment
Share on other sites

Hi Noodleman,

I have printed out the article in question, it is certainly something I do need to learn how to do but it will be a week or two before I have time to have a go at it.

For now I have saved a live CubeCart page as a static page and are making the alterations I need in there.

Thanks for everyones advice.


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.

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...