Jump to content

Images des produits dans facture


Recommended Posts

Bonjour,

 

Je suis en 1.6.0.8, donc en 1.6.

 

Je souhaite ajouter (depuis fort longtemps) l'image du produit commandé dans mes factures.

 

Or, je viens de voir que la "1.6" (celle que j'ai donc) permet ceci en cochant "Afficher l'image du produit" http://doc.prestashop.com/display/PS16/Factures

 

Et pourtant, je n'ai absolument pas cette option dans ma gestion des factures (voir PJ).

 

Quelqu'un aurait-il une idée du comment du pourquoi ?

 

Ou quelqu'un pourrait-il m'envoyer le modèle de facture "avec" images des produits ?

 

Merci d'avance.

 

 

post-476337-0-13146700-1508066203_thumb.jpg

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

Bonsoir,

 

Peut-être que cela s'affiche qu'a partir d'une version supérieur a la votre en 1.6. (1.6.1.0 par exemple), je ne sais pas.

 

Sinon par rapport a ma version 1.6.1.11, est-ce que vous avez cela dans le fichier:

 

/controllers/admin/AdminInvoicesController.php

class AdminInvoicesControllerCore extends AdminController
{
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'invoice';

        parent::__construct();

        $this->fields_options = array(
            'general' => array(
                'title' =>    $this->l('Invoice options'),
                'fields' =>    array(
                    'PS_INVOICE' => array(
                        'title' => $this->l('Enable invoices'),
                        'desc' => $this->l('If enabled, your customers will receive an invoice for their purchase(s).'),
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),
                    'PS_INVOICE_TAXES_BREAKDOWN' => array(
                        'title' => $this->l('Enable tax breakdown'),
                        'desc' => $this->l('Show a summary of tax rates when there are several taxes.'),
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),
                    'PS_PDF_IMG_INVOICE' => array(
                        'title' => $this->l('Enable product image'),
                        'hint' => $this->l('Adds an image before product name on the invoice'),
                        'validation' => 'isBool',
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),
                    'PS_INVOICE_PREFIX' => array(
                        'title' => $this->l('Invoice prefix'),
                        'desc' => $this->l('Prefix used for invoice name (e.g. #IN00001).'),
                        'size' => 6,
                        'type' => 'textLang'
                    ),
                    'PS_INVOICE_USE_YEAR' => array(
                        'title' => $this->l('Add current year to invoice number'),
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),
                    'PS_INVOICE_RESET' => array(
                        'title' => $this->l('Reset Invoice progressive number at beginning of the year'),
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),
                    'PS_INVOICE_YEAR_POS' => array(
                        'title' => $this->l('Position of the year number'),
                        'cast' => 'intval',
                        'show' => true,
                        'required' => false,
                        'type' => 'radio',
                        'validation' => 'isBool',
                        'choices' => array(
                            0 => $this->l('After the progressive number'),
                            1 => $this->l('Before the progressive number')
                        )
                    ),
                    'PS_INVOICE_START_NUMBER' => array(
                        'title' => $this->l('Invoice number'),
                        'desc' => sprintf($this->l('The next invoice will begin with this number, and then increase with each additional invoice. Set to 0 if you want to keep the current number (which is #%s).'), Order::getLastInvoiceNumber() + 1),
                        'size' => 6,
                        'type' => 'text',
                        'cast' => 'intval'
                    ),
                    'PS_INVOICE_LEGAL_FREE_TEXT' => array(
                        'title' => $this->l('Legal free text'),
                        'desc' => $this->l('Use this field to display additional text on your invoice, like specific legal information. It will appear below the payment methods summary.'),
                        'size' => 50,
                        'type' => 'textareaLang',
                    ),
                    'PS_INVOICE_FREE_TEXT' => array(
                        'title' => $this->l('Footer text'),
                        'desc' => $this->l('This text will appear at the bottom of the invoice, below your company details.'),
                        'size' => 50,
                        'type' => 'textLang',
                    ),
                    'PS_INVOICE_MODEL' => array(
                        'title' => $this->l('Invoice model'),
                        'desc' => $this->l('Choose an invoice model.'),
                        'type' => 'select',
                        'identifier' => 'value',
                        'list' => $this->getInvoicesModels()
                    ),
                    'PS_PDF_USE_CACHE' => array(
                        'title' => $this->l('Use the disk as cache for PDF invoices'),
                        'desc' => $this->l('Saves memory but slows down the PDF generation.'),
                        'validation' => 'isBool',
                        'cast' => 'intval',
                        'type' => 'bool'
                    )
                ),
                'submit' => array('title' => $this->l('Save'))
            )
        );
    }
Link to comment
Share on other sites

Me revoilà.

Alors non, je n'ai pas cela.

 

J'ai pris le risque d'ajouter ce que je n'avais pas.

                    'PS_PDF_IMG_INVOICE' => array(
                        'title' => $this->l('Enable product image'),
                        'hint' => $this->l('Adds an image before product name on the invoice'),
                        'validation' => 'isBool',
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),

Je vois bien cette case à présent dans mon backoffice. Et sans erreur, ni page blanche :-D

 

Par contre, j'ai regénéré une facture mais n'ayant pas le bon invoice.tpl, je ne vois pas d'image.

 

Auriez-vous la gentillesse de me faire parvenir le votre ?

 

Merci d'avance.

Link to comment
Share on other sites

Re,

 

Voici mon invoice.tpl:

*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 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/afl-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/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{$style_tab}


<table width="100%" id="body" border="0" cellpadding="0" cellspacing="0" style="margin:0;">
	<!-- Invoicing -->
	<tr>
		<td colspan="12">

			{$addresses_tab}

		</td>
	</tr>

	<tr>
		<td colspan="12" height="30"> </td>
	</tr>

	<!-- TVA Info -->
	<tr>
		<td colspan="12">

			{$summary_tab}

		</td>
	</tr>

	<tr>
		<td colspan="12" height="20"> </td>
	</tr>

	<!-- Product -->
	<tr>
		<td colspan="12">

			{$product_tab}

		</td>
	</tr>

	<tr>
		<td colspan="12" height="10"> </td>
	</tr>

	<!-- TVA -->
	<tr>
		<!-- Code TVA -->
		<td colspan="6" class="left">

			{$tax_tab}

		</td>
		<td colspan="1"> </td>
		<!-- Calcule TVA -->
		<td colspan="5" rowspan="5" class="right">

			{$total_tab}

		</td>
	</tr>
	
	{$note_tab}
	
	<tr>
		<td colspan="12" height="10"> </td>
	</tr>

	<tr>
		<td colspan="6" class="left">

			{$payment_tab}

		</td>
		<td colspan="1"> </td>
	</tr>

	<tr>
		<td colspan="6" class="left">

			{$shipping_tab}

		</td>
		<td colspan="1"> </td>
	</tr>

	<tr>
		<td colspan="12" height="10"> </td>
	</tr>

	<tr>
		<td colspan="7" class="left small">

			<table>
				<tr>
					<td>
						<p>{$legal_free_text|escape:'html':'UTF-8'|nl2br}</p>
					</td>
				</tr>
			</table>

		</td>
	</tr>
	<!-- Hook -->
	{if isset($HOOK_DISPLAY_PDF)}
	<tr>
		<td colspan="12" height="30"> </td>
	</tr>

	<tr>
		<td colspan="2"> </td>
		<td colspan="10">
			{$HOOK_DISPLAY_PDF}
		</td>
	</tr>
	{/if}

</table>

En espérant  que cela va vous aider.

 

Cordialement

Link to comment
Share on other sites

Bonjour ,

Dans ton ../pd/invoice-product-tab.tpl tu devrais avoir ca pour la partie produit :

<td class="product left">
                {if $display_product_images}
                    <table width="100%">
                        <tr>
                            <td width="15%">
                                {if isset($order_detail.image) && $order_detail.image->id}
                                    {$order_detail.image_tag}
                                {/if}
                            </td>
                            <td width="5%">&nbsp;</td>
                            <td width="80%">
                                {$order_detail.product_name}
                            </td>
                        </tr>
                    </table>
                {else}
                    {$order_detail.product_name}
                {/if}

 

 

Parcontre j'en profite pour demande , la qualité de l'image sur la facture est catastrophine , ou est ce que je pourrais modifier cela ?

La taille aussi la mettre en plus grand.

Merci de votre aide.

Link to comment
Share on other sites

Oh la la, je suis désolée, merci pour vos réponses. Je ne recevais aucune notification. Et le forum était en croix depuis plusieurs jours.

Et en plus, tout est en anglais maintenant.

Merci à vous une fois de plus.

Le tpl fonctionne bien, je vois à présent les miniatures des produits, c'est super.

 

JamesBen08, pour la taille des images, as-tu fait des tests en modifiant les différents pourcentages qui sont présents dans le code que tu as posté ?

Edited by karopresta
faute d'orthographe (see edit history)
Link to comment
Share on other sites

On 10/23/2017 at 0:13 PM, karopresta said:

Oh la la, je suis désolée, merci pour vos réponses. Je ne recevais aucune notification. Et le forum était en croix depuis plusieurs jours.

Et en plus, tout est en anglais maintenant.

Merci à vous une fois de plus.

Le tpl fonctionne bien, je vois à présent les miniatures des produits, c'est super.

 

JamesBen08, pour la taille des images, as-tu fait des tests en modifiant les différents pourcentages qui sont présents dans le code que tu as posté ?

 

Oui j'ai essaye mais ca ne change rien

 

Link to comment
Share on other sites

  • 8 months later...
  • 3 months later...
  • 2 years later...

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