Jump to content

Recommended Posts

Bonjour,

 

j'aimerai savoir ce que les développeurs de prestashop 1.5.6.1 ont fait de la fonction run() qui se trouvait dans le FrontController. Je dois la modifier et je ne la trouve plus... =(

Quelqu'un l'a trouvée ?

 

Ou peut être pouvez-vous résoudre mon problème autrement ?

http://www.prestashop.com/forums/topic/294174-int%C3%A9gration-header-et-footer-wp-dans-ps/?do=findComment&comment=1484282

 

merci

Link to comment
Share on other sites

Bonjour,

 

La classe FrontController a changé :

 

 

 

class FrontControllerCore extends Controller

 

La fonction run se trouve maintenant dans Controller (plus précisément si tu veux conserver l'intégrité des données, surcharge la dans : /override/classes/controller/Controller.php).?

Link to comment
Share on other sites

Bonjour et merci pour votre réponse !

 

Afin de chargé le header et footer wordpress je dois remplacer $this->initHeader(); par get_header(); et $this->initFooter(); par get_footer(); comme ceci ? :

public function run()
    {
        $this->init();
        if ($this->checkAccess())
        {
            // setMedia MUST be called before postProcess
            if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
                $this->setMedia();

            // postProcess handles ajaxProcess
            $this->postProcess();

            if (!empty($this->redirect_after))
                $this->redirect();

            if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
                get_header();

            if ($this->viewAccess())
                $this->initContent();
            else
                $this->errors[] = Tools::displayError('Access denied.');

            if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className)))
                get_footer();

            // default behavior for ajax process is to use $_POST[action] or $_GET[action]
            // then using displayAjax[action]
            if ($this->ajax)
            {
                $action = Tools::toCamelCase(Tools::getValue('action'), true);
                if (!empty($action) && method_exists($this, 'displayAjax'.$action))
                    $this->{'displayAjax'.$action}();
                elseif (method_exists($this, 'displayAjax'))
                    $this->displayAjax();
            }
            else
                $this->display();
        }
        else
        {
            $this->initCursedPage();
            $this->smartyOutputContent($this->layout);
        }
    }

 

Cela n'a pas l'air de fonctionner...

Link to comment
Share on other sites

Comment supprimer ce class_index ?

J'ai donc remplacer $this->initHeader(); par get_header(); et $this->initFooter(); par get_footer();

 

Dans mon fichier prestashop/config/config.inc.php j'ai ajouté à la fin ceci :

// Environnement WordPress
require_once(dirname(__FILE__).'/../../wp-load.php');

 

et j'ai ça sur ma page d'accueil :

Warning: Cannot modify header information - headers already sent by (output started at /wp-content/themes/montheme/header.php:26) in /prestashop/classes/shop/Shop.php on line 412

 

la ligne 26 de mon header wordpress est :
<html <?php language_attributes(); ?>>

 

je vois pas en quoi cela le dérange. Et pourquoi est-ce que la classe Shop vient m'embêter ?

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