Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Trying to print payment method on invoice  (Read 4442 times)

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Trying to print payment method on invoice
« on: January 09, 2017, 05:35:09 PM »
Any idea how can I print payment method on invoice $paymentOption tried few things but couldn't make it work

\admin\view\default\template\responses\sale\order_invoice.tpl

Able to change html but not able to display the value of variable $paymentOption = default_COD I am not able to print default_COD

I also tried storing variable in cookie and then using it as php variable but still no success

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: Trying to print payment method on invoice
« Reply #1 on: January 09, 2017, 06:51:16 PM »
have you be altering core coding?   Out of the box -  AbanteCart prints the payment method on the email invoice as shown here:
Order ID: [/color]18[/size][/b][/color]
 Date Ordered: 06/01/2017
 Payment Method: Cash On Delivery
 Shipping Method: Flat Shipping Rate

[/size]
[/color]It also shows up on the invoice when access thru the admin side.

So I would suggest you've managed to amend something that is giving you a different result. 
[/size]

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Trying to print payment method on invoice
« Reply #2 on: January 10, 2017, 10:44:19 AM »
llegrand : It doesnt show payment method in my invoice even if looked from admin panel. I am using v 1.2.8  is there any setting that you need to turn on or something?

Offline CalSci

  • Newbie
  • *
  • Posts: 6
  • Karma: +2/-0
    • View Profile
Re: Trying to print payment method on invoice
« Reply #3 on: May 02, 2019, 01:04:34 AM »
I've figured it out. You have to go to

cart slash admin slash controller slash response slash sale slash invoice.php

Inside:
$this->data['orders'][] = array(
Look for the line:
'total' => $total_data

After the last line in orders add a comma and pament_method_key so it looks like this:
'total' => $total_data,
'payment_method' => $order_info['payment_method_key']

That will add the appropriate data to the orders variable before it gets passed to the invoice.

After that go to edit
cart slash admin slash view slash default slash template slash responses slash sale slash order_invoice.tpl

and add the line:
<?php echo $order['payment_method']; ?>
Where you want the payment method.

Apologies for the awkward formatting; this is a new account so I can't post links or code.



 

Powered by SMFPacks Social Login Mod