hey guys, can you help me please?
I have one problem with generating of an invoice (file phoca.tcpdf.php). I cannot find, how to get payment method. Emails getting this data in this way: $dbpm->p("payment_method_name"). Phoca file getting data from database like this: $hD['dbb']->f('bill_date'). So I would expect something like this: $hD['dbb']->f('payment_method_name') or something similar. I tried maybe million ways how to get this hell payment method. But nothing was right.
Can you help?
Thanks
payment method in invoice
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: payment method in invoice
just add:
print_r($hD);exit; and you will know which data are saved in $hD ... Now I don't have any installation of VM so I cannot try it...
the $hD get values in delivery.pdf.php e.g. logo:
$header['logo'] = $logo;
so try to add e.g.
$header['payment_method_name'] = $dbpm->p("payment_method_name");
and try to see if you get the:
$hD['payment_method_name'] in phoca.tcpdf.php
Jan
print_r($hD);exit; and you will know which data are saved in $hD ... Now I don't have any installation of VM so I cannot try it...
the $hD get values in delivery.pdf.php e.g. logo:
$header['logo'] = $logo;
so try to add e.g.
$header['payment_method_name'] = $dbpm->p("payment_method_name");
and try to see if you get the:
$hD['payment_method_name'] in phoca.tcpdf.php
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 15 Sep 2008, 19:03
Re: payment method in invoice
i cannot work with $dbpm->p("payment_method_name"); in delivery.php. At the beggining of the file you "loading" data like this "function createPDF( $VM_LANG, $d, $dbv, $dbo, $dbb, $dbst, $dbbt, $current_admin_user, $obliterated )". and there is no dbpm. It is corresponding with the file ps_delivery.php, where is SELECT for each argument of function createPDF. Like $dbst = new ps_DB;
$qt = "SELECT * FROM #__{vm}_user_info WHERE user_info_id='". $dbo->f("user_info_id") . "'";
$dbst->query($qt);
$dbst->next_record();
So if I get it well, I need right select command to get data to dbpm in ps_delivery file. Then I can work with that in delivery file and do $header['payment_method_name'] = $dbpm->p("payment_method_name"); And after that all, I can use this $hD['payment_method_name'] in phoca.tcpdf.php. Right? Well, can you give me that SELECT? Thanks a lot.
$qt = "SELECT * FROM #__{vm}_user_info WHERE user_info_id='". $dbo->f("user_info_id") . "'";
$dbst->query($qt);
$dbst->next_record();
So if I get it well, I need right select command to get data to dbpm in ps_delivery file. Then I can work with that in delivery file and do $header['payment_method_name'] = $dbpm->p("payment_method_name"); And after that all, I can use this $hD['payment_method_name'] in phoca.tcpdf.php. Right? Well, can you give me that SELECT? Thanks a lot.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: payment method in invoice
Hi, you right, you should get the payment method from database first (if it is not included in some of other variables - $dbo, $dbv, ...)
but I don't know where the payment method is stored in VM database, so I cannot write the sql query ???
Jan
but I don't know where the payment method is stored in VM database, so I cannot write the sql query ???
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 24 Sep 2008, 07:56
Re: payment method in invoice
hello,
hou can try with this query:
$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();
I think it's good to retrieve the info, let me know if works!
hou can try with this query:
$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();
I think it's good to retrieve the info, let me know if works!
-
- Phoca Member
- Posts: 10
- Joined: 09 Aug 2009, 20:33
Re: payment method in invoice
I know, a bit old, but want to let you know that it works great! I used $dbpm->f("payment_method_name") in delivery.pdf.php to produce not a error.
Thanks so much for that great VM addon Jan!
Tobi
Thanks so much for that great VM addon Jan!
Tobi
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
-
- Phoca Member
- Posts: 10
- Joined: 28 May 2008, 23:59
Re: payment method in invoice
I've opened ~100 files today trying to find where the "Cash on Delivery" payment method is stored. I need to change that text to "Payment Based Upon Our Agreement". Any ideas?
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: payment method in invoice
Hi, this you can change in language string.
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 10
- Joined: 28 May 2008, 23:59
Re: payment method in invoice
Can you be more specific? There are LOTS of language files in this set-up...