2016-06-29 14 views
1

zugreifen Ich verwende Prestashop 1.4.3 Version. Und ich möchte Benutzerdaten in Wordpress erhalten. Ich habe unten Code ohne Glück versucht. Geben Sie mir dieses Fatal error:Wie Prestashop Funktionen in WordPress

Class 'FrontController' not found in /opt/lampp/htdocs/domin.com/prestashop/init.php on line 28.

Hier ist mein Skript:

$psabspath = ''; 
$psabspath = $_SERVER['DOCUMENT_ROOT'] . '/domin.com/prestashop/'; 

if ($psabspath != '' && file_exists($psabspath . 'config/config.inc.php') 
               && (file_exists($psabspath . 'classes/FrontController.php') || 
                file_exists($psabspath . 'classes/controller/FrontController.php'))) { 
    require_once($psabspath . 'init.php'); 
    require_once($psabspath . 'config/config.inc.php'); 

    class PrestaShopIntegration_FrontController extends FrontController { 
     public function __destruct() 
     { 
      if (Context::getContext()->cookie) 
       Context::getContext()->cookie->write(); 
     } 

     public function init() { 
      $this->page_name = 'wordpress'; 
      parent::init(); 

      if (isset($this->context)) { 
       if (version_compare(_PS_VERSION_, '1.5.4', '>=')) 
        $this->setMedia(); 
       if ($this->checkAccess()) { 
        $this->postProcess(); 
        $this->initHeader(); 
        if ($this->viewAccess()) 
         $this->initContent(); 
        else 
         $this->errors[] = Tools::displayError('Access denied.'); 
        $this->initFooter(); 
       } 
      } 
     } 

    } 
} 

Antwort

0

Sie sollten zunächst config.php Datei enthalten und dann werden Sie in der Lage sein init.php aufzunehmen.

$psabspath = ''; 
$psabspath = $_SERVER['DOCUMENT_ROOT'] . '/myskinrecipes.com/shop/'; 

if ($psabspath != '' && file_exists($psabspath . 'config/config.inc.php') 
               && (file_exists($psabspath . 'classes/FrontController.php') || 
                file_exists($psabspath . 'classes/controller/FrontController.php'))) { 
    require_once($psabspath . 'config/config.inc.php'); 
    require_once($psabspath . 'init.php'); 

    class PrestaShopIntegration_FrontController extends FrontController { 
     public function __destruct() 
     { 
      if (Context::getContext()->cookie) 
       Context::getContext()->cookie->write(); 
     } 

     public function init() { 
      $this->page_name = 'wordpress'; 
      parent::init(); 

      if (isset($this->context)) { 
       if (version_compare(_PS_VERSION_, '1.5.4', '>=')) 
        $this->setMedia(); 
       if ($this->checkAccess()) { 
        $this->postProcess(); 
        $this->initHeader(); 
        if ($this->viewAccess()) 
         $this->initContent(); 
        else 
         $this->errors[] = Tools::displayError('Access denied.'); 
        $this->initFooter(); 
       } 
      } 
     } 

    } 
} 

config.php werden Prestashop Konfigurationsdateien laden und den gesamten Rahmen laden.

init.php ist nur da, um den Controller zu laden.

+0

Schwerwiegender Fehler: Klasse "Konfiguration" nicht in /opt/lampp/htdocs/domin.com/prestashop/config/config.inc.php in Zeile 105 gefunden. –

+0

Und Zeile 105 haben diesen Code Configuration :: loadConfiguration() ; –

+0

Ok, ich werde Ihre spezifische Prestashop-Version herunterladen, testen und so schnell wie möglich zurückkommen. –