If Magento Developer Create magento Packingslip or Order invoice Pdf in magento 1.6 or Lower Version WITH PHP 5.4 and above they can faces Following Problem:
Fatal Error: Declaration of Zenf_Pdf_FileParserDataSource_File::__construct() must be compativle with Zend_Pdf_FileParserSataSorce::__construct() in Drive_PathwampwwwProdect_namelibZendPdfFileParserDataSourceFile.php on line 41
Why: This Type Of Fatal Error Show if you use magento lower version WITH PHP 5.4 and above for creating zend pdf ORDER invoice or packingslip
Solution:
you can change the constructor function of lib/Zend/Pdf/FileParserDataSource.php
abstract public function __construct();
to
abstract public function __construct($filePath);
Why:
When install a new module with helper data this fatal error will create, because your admin Tools -> Compilation is enable so helper data cannot initiate them
Solution :
Go admin Tools-> compilation. Then if Compiler Status Enabled, press to Run Compilation Process.
And in development time it is good practices to disable the Compilation. If After Compilation the problem still show then there is some problem with your coding.
Fatal error: Call to a member function getStoreLabel() on a non-object in /app/design/frontend/…/…/template/catalog/product/price.phtml
Step 1:
Open file /app/design/frontend/<PACKAGE>/<THEME>/template/catalog/product/price.phtml to edit.
If it is not there, just copy /app/design/frontend/base/default/template/catalog/product/price.phtmlto /app/design/frontend/<PACKAGE>/<THEME>/template/catalog/product/
Step 2: Find this code:
[sourcecode language=”php”]
$_specialPriceStoreLabel = $this->getProductAttribute(‘special_price’)->getStoreLabel();
[/sourcecode]
And change it to:
[sourcecode language=”php”]
//$_specialPriceStoreLabel = $this->getProductAttribute(‘special_price’)->getStoreLabel();
$_specialPriceStoreLabel = ”;
if ($this->getProductAttribute(‘special_price’)) $_specialPriceStoreLabel = $this->getProductAttribute(‘special_price’)->getStoreLabel();[/sourcecode]
Save the file, clear Magento cache and try it!