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)
-   -   Credit Card Expiry Date Length (https://forum.x-cart.com/showthread.php?t=6434)

DanUK 02-26-2004 12:55 AM

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? :wink:

Thanks

Dan

B00MER 02-26-2004 06:33 AM

You can always create two drop downs for the exp. date and then re-combine the values in payment_cc.php

Chris B 02-27-2004 09:06 PM

code for combining two fields using php?
 
Hi boomer,

What code is used to join 2 fields?

Thanks,
Chris

akyuznet 02-27-2004 11:01 PM

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

is there any way to solve this problem?

DanUK 03-01-2004 07:07 AM

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

B00MER 03-01-2004 11:48 AM

Dan, your modifications look good to me.

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

:wink:

Chris B 03-09-2004 06:04 AM

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

DanUK 03-09-2004 06:25 AM

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 :wink:.

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

jeffwill 03-15-2004 05:47 PM

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,

B00MER 03-15-2004 08:27 PM

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


All times are GMT -8. The time now is 07:11 AM.

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