darkamarka Posted October 20, 2010 Share Posted October 20, 2010 Please help. Need to place Shop information in the place of delivery info in PDF invoice.And delivery information needs to be deleted. I am using prestashop 1.2.5 Link to comment Share on other sites More sharing options...
rocky Posted October 21, 2010 Share Posted October 21, 2010 The shop information is already displayed at the bottom of the PDF. Why do you need to displayed at the top too? Link to comment Share on other sites More sharing options...
darkamarka Posted October 21, 2010 Author Share Posted October 21, 2010 I need this because in Lithuania (my country) is this standard of invoices.I have tried to do this by editing PDF.php file in classes, but nothing goog happens, because i dont know what really code i need to take from one place to other, and what code to delete. Link to comment Share on other sites More sharing options...
rocky Posted October 21, 2010 Share Posted October 21, 2010 You will need to add this to the invoice() function to get your shop information: $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']) : ''; then change all the $delivery_address details to your shop details instead. For example, change line 400 from: $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->address1), 0, 'L'); to: $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_ADDR1']), 0, 'L'); Link to comment Share on other sites More sharing options...
darkamarka Posted October 21, 2010 Author Share Posted October 21, 2010 sorry, but not working. When i tried to replace code in the example, where You write, that place makes blank. Link to comment Share on other sites More sharing options...
darkamarka Posted October 21, 2010 Author Share Posted October 21, 2010 Maybe i don't understand where to "add this to the invoice() function" ?I have found already this code in " * Invoice header */ public function Header() { global $cookie; Link to comment Share on other sites More sharing options...
rocky Posted October 21, 2010 Share Posted October 21, 2010 No, that's the wrong function. If you want to replace the delivery address with your shop address, you will need to edit the invoice() function on line 350: public static function invoice($order, $mode = 'D', $multiple = false, &$pdf = NULL, $slip = false, $delivery = false) Link to comment Share on other sites More sharing options...
darkamarka Posted October 21, 2010 Author Share Posted October 21, 2010 Working!!! Thank You very much!!!! 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