Contributions

Payment Modules (Category Index)
Search: 

Credit Card Expires Month set to current month

A very simple modification to make the default expiry month of the credit card to be the current month of the year, not January as it is by default.

This means that the customer, and shop owner when testing, start with a valid expiry month.

/includes/modules/payment/cc.php

Ln: 85 (add)

$today_month = $today['mon'];

Ln: 94 (modify)

[replace]

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));

[with]

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month, $today_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));

Expand All / Collapse All

Credit Card Expires Month set to current month 12 Dec 2006

A very simple modification to make the default expiry month of the credit card to be the current month of the year, not January as it is by default.

This means that the customer, and shop owner when testing, start with a valid expiry month.

/includes/modules/payment/cc.php

Ln: 85 (add)

$today_month = $today['mon'];

Ln: 94 (modify)

[replace]

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));

[with]

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month, $today_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));

Note: Contributions are used at own risk.