Shipping address not rendered correctly

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
G64
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 28 Jul 2008, 14:10

Shipping address not rendered correctly

Post by G64 »

Hi Jan,

I have the plugin now working after i upgraded to VM1.1.2 :)

One thing i noticed is that the Ship To address isn`t rendered correctly. It shows only the first name from the Ship To address. I tried working in the code but not a very experienced PHP coder so i don`t know all the syntaxes etc. . What i did find in the SQL is that a Ship to address has ST on the address_type and a Bill To address had BT. Dut i don`t have a clue how i could arrange that it would select between ST or BT. I noticed there are no seperate fields for i.e. shipto_last_name or something like that. I tried adding the last_name field to the line that has the ship to name but it picks the last name from the Bill To address.

Is there any way you can help me with this ?

Thank you.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48041
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shipping address not rendered correctly

Post by Jan »

:idea: I can dispay you the files where the shipto is rendered:
see:
administrator\components\com_virtuemart\pdf\phoca.tcpdf.php

there is:

Code: Select all

$this->Cell(0,0,$hD['dbst']->f("first_name"),0,0,'L');
on line 158
so maybe there should be something like that:

Code: Select all

$this->Cell(0,0,$hD['dbst']->f("first_name") . $hD['dbst']->f("middle_name").$hD['dbst']->f("last_name"),0,0,'L');
Jan
If you find Phoca extensions useful, please support the project
G64
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 28 Jul 2008, 14:10

Re: Shipping address not rendered correctly

Post by G64 »

Awesome Jan,

It worked. The trick to select the ST (ShipTo) address in the database is to use the: ['dbst'] to select the ShipTo and to use the BT (Bill To) address you should use ['dbbt']. You knew this already of course, but for people who don`t know much php this does the trick.

Thanks a million.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48041
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Shipping address not rendered correctly

Post by Jan »

Ok, thank you for the information... I will change it...

Thank you, Jan
If you find Phoca extensions useful, please support the project
Post Reply