Dae Posted July 17, 2018 Share Posted July 17, 2018 Bonjour, Je suis actuellement sous Prestashop 1.7.4.0 et j'essaie de modifier le logo apparaissant dans mes factures. Pour cela je dois modifier la fonction assignCommonHeaderData() du fichier /classes/pdf/HTMLTemplate.php, j'ai donc mis en place une surcharge en créant le fichier HTMLTemplate.php dans le dossier /override/classes/pdf/ avec le contenu suivant : <?php class HTMLTemplate extends HTMLTemplateCore { /** * Assign common header data to smarty variables */ public function assignCommonHeaderData() { $this->setShopId(); $id_shop = (int)$this->shop->id; $shop_name = Configuration::get('PS_SHOP_NAME', null, null, $id_shop); $path_logo = $this->getLogo(); $width = 0; $height = 0; if (!empty($path_logo)) { list($width, $height) = getimagesize($path_logo); } // Limit the height of the logo for the PDF render $maximum_height = 100; if ($height > $maximum_height) { $ratio = $maximum_height / $height; $height *= $ratio; $width *= $ratio; } $this->smarty->assign(array( 'logo_path' => $path_logo, 'img_ps_dir' => 'http://'.Tools::getMediaServer(_PS_IMG_)._PS_IMG_, 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'date' => $this->date, 'title' => $this->title, 'shop_name' => $shop_name, 'shop_details' => Configuration::get('PS_SHOP_DETAILS', null, null, (int)$id_shop), 'width_logo' => $width, 'height_logo' => $height )); } } J'ai bien vérifié que le fichier cache_index.php du dossier /cache/ soit supprimé, j'ai de toute façon désactivé le cache et activé le mode débug. Malheureusement l'override n'est pas pris en compte, auriez-vous une idée de pourquoi? Je vous remercie par avance pour toute l'aide que vous pourrez m'apporter, Christophe Link to comment Share on other sites More sharing options...
mangeur de fleurs Posted February 21 Share Posted February 21 Bonjour Christophe, Est-ce que vous avez réussi ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now