X-Cart:Renaming months

From X-Cart 4 Classic
Jump to: navigation, search

Starting from X-Cart v4.1.x months are formed with language variables. To translate months you should edit corresponding labels in 'Languages' section. There are full names - "lbl_month_fullname_[number]", and abbreviation - "lbl_month_abbr_[number]".

For previous versions

Previous X-Cart versions don't have those text labels. However, if you want to translate months you can make the following modifications.

You need edit file Smarty-2.x.x/plugins/function.html_select_date.php as follows. Find this code:

$month_names = array();
$month_values = array();

for ($i = 1; $i <= 12; $i++) {
$month_names[] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
$month_values[] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
}

and replace with:

$month_names = array();
$month_values = array();

$cust_month = array ("",
" month 1",
" month 2",
" month 3",
" month 4",
" month 5",
" month 6",
" month 7",
" month 8",
" month 9",
" month 10",
" month 11",
" month 12" );

for ($i = 1; $i <= 12; $i++)
{
$month_names[] = $cust_month[$i];//strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
$month_values[] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
}

putting real months' names instead of "month1"-"month12"