Jump to content

Modulo no se ve en pagina de inicio


Recommended Posts

Bueno días.
 
 
Llevo mucho tiempo metido en estos foros pero sin estar registrado, ya que no he necesitado registrarme....
 
pero ahora tengo un gran problema con la creacion de un modulo a modo de prueba.
 
Este no se me abre en la pagina de inicio si no que carga en una pagina en blanco, tengo prestaShop 1.5
 
esto es todo el codigo que tengo

Class testModule extends Module{
      	function __construct(){   

         		
		$this->name = 'testmodule';
        $this->displayName = 'Prueba';
		$this->need_instance = 0;
        $this->tab = 'Blocks';
        $this->version = 1.0;
		
		parent:: __construct();
		
       	$this->displayName = $this->l( 'Modulo de prueba' );
        $this->description = $this->l('Descripcion del maldito modulo');
 
    }
 
    function install(){
        {
  if ( parent::install() == false OR !$this->registerHook( 'leftColumn' ) )
    return false;
  return true;
  }
  }
 
    
 
    function hookLeftColumn($params){
	global $smarty;
        return $this->display(__FILE__, 'testModule.tpl');
    }
 
}
?>
<!-- Block testModule -->
<!-- @import url({$base_dir}modules/testModule/css/testModule.css); -->
<div id="testModule_block_left" class="block">
<h4>Prueba modulo</h4>
<div class="block_content">
<ul>
    <li>
     <a href="{$base_dir}modules/testmodule/testmodule_page.php" title="nueva funcionalidad">{l s='nueva funcionalidad traducible' mod='testModule'}</a>
	</li>
</ul>
</div>
</div>
<!-- /Block testModule -->
<?php
global $smarty;
include( '../../config/config.inc.php' );


include( '../../header.php' );
 
$smarty->display( dirname(__FILE__) . '/testmodule_page.tpl' );
 
include( '../../footer.php' );

?>
<!-- Block Nuevo_Modulo -->
<div id="module_testing_block_left" class="block">
<h4>Mi Primer Módulo</h4>
    <div class="block_content">
        Esta es la página de prueba del módulo de Pruebas
    </div>
</div>

 
Trasteando, que no se si lo estoy haciendo bien, me pasa esto.
 
si no modifico el header, ni footer.php y poniendo la consola de errores me pasa esto
 
Warning: File [/size]C:\xampp\htdocs\prestashop\header.php is deprecated[/size]
in [/size]C:\xampp\htdocs\prestashop\classes\Tools.php on line [/size]2147

Warning: Function [/size]displayHeader() is deprecated in [/size]C:\xampp\htdocs\prestashop\header.php on line [/size]41
in [/size]C:\xampp\htdocs\prestashop\classes\Tools.php on line [/size]2147

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'C:\xampp\htdocs\prestashop/themes/heskethm-Prestashop-Theme-Boilerplate-b977597/header.tpl'' in C:\xampp\htdocs\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php:127 Stack trace: #0 C:\xampp\htdocs\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('C:\xampp\htdocs...', NULL, NULL, NULL, true) #1 C:\xampp\htdocs\prestashop\classes\controller\Controller.php(359): Smarty_Internal_TemplateBase->display('C:\xampp\htdocs...') #2 C:\xampp\htdocs\prestashop\classes\controller\FrontController.php(474): ControllerCore->smartyOutputContent('C:\xampp\htdocs...') #3 C:\xampp\htdocs\prestashop\header.php(41): FrontControllerCore->displayHeader() #4 C:\xampp\htdocs\prestashop\modules\testmodule\testmodule_page.php(6): include('C:\xampp\htdocs...') #5 {main} thrown in [/size]C:\xampp\htdocs\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php on line [/size]127
 
 
si modifico ambos archivos donde  $controller->displayFooter(); lo cambio por $controller->initFooter(); y $controller->initHeader();
 
y eliminando de ambos archivos Tools::displayFileAsDeprecated();
 
ya me lanza pero en ventana en blanco, no en la pagina de inicio
 
y no entiendo que me falta, juraría que es del Controller, pero no se por que me falla.
 
Espero que me podáis guiar por el buen camino, por que la desesperación ya me puede.
 
 
Un saludo y muchísimas gracias

testmodule.php

testmodule_page.php

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...