2017-09-15 4 views
0

Ich habe ProductController.php wie folgt überschreiben, um Hersteller Land anzuzeigen.Hinzufügen von Hersteller Stadt und Land in Prestashop 1.6 auf Produktliste und Produkt Seite

class ProductController extends ProductControllerCore 
{ 
    public function initContent() 
    { 
     $manufacturer_country = ""; 
     if($this->product->id_manufacturer > 0) 
     { 
      $manufacturer = new Manufacturer($this->product->id_manufacturer, $this->context->language->id); 
      $manufacturer_country = $manufacturer->country; 
     } 

     $this->context->smarty->assign('manufacturer_country', $manufacturer_country); 
     parent::initContent(); 
    } 

}

in product.tpl i schrieb {$ manufacturer_country} aber nichts zu drucken. kann mir jemand anleiten, wie man drucken kann auf product.tpl und produkt list.tpl

+0

Ich habe ProductController.php in Project \ override \ controller \ front \ Verzeichnis. Ich lösche Cache. – MUHIUDDIN

Antwort

0

Aufschalten einen Controller

Die Datei in diesen beiden Orten platziert werden: Sie benötigen

/override/controllers/front/ProductController.php 
/modules/my_module/override/controllers/front/ProductController.php 
/themes/prestashop/modules/my_module/my_module.tpl 
/themes/prestashop/css/modules/my_module/my_module.css 
/themes/prestashop/js/modules/my_module/my_module.js 

Sie passen Ihren Pfad in Ihrem Kontext an, wie es die Version 1.6 erfordert. Grüße

+0

ja ich lege es auf den ersten Pfad. aber ich bekomme kein Druckland. – MUHIUDDIN

+0

self :: $ smarty-> assign ('currentController', ..); –

+0

Sie dem Hersteller_Land zuweisen und keine neue Variable "CurrentController" Ich denke, Ihr Fehler ist hier, Sie haben 2 gleiche Variablen in der gleichen Vorlage. –

Verwandte Themen