Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Credit Card Month menu by number not month name?

Credit Card Month menu by number not month name?

Locked

Views: 2,213

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
11 Jan 2007, 7:02 AM
#1
re_active avatar

re_active

New Zenner

Join Date:
May 2006
Location:
Bay area, California
Posts:
10
Plugin Contributions:
0

Credit Card Month menu by number not month name?

Hi All,

I've tried modding the php script to show in Step 2 of the checkout page payment info box, CC Month drop down menu to display: (01) January, (02) February etc. but so far not made it work.

Now, this may seem like an odd request, but I've seen (on another site I have) customers often entering the wrong month and having the CC rejected. Yes, apparently some people do have trouble counting months. Anyway, I changed it on that site (non- Zen cart) and now have no issues with the month Name Versus Month Number during checkout.

Any pointers on what to mod will be greatly appreciated.

Thanks!
Bruce

Zen cart V1.3.02 with security updates, Innovative Merchant (Quickbooks Merchant Account) module.

11 Jan 2007, 6:20 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

The array used in the dropdown is built dynamically using native MYSQL functionality. In your module you will find %B used to build the expiration months. To use the number of the month you can use %m. (note: those are case sensitive and I have not tested that change.)

11 Jan 2007, 6:37 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

    for ($i=1; $i<13; $i++) {
      $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
    }

You should have some sort of statement sililar to the above in your payment module file.

Change the '%B' to '(%m) - %B' to get (01) - January etc.

Be sure to test thoroughly before going live with changes and back up first!!!

11 Jan 2007, 6:55 PM
#4
re_active avatar

re_active

New Zenner

Join Date:
May 2006
Location:
Bay area, California
Posts:
10
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

Thanks Kim!

I'll test and report back.

12 Jan 2007, 8:16 AM
#5
re_active avatar

re_active

New Zenner

Join Date:
May 2006
Location:
Bay area, California
Posts:
10
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

I tried the mod as you described and it worked perfectly.

Thanks for you help. The development team is doing a fantactic job!

Bruce

12 Jan 2007, 7:00 PM
#6
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

Thanks for letting us know that adding the month's number to the function helped. Don't forget how we all love coffee. :D

17 Jan 2007, 11:46 PM
#7
re_active avatar

re_active

New Zenner

Join Date:
May 2006
Location:
Bay area, California
Posts:
10
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

Kim:

Thanks for letting us know that adding the month's number to the function helped. Don't forget how we all love coffee. :D

Your Coffee has been served. :wink2:

For those (who like me) were having trouble finding the cafe, here's link:
http://www.zen-cart.com/index.php?main_page=infopages&pages_id=14

18 Jan 2007, 12:11 AM
#8
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Credit Card Month menu by number not month name?

Thanks!! We appreciate the support.