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

Credit Card Expiry Date Length

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-26-2004, 12:55 AM
 
DanUK DanUK is offline
 

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

Default Credit Card Expiry Date Length

I notice the CC expiry date is only 4 digits and doesn't seem to cater for customers who format it incorrectly e.g. put a space/dash/slash in between the numbers e.g. 04-06 which would end up as 04-0 on the order.

I guess you can change the field length easily? What is the ratio of having to contact people who put the number in wrongly or am I worrying too much?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #2  
Old 02-26-2004, 06:33 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

You can always create two drop downs for the exp. date and then re-combine the values in payment_cc.php
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 02-27-2004, 09:06 PM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default code for combining two fields using php?

Hi boomer,

What code is used to join 2 fields?

Thanks,
Chris
Reply With Quote
  #4  
Old 02-27-2004, 11:01 PM
 
akyuznet akyuznet is offline
 

Member
  
Join Date: Sep 2003
Posts: 28
 

Default same problem for me

same problem for me 5 percent of the customers make this mistake,,

is there any way to solve this problem?
Reply With Quote
  #5  
Old 03-01-2004, 07:07 AM
 
DanUK DanUK is offline
 

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

Default

The X-Cart team have given me the instructions to make my field size bigger which will work with offline payments:

Quote:
You can increase the length of the field, just edit the 'skin1/main/register_ccinfo.tpl' template and replace the line

Code:
<input type=text name=card_expire size=4 maxlength=4 value="">

with

Code:
<input type=text name=card_expire size=5 maxlength=5 value="">
Also, you should apply the following patch under the "Patch/upgrade -> Apply SQL patch" section of the admin interface:

Code:
alter table xcart_customers modify card_expire varchar(5) NOT NULL default '';

However, if you are going to use a credit card processor (not manual processing), a slight additional modification will be required.

For the select boxes, and I need some guidance here, I was thinking of changing this code in register_ccinfo.tpl:

Code:
<input type=text name=card_valid_from size=4 maxlength=4 value="">

to something like:

Code:
<select name=card_expire_month> <option value="01">01</OPTION> <option value="02">02</OPTION> <option value="03">03</OPTION> <option value="04">04</OPTION> <option value="05">05</OPTION> <option value="06">06</OPTION> <option value="07">07</OPTION> <option value="08">08</OPTION> <option value="09">09</OPTION> <option value="10">10</OPTION> <option value="11">11</OPTION> <option value="12">12</OPTION> </select> <select name=card_expire_year> <option value="01">2001</OPTION> <option value="02">2002</OPTION> <option value="03">2003</OPTION> <option value="04">2004</OPTION> <option value="05">2005</OPTION> <option value="06">2006</OPTION> <option value="07">2007</OPTION> <option value="08">2008</OPTION> <option value="09">2009</OPTION> <option value="10">2010</OPTION> <option value="11">2011</OPTION> <option value="12">2012</OPTION> etc etc etc </select>

and then concatenating the two fields like so in payment_cc.php:

Code:
$order_details = ""; [THIS BIT HERE!] $card_expire = $card_expire_month . $card_expire_year;

This is just a guess based on reading some information on concatenating strings in php. Am I on the right track?

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #6  
Old 03-01-2004, 11:48 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Dan, your modifications look good to me.

Yes, . (period) is the concat equivalent to combine two strings.

__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #7  
Old 03-09-2004, 06:04 AM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default Code question

What changes need to be made to the code? My specific concern is the value="{$userinfo.card_expire}"


Original code in the register_ccinfo.tpl:

<input type=text name=card_expire size=4 maxlength=4 value="{$userinfo.card_expire}">


New code in the register_ccinfo.tpl:

<select name=card_expire_month>
<option value="01">01</OPTION>
<option value="02">02</OPTION>
<option value="03">03</OPTION>
<option value="04">04</OPTION>
<option value="05">05</OPTION>
<option value="06">06</OPTION>
<option value="07">07</OPTION>
<option value="08">08</OPTION>
<option value="09">09</OPTION>
<option value="10">10</OPTION>
<option value="11">11</OPTION>
<option value="12">12</OPTION>
</select>
<select name=card_expire_year>
<option value="04">2004</OPTION>
<option value="05">2005</OPTION>
<option value="06">2006</OPTION>
<option value="07">2007</OPTION>
<option value="08">2008</OPTION>
<option value="09">2009</OPTION>
<option value="10">2010</OPTION>
<option value="11">2011</OPTION>
<option value="12">2012</OPTION>
</select>

Thanks,
Chris
Reply With Quote
  #8  
Old 03-09-2004, 06:25 AM
 
DanUK DanUK is offline
 

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

Default

Not sure of your version of X-Cart but I'm on 3.5.4 and the code is:

Code:
<input type=text name=card_expire size=4 maxlength=4 value="">

I still haven't tried this hack yet though .

I'm not sure what your code you posted is trying to do, as it looks like the $userinfo.card_expire has already been given a value, so I would guess the change needs to happen elsewhere, at an earlier stage perhaps.

Maybe some of the guru's would like to comment.

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #9  
Old 03-15-2004, 05:47 PM
  jeffwill's Avatar 
jeffwill jeffwill is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: US
Posts: 41
 

Default CC Expiry Date Problems

I have also had about 7% of my orders with the CC expiry date jacked up. Since the field is only 4 digits it doesn't seem to cater for customers who format it incorrectly e.g. put a space/dash/slash in between the numbers e.g. 04-06 or more often 1/06, which doesn't allow me to process the order and delays shipment, which tends to make customers unhappy.

The cart performance is a direct reflection of the type of business I run, so I would like to resolve the issue quickly. Since I'm still not an expert, I would appreciate EXACT instructions from a "Guru" who can tell me how to perform the mod.

What I've found in this post doesn't exactly give me the confidence I need to move forward, too many unanswered questions...

Thanks,
__________________
X-Cart ver 3.4.14 (LIVE!)
PHP 4.3.8
MySQL server 4.1.15-log
Web server Apache/1.3.29
Operation system FreeBSD

X-Cart ver 4.0.9 (Dev)
PHP 4.3.4 Details
MySQL server 4.0.18
MySQL client 3.23.49
Reply With Quote
  #10  
Old 03-15-2004, 08:27 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

skin1/main/register_ccinfo.tpl

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"}*{else}{/if}</font></td> <td nowrap colspan=3> {if #safeCCNum# eq ""} <input type=text name=card_expire size=4 maxlength=4 value="{$userinfo.card_expire}"> {else} {#safeCCExp#} <input type=hidden name=card_expire value="{#safeCCExp#}"> {/if} </td> </tr>

Comment or remove the above code, replace it with:

Code:
<tr valign=middle> <td align=right>{$lng.lbl_cc_expiration}</td> <td><font class=Star>{if $config.General.check_cc_number eq "Y"}*{else}{/if}</font></td> <td nowrap colspan=3> {html_select_date prefix="card_expire_" time=$time start_year="-2" end_year="+8" display_days=false} </td> </tr>

Now edit include/register.php

After hacking attempt print (around line 51) add:

Code:
$card_expire = $card_expire_Month.substr($card_expire_Year,2,2);

donations: paypal@molotovbliss.com

I'm also moving this thread to Custom Mods
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
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 08:46 AM.

   

 
X-Cart forums © 2001-2020