Jump to content
Sign in to follow this  

Add Spaces To Credit Card Number

Recommended Posts

I was wondering if anyone knew how to change the credit card number details from







Or even just



It would be good if if it showed up like this both when the customer was entering the details as well as on the admin order information page. Makes it easier to read.


Thanks in advance for any help

Edited by sashaben

Share this post

Link to post
Share on other sites

Here is the code to do it:



in /catalog/admin/orders.php,


Search on the word "cc_number".


You will see:


<td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>

<td class="main"><?php $order->info['cc_number']; </td>



Change to:


<td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>

<td class="main"><?php


//py: code to format cc_number with spaces





echo $cc_p1 . '-' . $cc_p2 . '-' . $cc_p3 . '-' . $cc_p4; ?></td>



This will put dashes between groups of 4 numbers.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this