Change invoice position of address

06.01.2017 09:04
#1
crimle
Joomshopping forum user no avatar
Name: crimle
09.01.2012
Сообщения: 50
Quote
Change invoice position of address

Hi

PDF-invoice: address is on the left, date/invoice number are on the right. See screenshot.
Can I swap these positions? I would like the address on the right since my envelopes have the window to the right.

I think I have to edit thie file components/com_jshopping/lib/generete_pdf_order.php
but I am unconfident about the code I have to change.

Thank you and kind regards
Christof
Change invoice position of address

 
06.01.2017 12:55
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Сообщения: 25850
Quote
Aw: Change invoice position of address

1. create user_config.php
https://www.webdesigner-profi.de/joomla-webdesign/joomla-shop/forum/posts/1/11673.html?lang=en#8

2. change user_generete_pdf_order.php

 
06.01.2017 14:49
#3
crimle
Joomshopping forum user no avatar
Name: crimle
09.01.2012
Сообщения: 50
Quote
Aw: Change invoice position of address

Ok, I understand that this makes my changes update-resistant. But what changes are necessary to the file? I'm not very good at interpreting PHP code. I guess that I have to change these lines somehow:


$y+=10;
$pdf->SetFont('freesans','',11);
$pdf->SetXY(20,$y);

$address_data = array(
$order->firma_name,
trim($order->f_name." ".$order->l_name." ".$order->m_name),
trim(trim($order->street." ".$order->street_nr)." ".$order->home." ".$order->apartment),
trim($order->zip." ".$order->city),
$order->country
);
$pdf_address = implode("\n", array_filter($address_data));
$dispatcher->trigger('onGeneratePdfOrderBeforePdfAddress', array(&$order, &$pdf, &$pdf_address));
$pdf->MultiCell(80,4.5, $pdf_address, 0,'L');

$pdf->SetFont('freesansi','',11);
$pdf->SetXY(110,$y);
$pdf->MultiCell(80,4.5,_JSHOP_ORDER_SHORT_NR." ".$order->order_number."\n"._JSHOP_ORDER_FROM." ".$order->order_date,0,'R');
if ($jshopConfig->date_invoice_in_invoice){
$y+=12;
$pdf->SetXY(110,$y);
$pdf->MultiCell(80,4.5,_JSHOP_INVOICE_DATE." ".strftime($jshopConfig->store_date_format, strtotime($order->invoice_date)), 0, 'R');
}
if ($jshopConfig->user_number_in_invoice && $order->user_id && $user->number){
$y+=11;
$pdf->SetXY(110,$y);
$pdf->MultiCell(80,4.5,_JSHOP_USER_NUMBER." ".$user->number, 0, 'R');
}



Последнее изменение: 06.01.2017 14:49
 
15.02.2017 16:06
#4
le5
Joomshopping forum user no avatar
Name: le5 GmbH
17.03.2012
Сообщения: 74
Quote
Aw: Change invoice position of address

Hello Crimle

First the documentation for TCPDF you find here:
https://tcpdf.org/docs/
use the search possibility for any needed explanation (type the function name, like SetXY).

Second all coordinates are in Millimeters and Boundaries are set to 0 (no margins) in JoomShopping.
So if you configure Images (Header/Footer) allways use the mm for width and height!

As Example:
$pdf->SetXY(20,$y);

so SetXY sets the position in the document to left 20mm and from top $y.
Of course you can set both positions absolute (without the need of $y) like
$pdf->SetXY(115,90);
so this would be 115mm from left and 90mm from top.

I never manipulate the $y var, since I want to have the calculated PageBrakes like in the original PDF.
Mostly it's only Address stuff I want to change.

Since you can click in the backend (Components -> Joomshopping -> Settings -> Shop Information - at the end of the page) to see directly any changes in your code.

Just don't make to many changes at ones, without testing. Also to activate the error-level in joomla can help, if you make some coding errors.

Hope this helps for anyone.
Aw: Change invoice position of address


Последнее изменение: 15.02.2017 16:12
 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.