Jump to content

1.5.1.0 Invoice: TCPDF ERROR: [Image] pls help


Recommended Posts

I was fix it. My hosting (home.pl) have specifically server configuration.

 

I insert into file: shopname\classes\pdf\HTMLTemplate.php in line 48 under line:

$path_logo = $this->getLogo();

this script:

//! START home.pl img dir
$sname=substr($path_logo, 0, strlen($_SERVER['SERVER_NAME']));  
//testing invoice logo dir is correct
if($_SERVER['SERVER_NAME']!=$sname){
$path_logo = $_SERVER['SERVER_NAME'].$path_logo;
}
//END

 

Please someone check this on working shop.

HTMLTemplate.php

Edited by bonio89 (see edit history)
  • Like 5
Link to comment
Share on other sites

Warning: getimagesize(www.rtdetail.es/var/www/vhosts/rtdetail.es/httpdocs/img/logo_invoice.jpg): failed to open stream: No such file or directory in /var/www/vhosts/rtdetail.es/httpdocs/classes/pdf/HTMLTemplate.php on line 60 TCPDF ERROR: [image] Unable to get image: /var/www/vhosts/rtdetail.es/httpdocs/cache/tcpdf/img_BJVXP9

 

 

generated only if the delivery note, the screen remains blank, but if the change order status, and generate the invoice if you let me see the delivery note, but I want to just generate invoice delivery note without

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

anything, all the same

 

I discovered that the problem is to create just the delivery note.

 

if a state, I assign you create invoice and delivery note, packing slip is correct, but assume that the state is:

 

preparing order - generate delivery note, does not work

 

sent - generated invoice (anddelivery note) works

 

some form of work to generate the delivery note?

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

set variables in HTMLtemplate.php:

$width = 240; //your invoice_logo width
$height = 50; //your invoice_logo height

 

under the code (probably 60 line):

if (!empty($path_logo))
  list($width, $height) = getimagesize($path_logo);

 

or try to upload new logo for test in png and jpg format.

check: http://www.prestashop.com/forums/topic/176064-tcpdf-error-help-plz/

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

  • 1 year later...

bonio89! uratowałeś mi skórę tym tipem.. nigdy więcej sklepów na home.pl

jak oni konfigurują te hostingi!!!?? chyba aby klienci przechodzili wkurzeni na ich dedykowany soft chyba...

 

dzięki!

 

No problem. Presta is working "propety" at home.pl to version 1.5.4. I don't have time for modify scripts for home.pl servers and i run now on my own phisical server at win 2008 r2 (datacenter) with iis. There is no problems but it don't have mod_rewrite from apache, and run litle slower(C2D E6600, 4gb ddr2 - i suppose Q6600 will be better for fast cgi).
P.S. It is english forum and you should write in english;)
Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...
  • 3 weeks later...
hello,

PS I have a problem with 1.6.0.14.

Once you accept payment via Paypal I get an error in the form TCPDF ERROR: [image] Unable to get image: /img/tmp/product_mini_17_0.jpg.

The same problem also appears to want to preview the invoice from the order history, even if the payment was made ordinary transfer.



 

Please help in this topic.

 

I greet

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

Hi, after all the changes I still have a problem (prestashop 1.6.0.9). My code:

 

public function getHeader()
    {
        $shop_name = Configuration::get('PS_SHOP_NAME', null, null, (int)$this->order->id_shop);
        $path_logo='/img/centropol-1427632497.jpg';
        //! START home.pl img dir
        $sname=substr($path_logo, 0, strlen($_SERVER['SERVER_NAME']));  
        //testing invoice logo dir is correct
        if($_SERVER['SERVER_NAME']!=$sname){
        $path_logo = $_SERVER['SERVER_NAME'].$path_logo;
        }
        //END

        $width = 302;
        $height = 124;
        if (!empty($path_logo))
            list($width, $height) = getimagesize($path_logo);

        $this->smarty->assign(array(
            'logo_path' => $path_logo,

            'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'),
            'title' => $this->title,
            'date' => $this->date,
            'shop_name' => $shop_name,
            'width_logo' => $width,
            'height_logo' => $height
        ));

        return $this->smarty->fetch($this->getTemplate('header'));
    }

 

 

System back to me error messages:

 

Warning: getimagesize() [function.getimagesize]: Unable to find the wrapper "sklep.centropol.plhttp" - did you forget to enable it when you configured PHP? in /classes/pdf/HTMLTemplate.php on line 58

