Jump to content

Delete '#' (sharp) from the invoice


Recommended Posts

Hello,

I've been searching for a long time but i couldn't manage to find the solution.

 

All my invoices start by a '#' , this is a problem for me on the pdf invoices, how can I delete it ?

 

My prestashop version is 1.5.4.1

 

Thanks a lot,

 

Floreasy

Link to comment
Share on other sites

Edit file:

 

/classes/pdf/HTMLTemplateInvoice.php
Search:

 

$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);

Change by:

 

$this->title = HTMLTemplateInvoice::l('Invoice ').' '.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);

But it is better to create an "override" and not have to edit the class directly

 

Create file:

 

 

HTMLTemplateInvoice.php
Content File:

 

<?php
class HTMLTemplateInvoice extends HTMLTemplateInvoiceCore 
{

public function __construct(OrderInvoice $order_invoice, $smarty)
	{
		$this->order_invoice = $order_invoice;
		$this->order = new Order((int)$this->order_invoice->id_order);
		$this->smarty = $smarty;

		// header informations
		$this->date = Tools::displayDate($order_invoice->date_add);

		$id_lang = Context::getContext()->language->id;
		$this->title = HTMLTemplateInvoice::l('Invoice ').' '.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);
		// footer informations
		$this->shop = new Shop((int)$this->order->id_shop);
	}
}

Save file in:

 

/override/classes/pdf/
After Then delete the file:

 

 

/cache/class_index.php
Sorry for my English.
  • Like 1
Link to comment
Share on other sites

Thank you very much!!! It worked! I don't know how to put this subject as closed, but it is closed now!

 

Perfect !

 

It has been an honor to help and serve you!
 
Sorry for my English.
 
----
 
To add "Solved" to the title of the topic, look this guide:
 
Image 01

 

edipost1.png

 

Image 02

 

edipost2.png

 

Image 03

 

edipost3.png

 

Sorry for my English

Link to comment
Share on other sites

×
×
  • Create New...