salvadorbiedma Posted April 2, 2012 Share Posted April 2, 2012 Hello Everybody! I need to change the name of my company in the PDF invoice. The PDF invoice print me the text "Company X" but what i would like is the Next: If the invoice is before March 31 2012 the Company X is right and the PDF will show this one. But If the invoice is later than April 1, 2012 the system will print in the PDF Company Y. Any help? Thanks so much people! Best regards from Spain. Link to comment Share on other sites More sharing options...
daYmo Posted April 2, 2012 Share Posted April 2, 2012 Hello, you'll just have to create /override/classes/PDF.php modify your classes/PDF.php function Header at this part : $conf = Configuration::getMultiple(array('PS_SHOP_NAME', 'PS_SHOP_ADDR1', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_STATE')); $conf['PS_SHOP_NAME'] = isset($conf['PS_SHOP_NAME']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_NAME']) : 'Your company'; $conf['PS_SHOP_ADDR1'] = isset($conf['PS_SHOP_ADDR1']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_ADDR1']) : 'Your company'; $conf['PS_SHOP_CODE'] = isset($conf['PS_SHOP_CODE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CODE']) : 'Postcode'; $conf['PS_SHOP_CITY'] = isset($conf['PS_SHOP_CITY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CITY']) : 'City'; $conf['PS_SHOP_COUNTRY'] = isset($conf['PS_SHOP_COUNTRY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_COUNTRY']) : 'Country'; $conf['PS_SHOP_STATE'] = isset($conf['PS_SHOP_STATE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_STATE']) : ''; Check the invoice date (self::$order->invoice_date) : IF it's before 31st of march 2012 you define your old parameters ( $conf['PS_SHOP_NAME']="my old company"; ... ELSE you let the code above 1 Link to comment Share on other sites More sharing options...
salvadorbiedma Posted April 4, 2012 Author Share Posted April 4, 2012 Hi daYmo, Thanks for your help. I have created the next code. But Prestashop show me an error at the moment in that I generate the invoice. if substr($shipping_date, 4, 2) =< 4 $this->Cell(0, 5, 'Company X',''); else $this->Cell(0, 5, ' Company Y',''); Prestashop show me the next error: Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/tiendagr/public_html/classes/PDF.php on line 206 I work with Prestashop 1.2.5. Thanks. Best regards. Link to comment Share on other sites More sharing options...
daYmo Posted April 4, 2012 Share Posted April 4, 2012 no no it's not here ... send me your PDF.php file and tell me if you also need to change logo or just need to change informations at the bottom of the invoice. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now