Adding Credit Card Data to Bulk Print Invoices

We need to have the credit card information displayed on the Bulk Print Invoices as we process credit cards offline. Can anyone tell me what pages are involved in making a change like this.

It looks like the Credit Card info is available on order_details.tpl could I just take this code and add it to the bulk print invoice page, assuming the credit card data available to this page already?

What page(s) make the invoice that is printed in the Bulk Print function of the admin.

I’m interested in this too… any info would be appreciated!

The hardest thing was finding all the templates.

1. I first duplicated this page

\skins[your skin]\mail\orders\invoice.tpl

creating a new copy called

\skins[your skin]\mail\orders\invoice_admin.tpl

Remember the skin you using for the admin, not the customer a area, unless their the same skin.

2. Then I added this code to invoice_admin.tpl right between these lines

{* /Customer info *}
add it here, it will appear just after the customer info and just befor the product info
{* Ordered products *}

```php {* Credit Card Info - Added by Marc *}


{if $order_info.payment_info}
{foreach from=$order_info.payment_info item=item key=key}
{if $item}

{$lang.payment_method}: {$order_info.payment_method.payment} ({$order_info.payment_method.description})
{$lang.$key}: {if $key == 'order_status'}{include file="orders_pages/order_status.tpl" status=$item display="view"}{else}{$item}{/if}

{* /Credit Card Info - Added by Marc *} ```

[B]3. The edit /includes/admin/orders.php[/B] Change this line, about 105 and again on 152
```php fn_show_template("orders/invoice.tpl", $smarty_mail);

Change it to use your new invoice template invoice_admin.tpl.

You should be ready to go. It should look like this. (I blocked out the customer and CC info)


Thanks Marc for the code. I have been trying to get this to work. It puts the CC info on the invoice but I am receiving an error for the Order Status.

Warning: Smarty error: unable to read resource: “order_pages/order_status.tpl” in /home/mysite/public_html/cscart/classes/templater/Smarty.class.php on line 1096

Any ideas?

Thank you

You have a typo in your code heysiteguy


should be


yeah… I found that… I changed it to orders/order_status.tpl solved it… i would actually just put the CC type just under payment method in the header… any ideas?

thank you

I hate to bring up old topics, but i do have one quick question. I have implemented the above code into my bulk invoices for my records. I would like to know if it is possible to extract and print only certain items contained within the $order_info.payment_info array. (I’m assuming its an array.)

For example, when i use the above code, this is what it outputs onto my invoice:


Payment method: Secure Credit Card (Visa, Mastercard, etc…)

Card: vis

Card number: XXXXXXXXXXXX1111

Cardholder’s name: xxxxxxxxx

Expiration date: xxxx


AVS verification response: iAVS USA :: Street address match :: ZIP code not match

CVV2 verification response: Match

Order status: Processed

Payment processor response: AuthCode: 0xxxxx1

Transaction ID: V7xxxxxxx17


For my invoices, i only want to print the Payment Processor Response, AuthCode and Transaction ID. This is how i would like it to look:


Payment processor response: AuthCode: 010101

Transaction ID: V78F0C744A17


So i guess what i would like to know is if its possible to just extract those 2 or 3 things out of that $order_info.payment_info.


Okay, well i solved my own problem. lawls.

Use {$order_info|@print_r} to display the entire array. You can then findout which “item” and “key” are assigned to each item. This will help you determine the variables to use. Then you can decide which to print and not to print. (Assuming you want to do what i did which is only print certain items)

Here is the code i used:

{* Credit Card Info - Added by Marc *}


{if $order_info.payment_info}

{$lang.payment_method}: {$order_info.payment_method.payment} ({$order_info.payment_method.description})
{$lang.reason_text}: {$order_info.payment_info.reason_text}
{$lang.transaction_id}: {$order_info.payment_info.transaction_id}

{* /Credit Card Info - Added by Marc *}

I guess i should put in some if statements in case there’s not a transaction_id or a reason_text… But i don’t plan on changing payment processors for a while. >.<

Hope this helps someone else.

I am getting the following error…not sure if some template locations have changed since the original posting date:

Warning: Smarty error: unable to read resource: “orders/invoice_admin.tpl” in /home/rjfindin/public_html/onlinestore/classes/templater/Smarty.class.php on line 1095

any ideas?

I am getting the same area. Does anyone have any idea what has changed?