kaktus.m Posted September 16, 2018 Share Posted September 16, 2018 Hello, I've modded the default product.tpl file so that I can load extra template files via ajax. After I've figured out how to access my module front controller through ajax, I have now a new error: mod_fcgid: stderr: PHP Fatal error: Uncaught --> Smarty: Unable to load template file 'ajax_load_attributes.tpl' I've alo tried to give the whole path to this function, but the error changes: smarty_internal_templatebase.php(157) : eval()'d code): failed to open stream: No such file or directory mod_fcgid: stderr: PHP Warning: array_slice() expects parameter 1 to be array, boolean given PrestaShopException.php on line 110 mod_fcgid: stderr: PHP Warning: Invalid argument supplied for foreach() PrestaShopException.php on line 114 My PHP code: class TestmodulLoadAjaxModuleFrontController extends ModuleFrontController { public function initContent() { $this->ajax = true; parent::initContent(); } public function displayAjax() { if($this->errors) die(Tools::json_encode(array('hasError' => true, 'errors' => $this->errors))); if(Tools::getValue('d')) { $this->product = new Product((int)Tools::getValue('d')); $this->assignAttributesGroups(); echo $this->context->smarty->fetch('ajax_load_attributes.tpl'); die(); } } } I've found this other thread about the ajax load tpl content topic, but there this error doesn't seem to appear: https://www.prestashop.com/forums/topic/462682-load-tpl-content-from-ajax-request/ Link to comment Share on other sites More sharing options...
graham Posted September 20, 2018 Share Posted September 20, 2018 (edited) it could be configuration or database issue..at least it was for our essaytyper.pro project app..you might be missing 'ajax_load_attributes.tpl', uploading fresh Prestashop version should solve the issue, unless this missing file is from a third party Edited September 20, 2018 by graham (see edit history) Link to comment Share on other sites More sharing options...
Adeko.nl Posted September 20, 2018 Share Posted September 20, 2018 Hi Kaktus, What version are you using? If 1.7, try: $this->context->smarty->fetch('module:MY_MODULE_NAME/views/temapltes/front/ajax_load_attributes.tpl'); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now