Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

changing months in words to the numerical instead

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 03-02-2005, 11:17 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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!!!!!
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #12  
Old 03-03-2005, 08:38 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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!!!
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #13  
Old 09-21-2005, 01:44 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

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>
__________________
4.1.9
Reply With Quote
  #14  
Old 11-08-2005, 05:00 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default

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
__________________
X-cart 4.1.10
Reply With Quote
  #15  
Old 01-04-2006, 02:18 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

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
__________________
4.4.2

and

4.6.1
Reply With Quote
  #16  
Old 01-04-2006, 03:44 AM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default

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
__________________
X-cart 4.1.10
Reply With Quote
  #17  
Old 01-04-2006, 03:47 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

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
__________________
4.4.2

and

4.6.1
Reply With Quote
  #18  
Old 01-04-2006, 04:38 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

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
__________________
4.4.2

and

4.6.1
Reply With Quote
  #19  
Old 03-23-2006, 11:59 AM
 
aaronharkin aaronharkin is offline
 

Newbie
  
Join Date: Mar 2005
Location: UK
Posts: 4
 

Default 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.
__________________
Aaron
X-Cart Gold v. 4.4.5
Location: Ireland / UK
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:20 PM.

   

 
X-Cart forums © 2001-2020