Page 1 of 1

Shipping address not rendered correctly

Posted: 06 Aug 2008, 16:45
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.

Re: Shipping address not rendered correctly

Posted: 07 Aug 2008, 01:12
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

Re: Shipping address not rendered correctly

Posted: 07 Aug 2008, 10:45
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.

Re: Shipping address not rendered correctly

Posted: 07 Aug 2008, 23:04
by Jan
Ok, thank you for the information... I will change it...

Thank you, Jan