How to include US state to PDF invoice?

StartZurück 1 2 WeiterEnde
24.03.2017 12:11
#1
sulpheraas
Joomshopping forum user no avatar
Name: Eugene
11.07.2008
Posts: 56
Quote
How to include US state to PDF invoice?

Hello,

When I shipping to the USA, it's important to write US state on the parcel.
It would be very useful to include US state to PDF invoice which is available from JoomShopping backend > Orders.
I suppose some lines must be changed in components/com_jshopping/lib/generate_pdf_order.php

Can anybody give an advice which lines must be modified that let me to include US state in invoice?

Thanks.


Joomla: 3.6.4
JoomShopping: 4.16.0
PHP: 7.0.17
MySQL: 5.5.52-MariaDB

Letzte Änderung: 24.03.2017 12:47
 
24.03.2017 13:45
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

change
code

$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
);

to

$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->state,
$order->country
);

 
01.04.2017 22:45
#3
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Hey
works great. Now, I am using the delivery adress on invoice plugin, what do I need to change to get the state on the delivery address as well?
Thanks
Rolf

 
03.04.2017 08:18
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

$order->d_state

 
03.04.2017 10:54
#5
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Hey
Sorry, where?
Using Delivery address in pdf order
Thanks
Rolf

 
03.04.2017 13:54
#6
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

screenshot?

 
03.04.2017 15:22
#7
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Sure
I want the State to be shown in both addresses, see red circles.
Thanks
Rolf
Aw: How to include US state to PDF invoice?

 
03.04.2017 16:47
#8
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

Change file
plugins/jshoppingorder/PdfOrderDeliveryAdress/PdfOrderDeliveryAdress.php

after

$order->d_country."\n".

add

$order->d_state."\n".

 
04.04.2017 21:47
#9
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Hey
If I do this, the order list stays blank....
Changes are in the screenshot...
Thanks
Rolf
Aw: How to include US state to PDF invoice?

 
04.04.2017 22:38
#10
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

image not works.

change image file (delete .php)


Letzte Änderung: 04.04.2017 22:38
 
05.04.2017 09:59
#11
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Oh, sorry.
Now...
Aw: How to include US state to PDF invoice?

 
05.04.2017 10:18
#12
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

Bug in "."

$order->d_state."\n".

 
05.04.2017 11:10
#13
Dingens
User Dingens
Name: Rolf Wagels
28.03.2012
Posts: 688
Quote
Aw: How to include US state to PDF invoice?

Great!
Thanks!
I have tweaked it a little bit, so that it is now city, state
For future reference:
in generete_pdf_order.php, it is
$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->state,
$order->country


and in PdfOrderDeliveryAdress.php it is:
"\n"._JSHOP_FINISH_DELIVERY_ADRESS.":\n\n".
$order->d_firma_name."\n".
$order->d_f_name." ".$order->d_l_name."\n".
$order->d_street."\n".
$order->d_zip." ".$order->d_city.", ".$order->d_state."\n".
$order->d_country."\n".
$order->d_phone,


Thanks, big improvement!
Will these changes stay or go away in case of update?
Cheers
Rolf
Aw: How to include US state to PDF invoice?

 
07.04.2017 15:51
#14
sulpheraas
Joomshopping forum user no avatar
Name: Eugene
11.07.2008
Posts: 56
Quote
Aw: How to include US state to PDF invoice?

Hello JoomShopping team,
Thank you ever so much for the solution. It works perfect as expected!

P.S. Would be nice to include this patch to the next version of the component.

Best regards,
Eugene.

 
07.04.2017 20:26
#15
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

Yes. Will be in new version.

 
29.04.2017 21:37
#16
sulpheraas
Joomshopping forum user no avatar
Name: Eugene
11.07.2008
Posts: 56
Quote
Aw: How to include US state to PDF invoice?

Ah, one moment.
The solution provided above displays default user address, but we forgot about delivery address which may differs from billing address.

Could anybody advice how to fix the code and display DELIVERY address in PDF invoice instead of default address?

Thanks.

 
29.04.2017 22:07
#17
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

Add sufix d_

Example:
$order->firma_name
change to
$order->d_firma_name

 
30.04.2017 09:48
#18
sulpheraas
Joomshopping forum user no avatar
Name: Eugene
11.07.2008
Posts: 56
Quote
Aw: How to include US state to PDF invoice?

Hi JoomShopping team,

Thank you for the tip! It works now ;-)

To everyone who needs to display delivery address instead of billing address in PDF invoice, go to:
components/com_jshopping/lib/generate_pdf_order.php
According to this post, you have already patched the code to:


$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->state,
$order->country
);


Now replace it to:

$address_data = array(
$order->d_firma_name,
trim($order->d_f_name." ".$order->d_l_name." ".$order->d_m_name),
trim(trim($order->d_street." ".$order->d_street_nr)." ".$order->d_home." ".$order->d_apartment),
trim($order->d_zip." ".$order->d_city).", ".$order->d_state,
$order->d_country
);


Now you wil get delivery address in PDF invoice.


Letzte Änderung: 30.04.2017 09:49
 
07.07.2017 00:10
#19
sulpheraas
Joomshopping forum user no avatar
Name: Eugene
11.07.2008
Posts: 56
Quote
Aw: How to include US state to PDF invoice?

webdesigner - 07.04.2017 20:26
Yes. Will be in new version.


I noticed there is no such modification in Version 4.16.1. It seems you forgot to include it ;-)

 
07.07.2017 21:40
#20
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25919
Quote
Aw: How to include US state to PDF invoice?

in 4.16.1
added

$order->state

 
StartZurück 1 2 WeiterEnde


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.