payment method in invoice

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
Tobiwankenobi
Phoca Member
Phoca Member
Posts: 10
Joined: 09 Aug 2009, 20:33

Re: payment method in invoice

Post by Tobiwankenobi »

Hi,

try to change it on the backend, because it's stored in the database.

Components - Virtuemart - Store - List Payment Methods

Then change 'Cash on delivery' or add your new payment method.

Hope it helps...

Regards
Tobiwankenobi
SamuTnT
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 23 Mar 2009, 17:31

Re: payment method in invoice

Post by SamuTnT »

Hi Guys.. i can't get this to work..what i've done is:

add

Code: Select all

$dbpm = new ps_DB;
$q = "SELECT * FROM #__{vm}_payment_method, #__{vm}_order_payment WHERE #__{vm}_order_payment.order_id='".$d['order_id']."'";
$q .= "AND #__{vm}_payment_method.payment_method_id=#__{vm}_order_payment.payment_method_id";
$dbpm->query($q);
$dbpm->next_record();
in ps_delivery.php

then add

Code: Select all

$header['payment_method_name'] = $dbpm->p("payment_method_name");
in delivery.pdf.php

and in the end add

Code: Select all

$hD['payment_method_name']
or

Code: Select all

$hD['dbpm']->p('payment_method_name')
...but nothing happens... what am i doing wrong?? :oops: :oops:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

Hi, in the code, you have pasted here, there is no output code (no code which display something), so if you have not added some output then nothing will be displayed from your code. :idea: :(

Jan
If you find Phoca extensions useful, please support the project
BW82299
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 31 Mar 2011, 14:03

Re: payment method in invoice

Post by BW82299 »

I have to include the payment method too. But the solutions decribed before are not helpfull.

The variables should be changed in plugins/phocapdf/virtuemartpdfoutput.php, the invoice is generated in plugins/phocapdf/tmpl.invoice.php. Something like this: .JText::_('PLG_PHOCAPDF_VM_DELIVERY_PRINT_PAYMENT_METHOD_LBL').': </td><td width="35%">'.$a['payment_method_name'].'
But this code does not work, only PLG_PHOCAPDF_VM_DELIVERY_PRINT_PAYMENT_METHOD_LBL is shown in the .pdf.

The code $a['payment_method_name'] = sprintf("%08d", $dbb->payment_method_name); in the virtuemartpdfoutput.php results in 0000000.

The payment method is stored in the database `jos_vm_payment_method` payment_method_name. In my installation, delivery.pdf.php and phoca.tcpdf.php don´t exist.

Does anybody have an idea, where I´m wrong? :cry:
SpaceJam
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 06 Jun 2011, 20:53

Re: payment method in invoice

Post by SpaceJam »

Hi

I also would like to include the payment_method in the invoice. I tried to call it in the virtuemartpdfoutput.php, but it doesn't work.
So maybe someone already has a solution for that problem?

Ok I found the solution. Just search in your virtuemartpdfoutput.php

Code: Select all

/*
		$var	= array('order_id' => $dbo->order_id);
		$dbp	= PhocaPDFVirtueMartHelper::dbQ('dbp', $var);
		$a['payment_method']	= $dbp->payment_method_name;
		*/
and decomment. Then call via $a['payment_method'] in your tmpl.invoice.php

Thanks in advance
Miriam
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

Ok, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
adria17860
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 28 Jun 2011, 12:42

Re: payment method in invoice

Post by adria17860 »

Hi

I tried the SpaceJam method

decomment this in virtuemartpdfoutput.php:

$var = array('order_id' => $dbo->order_id);
$dbp = PhocaPDFVirtueMartHelper::dbQ('dbp', $var);
$a['payment_method'] = $dbp->payment_method_name;

And call in tmpl.invoice.php:

'<td width="20%">'.JText::_('payment method').': </td><td width="35%">'. $a['payment_method'] .'</td>'

but doesn't show the payment_method :( , please can you help me?
Post Reply