Jump to content

See invoice in new window


Recommended Posts

Hi

 

I would like to know as can from the orders of backoffice see invoice in new window instead the download. I know that I need add header('Content-Disposition: inline; but I don´t know in what file

 

Do you know?

 

best regards

Link to comment
Share on other sites

  • 4 weeks later...

I didn't see a generatePDF() function in /classes/pdf/PDFGenerator.php however I did change the line starting at 157

	public function render($filename, $display = true)
	{
		if (empty($filename))
			throw new PrestaShopException('Missing filename.');

		$this->lastPage();

		if ($display === true)
			$output = 'D';
		elseif ($display === false)
			$output = 'S';
		elseif ($display == 'D')
			$output = 'D';
		elseif ($display == 'S')
			$output = 'S';
		else 	
			$output = 'I';
			
		return $this->output($filename, $output);
	}

To the following:

	public function render($filename, $display = true)
	{
		if (empty($filename))
			throw new PrestaShopException('Missing filename.');

		$this->lastPage();

		if ($display === true)
			$output = 'I';
		elseif ($display === false)
			$output = 'S';
		elseif ($display == 'D')
			$output = 'I';
		elseif ($display == 'S')
			$output = 'S';
		else 	
			$output = 'I';
			
		return $this->output($filename, $output);
	}

After that change the view invoice button and view delivery slip in backoffice now show in new window and not does not download a file... However I'm not sure what else this may affect or if it will affect the way the system attaches pdf to email that is sent to customer, I will have to test that..

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...