Community Add-Ons

Maintainers: alexjudd
Add file to this package
Top » Payment Modules

Credit Card Expires Month set to current month
for osCommerce Online Merchant v2.2

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))));

Legend:  Download   Report
Expand All / Collapse All
Credit Card Expires Month set to current month alexjudd 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))));