Warning: getimagesize(sklep.centropol.plhttp://sklep.centropol.pl/img/centropol-1427632497.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /classes/pdf/HTMLTemplate.php on line 58
TCPDF ERROR: [image] Unable to get image: sklep.centropol.plhttp://sklep.centropol.pl/img/centropol-1427632497.jpg

 

 

Please help!

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

Ok, so now is:

Warning: getimagesize(sklep.centropol.pl/img/centropol-1427632497.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /classes/pdf/HTMLTemplate.php on line 57

Warning: Cannot modify header information - headers already sent by (output started at /classes/order/Order.php:1) in /tools/tcpdf/tcpdf.php on line 8966
TCPDF ERROR: Some data has already been output to browser, can't send PDF file
54 $width = 302;
55 $height = 124;
56 if (!empty($path_logo))
57 list($width, $height) = getimagesize($path_logo);
Link to comment
Share on other sites

If no script works, so disable the product pictures in invoice and that's it. Wait for next Prestashop release and upgrade.

 

How to disable the pictures : Tab "preferences -> orders -> pdf settings -> Enable product image on Invoice/Enable product image on DELIVERY-SLIP = NO

Link to comment
Share on other sites

  • 2 weeks later...

Unfortunately you did not mentioned your Prestashop Version. Initial topic is for PS 1.5.1.0

 

If no script works, so disable the product pictures in invoice and that's it. Wait for next Prestashop release and upgrade.

 

How to disable the pictures : Tab "preferences -> orders -> pdf settings -> Enable product image on Invoice/Enable product image on DELIVERY-SLIP = NO

 

I confirm, that Gregory's fix is working for PS 1.6.x. You should revise the adaptations you made.

Edited by selectshop.at (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

I was fix it. My hosting (home.pl) have specifically server configuration.

 

I insert into file: shopname\classes\pdf\HTMLTemplate.php in line 48 under line:

$path_logo = $this->getLogo();
this script:

//! START home.pl img dir
$sname=substr($path_logo, 0, strlen($_SERVER['SERVER_NAME']));  
//testing invoice logo dir is correct
if($_SERVER['SERVER_NAME']!=$sname){
$path_logo = $_SERVER['SERVER_NAME'].$path_logo;
}
//END
Please someone check this on working shop.

 

This works for me on home.pl server with PrestaShop 1.6

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

But it should work now, it works great for me. Gregory from Prestashop fixed it. 

http://forge.prestashop.com/browse/PSCSX-4925

https://github.com/PrestaShop/PrestaShop/pull/2797/files

 

 

 

its give me this error

when print from frontoffice

 

Notice: Undefined property: Order::$round_type in /home/--------------/public_html/classes/pdf/HTMLTemplateInvoice.php on line 190

 

Fatal error: Call to undefined method OrderInvoice::displayTaxBasesInProductTaxesBreakdown() in /home/-----------/public_html/classes/pdf/HTMLTemplateInvoice.php on line 241

 

when print from backoffice

Fatal error: Call to undefined method OrderInvoice::displayTaxBasesInProductTaxesBreakdown() in /home/---------/public_html/classes/pdf/HTMLTemplateInvoice.php on line 241

 

im use ps1.6.0.14

Link to comment
Share on other sites

  • 5 months later...
  • 4 months later...

I was fix it. My hosting (home.pl) have specifically server configuration.

 

I insert into file: shopname\classes\pdf\HTMLTemplate.php in line 48 under line:

$path_logo = $this->getLogo();
this script:

//! START home.pl img dir
$sname=substr($path_logo, 0, strlen($_SERVER['SERVER_NAME']));  
//testing invoice logo dir is correct
if($_SERVER['SERVER_NAME']!=$sname){
$path_logo = $_SERVER['SERVER_NAME'].$path_logo;
}
//END
Please someone check this on working shop.

 

 

 

works with 1.6.1.5

Link to comment
Share on other sites

  • 2 months later...
  • 6 months later...

Hi there,

 

i have a problem at my presta shop. 

 

When someone make a purchase at our shop, when he finish is having an error like this.

 

TCPDF ERROR: [image] Unable to get image: /img/tmp/product_mini_1149_3469.jpg

 

Help me please to solve this.

Link to comment
Share on other sites

×
×
  • Create New...