Jump to content

Load tpl content over ajax, template file not found


Recommended Posts

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:

 

 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...