sharingsunshine
asked on
Add PHP Page To Prestashop 1.5.6
I have the need to have a php page be embedded into the framework of Prestashop. I have followed a discussion on how to add a php page but I am still not getting it to work and there is a fatal error.
Here is my php code in /override/controllers/fron t called Assessment.php
Here is my .tpl file which is located in /themes/warehouse called assessment.tpl
I am calling it in this manner http://www.abc.com/index.php?controller=Assessment and I am getting this error
Please help me get my simple php to work so that I then can add in my actual script.
Thanks,
Here is my php code in /override/controllers/fron
<?php
class AssessmentControllerCore extends FrontController {
/**
* Initialize controller
* @see FrontController::init()
*/
public function init() {
parent::init();
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent() {
parent::initContent();
$this->setTemplate(_PS_THEME_DIR_.'assessment.tpl');
}
}
?>
Here is my .tpl file which is located in /themes/warehouse called assessment.tpl
{php}
<?php
echo "sdf";
?>
{/php}
I am calling it in this manner http://www.abc.com/index.php?controller=Assessment and I am getting this error
[Thu Aug 17 18:03:21.105090 2017] [:error] [pid 12287] [client 69.34.35.119:57139] PHP Fatal error: Class 'Assessment' not found in /data/web/abc.com/classes/controller/Controller.php on line 128
Please help me get my simple php to work so that I then can add in my actual script.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Maybe there are multiple problems. The error you are showing is, "Class 'Assessment' not found ". By changing the name of the file to match, that probably fixed one issue then allowed you to get to the next issue.
Are you still getting the same fatal error when you changed "/override/controllers/fro nt/Assessm ent.php" to "/overrides/controllers/front/Assessm ent.php"
If so, close out this question, then lets start a new thread for the next issue.
Are you still getting the same fatal error when you changed "/override/controllers/fro
If so, close out this question, then lets start a new thread for the next issue.
ASKER
It seems the instructions I was following don't fit my version of Prestashop. Because the folder name is override not overrides and it gets even more complicated after that. So I need to find out from my developer the correct way to proceed. Thanks for trying to help.
ASKER
I appreciate all of your help.
ASKER
Yes, there were multiple problems. It seems the theme creators did change it to override (singular.) However, in my form statement I had included the direct link to the controllers and it should be the same as I am calling it in the browser. Such as, http://www.abc.com/index.php?controller=Assessment instead of http://www.abc.com//override/controllers/front/Assessment.php
ASKER