X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   changing months in words to the numerical instead (https://forum.x-cart.com/showthread.php?t=12524)

cotc2001 03-02-2005 08:30 AM

changing months in words to the numerical instead
 
Just noticed something that seems a bit daft to me, if using manual proccessing for cards (or any cc payment method where you take the details on your own site) instead of have the start and expiry month in words i.e January, Febuary, March etc. etc. shouldn't it be 01, 02, 03 etc. etc. i've yet to see a credit card where it is words instead of numbers.

Anyone know of a way how I can change it to the months by numbers instead???

balinor 03-02-2005 08:39 AM

Does the date format in General Settings/Appearance options have effect on it?

cotc2001 03-02-2005 09:20 AM

no i've already got it set as 02-03-05 i.e numericaly

ian_fs 03-02-2005 09:43 AM

Another issue with the payment (manual) process is if you have a Maestro Card for example you sometimes do not have a start date.

X-Cart automatically lists the current month and year for both start and end dates.

I think it should be numerical as you said, but also default be:

-- --
01 01
02 02

etc

That way if you dont have a Start Date you can select -- -- instead of X-Cart showing 02 04 as how do you know that their card really did start on 02 04 or that they dont have a start date and x-cart defaults (if it was that month and year) 02 04.

Jez

cotc2001 03-02-2005 09:54 AM

Yeah i've noticed that as well good idea, in my experience though the start date is pretty much ignored for validation purposes anyway with all card, it seems the expiry date is the only one that is checked.

shan 03-02-2005 10:35 AM

yeh not good this.

should be set to numbers instead

never listed as words on cards etc

cotc2001 03-02-2005 10:43 AM

there must be a template somewhere which has that drop down box in it, it passes numerics so i guess it's just a case of editing it so that description and value are the same, problem is trying to find it though, cant seem to get the right on in webmaster mode

shan 03-02-2005 10:49 AM

main/register_ccinfo.tpl

http://smarty.php.net/manual/en/language.function.html.select.date.php

cotc2001 03-02-2005 10:55 AM

ok so we change html_select_date to ???????? I really cant tell from the smarty manual, it only give demonstration code as what is already happening

shan 03-02-2005 10:57 AM

try this, not tested live though yet

Code:

{* $Id: register_ccinfo.tpl,v 1.21.2.5 2004/07/27 13:22:52 max Exp $ *}
{include file="check_cc_number_script.tpl"}
<TR valign="middle">
<TD height="20" colspan="5"><A name="ccinfo"></A>{$lng.lbl_credit_card_information}<HR size="1" noshade></TD>
</TR>

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_type}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
<SELECT name="card_type">
{section name=card_type loop=$card_types}
<OPTION value="{$card_types[card_type].code}" {if $userinfo.card_type eq $card_types[card_type].code}selected{/if}>{$card_types[card_type].type}</OPTION>
{/section}
</SELECT>
{if $smarty.get.err eq 'fields' && $userinfo.card_type eq ''}<FONT class="Star">&lt;&lt;</FONT>{/if}
{else}
{#safeCCType#}
<INPUT type="hidden" name="card_type" value="{#safeCCType#}">
{/if}
</TD>
</TR>

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_name_explanation}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
<INPUT type="text" name="card_name" size="32" maxlength="50" value="{if $userinfo.card_name ne ""}{$userinfo.card_name}{else}{$userinfo.b_firstname} {$userinfo.b_lastname}{/if}">
{if $smarty.get.err eq 'fields' && $userinfo.card_name eq ''}<FONT class="Star">&lt;&lt;</FONT>{/if}
{else}
{#safeCCName#}
<INPUT type="hidden" name="card_name" value="{#safeCCName#}">
{/if}
</TD>
</TR>

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_number_explanation}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
<INPUT type="text" name="card_number" size="32" maxlength="20" value="{if $smarty.get.err eq 'fields'}{$userinfo.card_number}{/if}">
{if $smarty.get.err eq 'fields' && $userinfo.card_number eq ''}<FONT class="Star">&lt;&lt;</FONT>{/if}
{else}
{#safeCCNum#}
<INPUT type="hidden" name="card_number" value="{#safeCCNum#}">
{/if}
</TD>
</TR>

{if $config.General.uk_oriented_ccinfo eq "Y"}
<TR valign="middle">
<TD align="right">{$lng.lbl_cc_validfrom}</TD>
<TD></TD>
<TD nowrap>
{html_select_date prefix="card_valid_from_" month_format="%m" display_days=false start_year="-5" end_year="+4"}
</TD>
<TD></TD>
<TD>{$lng.lbl_cc_leave_empty}</TD>
</TR>
{/if}

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_expiration}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
{html_select_date prefix="card_expire_"  month_format="%m" display_days=false end_year="+5" time=$userinfo.card_expire_time}
{else}
{#safeCCExp#}
<INPUT type="hidden" name="card_expire" value="{#safeCCExp#}">
{/if}
</TD>
</TR>

{if $payment_cc_data.disable_ccinfo eq "N" || ($payment_cc_data.disable_ccinfo eq "" && $config.General.enable_manual_cc_cvv2 eq 'Y')}
<TR valign="middle">
<TD align="right">{$lng.lbl_cc_cvv2}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
<TABLE cellspacing="0" cellpadding="0" border="0">
<TR>
        <TD valign="middle"><INPUT type="text" name="card_cvv2" size="4" maxlength="4" value="{if $smarty.get.err eq 'fields'}{$userinfo.card_cvv2}{/if}"></TD>
        <TD valign="middle">{include file="main/popup_help_link.tpl" section="cvv2"}</TD>
        {if $smarty.get.err eq 'fields' && $userinfo.card_cvv2 eq ''}
        <TD><FONT class="Star">&lt;&lt;</FONT></TD>
        {/if}
</TR>
</TABLE>
{else}
{#safeCCcvv2#}
<INPUT type="hidden" name="card_cvv2" value="{#safeCCcvv2#}">
{/if}
</TD>
</TR>
{/if}

{if $config.General.uk_oriented_ccinfo eq "Y"}
<TR valign="middle">
<TD align="right">{$lng.lbl_cc_issueno}</TD>
<TD></TD>
<TD nowrap>
<INPUT type="text" name="card_issue_no" size="4" maxlength="2" value="">
</TD>
<TD></TD>
<TD>{$lng.lbl_cc_leave_empty}</TD>
</TR>
{/if}


cotc2001 03-02-2005 11:17 AM

Yup that works perfectly, now just got to sort out the issue with the protx direct script adding a + symbol in place of symbols and passing the order description, never bloody finished is it!!!!!

cotc2001 03-03-2005 08:38 AM

Spoke to x-cart about it, told them that general opinion in the forum is that it is silly the way they display it at the moment and they agreed that in future releases it would be shown numerically (like they do on the acutal credit cards) RESULT!!!

mffowler 09-21-2005 01:44 PM

Still Months in a recent 4.0.15 upgrade...

For anyone needing the change, it is only:

Find:
Code:

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_expiration}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
{html_select_date prefix="card_expire_" display_days=false end_year="+10" time=$userinfo.card_expire_time}
{else}
{#safeCCExp#}
<INPUT type="hidden" name="card_expire" value="{#safeCCExp#}">
{/if}
</TD>
</TR>


Replace with this:
Code:

<TR valign="middle">
<TD align="right">{$lng.lbl_cc_expiration}</TD>
<TD><FONT class="Star">{if $config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout'}*{else}{/if}</FONT></TD>
<TD nowrap colspan="3">
{if #safeCCNum# eq ""}
{html_select_date prefix="card_expire_"  month_format="%m" display_days=false end_year="+5" time=$userinfo.card_expire_time}
{else}
{#safeCCExp#}
<INPUT type="hidden" name="card_expire" value="{#safeCCExp#}">
{/if}
</TD>
</TR>


robertswww 11-08-2005 05:00 PM

To make the credit card month drop-down menu extra clear, I prefer the format:
01 - Jan
02 - Feb
03 - Mar
etc.

If you would like this format, simply modify...
File: /main/register_ccinfo.tpl

And add: month_format="%m - %b"
to this part of the template code:

Code:

{html_select_date prefix="card_expire_" month_format="%m - %b" display_days=false end_year="+10" time=$userinfo.card_expire_time}

Robert

DanUK 01-04-2006 02:18 AM

How do I get the year to read:

05
06
07
08
09

etc rather than the 4 digit default? I thought it might be the time attribute but it's already got time=$userinfo.card_expire_time and I'm not sure where $userinfo.card_expire_time is set?

Thanks

Dan

robertswww 01-04-2006 03:44 AM

Quote:

Originally Posted by DanUK
How do I get the year to read:

05
06
07
08
09

etc rather than the 4 digit default?


You will need to experiment, but here's some tips to help you get started... just as we used "%m" for the 2-digit month (see above posts), you will need to use "%y" for the 2-digit year (note: lower-case "y").

In the File: /main/register_ccinfo.tpl

You will probably need to specify the format, such as:
year_format="%y"
or
date_format="%y"

From the Smarty site:
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century

Here's some Smarty links for more details:
http://smarty.php.net/manual/en/language.modifier.date.format.php
and
http://smarty.php.net/manual/en/language.function.html.select.date.php

Good luck and post your results here when you get a chance.

Robert

DanUK 01-04-2006 03:47 AM

Thanks, hmmm, I'll give that another go as I think that's what I tried this morning...I'll post back if it works.

Dan

DanUK 01-04-2006 04:38 AM

No, neither of those worked. I'm thinking I should actually be adjusting the time attribute as it says "timestamp/YYYY-MM-DD" but I'm not sure if I can replace $userinfo.card_expire_time...

Dan

aaronharkin 03-23-2006 11:59 AM

Re: changing months in words to the numerical instead
 
Quote:

Originally Posted by cotc2001
Just noticed something that seems a bit daft to me, if using manual proccessing for cards (or any cc payment method where you take the details on your own site) instead of have the start and expiry month in words i.e January, Febuary, March etc. etc. shouldn't it be 01, 02, 03 etc. etc. i've yet to see a credit card where it is words instead of numbers.

Anyone know of a way how I can change it to the months by numbers instead???


I contacted support with the same problem & received the following reply:

To implement this you should modify the 'skin1/main/register_ccinfo.tpl' file. Find the following fragments:

a.
---------------------------------------
{html_select_date prefix="card_valid_from_" display_days=false start_year="-5" end_year="+4"}
---------------------------------------

b.
---------------------------------------
{html_select_date prefix="card_expire_" display_days=false end_year="+10" time=$userinfo.card_expire_time}
---------------------------------------

and replace it with this codes:

a.
---------------------------------------
{html_select_date prefix="card_valid_from_" display_days=false start_year="-5" end_year="+4" month_format="%m"}
---------------------------------------

b.
---------------------------------------
{html_select_date prefix="card_expire_" display_days=false end_year="+10" time=$userinfo.card_expire_time month_format="%m"}
---------------------------------------

It worked for me.


All times are GMT -8. The time now is 01:02 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.