Jump to content

Supprimer logo et pied de page sur facture en 1.6


Recommended Posts

Bonsoir la communauté,

 

Je souhaiterai pouvoir supprimer le logo et le pied de page des factures, BL... Mais uniquement lorsque la facture ou le BL est édité côté "admin".

En effet, j'imprime mes factures et BL sur du papier en-tête, où ces informations y figurent déjà.

 

Par contre, ces informations doivent resté présente si c'est le client qui édite ces documents dans son compte client.

Il y a-t-il un moyen de faire ceci avec un presta 1.6.1.11 s'il vous plait ?

 

J'ai cherché sur le forum, mais je suis tombé sur un post assez vieux de quelques années, et je n'ai pas trouvé dans mon 1.6 les mêmes lignes de code, c'est pour ça que je me tourne vers vous aujourd'hui.

 

En espérant que quelqu'un pourra m'aider...

 

Vous en remerciant par avance !

Link to comment
Share on other sites

Oui bien sûr, voici le lien du topic que j'ai trouvé :

https://www.prestashop.com/forums/topic/111523-retirer-le-logo-des-factures-cote-admin/

 

La solution donnée concerne une ancienne version, et je n'arrive pas à retrouver les même ligne de code dans ma 1.6.

En plus la solution donnée fonctionne que pour le logo apparemment...

 

Je vous remercie par avance pour votre aide.

Link to comment
Share on other sites

Salut,

1) on crée un override de la classe HTMLTemplate.php dans /classes/pdf

2) on overide la function getLogo

/**
     * Returns the invoice logo
     */
    protected function getLogo()
    {
        $logo = '';

        $id_shop = (int)$this->shop->id;
        
        // on recupère le context pour savoir si c'est un employé qui générère le PDF
        $context = Context::getContext();
        $id_employee = (int)$context->employee->id;

        // on crée une condition 
        if (!$id_employee) {

            if (Configuration::get('PS_LOGO_INVOICE', null, null, $id_shop) != false && file_exists  && $context->id_employee(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, $id_shop))) {
                $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, $id_shop);
            } elseif (Configuration::get('PS_LOGO', null, null, $id_shop) != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop))) {
                $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop);
            }
        } else {
            $logo = '';

        }
        return $logo;
    }

PS 1.6.1.12 voila :)

Edited by Alexandre Carette (see edit history)
Link to comment
Share on other sites

Bonsoir Alexandre,

 

Merci tout d'abord de la réponse.

 

J'ai créé un fichier HTMLTemplate.php dans override/classes/pdf

J'ai collé votre code dans ce fichier

 

J'ai testé et j'ai toujours le logo sur mes factures que j'édite en pdf coté admin.

Ai-je mal fait quelque chose ?

 

Vous remerciant encore pour votre aide :)

Link to comment
Share on other sites

fichier override  HTMLTemplate.php

<?php
/**
 * 2007-2016 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author 	PrestaShop SA <[email protected]>
 *  @copyright  2007-2016 PrestaShop SA
 *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */

class HTMLTemplate extends HTMLTemplateCore {

// Ici la fonction a overrider

}

ensuite on efface le class_index.php de /cache

 

cdt

Edited by Alexandre Carette (see edit history)
Link to comment
Share on other sites

Bonjour Alexandre,

Tout d'abord, merci de prendre du temps pour mon soucis, c'est vraiment sympa.

J'ai fais comme vous m'avez dis, mais lorsque j'efface le class_index.php de /cache, je me retrouve avec une page blanche côté admin (?)

Auriez-vous une solution ?

Vous en remerciant.

Cordialement

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