| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
User Friendly Credit Card Field Mod | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
User Friendly Credit Card Field Mod
In his book "Don't Make Me Think" by Steve Krug (go read it), he states things that Diminish the Good Will of our customers.
"Punishing me for not doing things your way. I should never have to think about formatting data: whether or not to put dashes in my Social Security number, spaces in my credit card number, or parentheses in my phone number. Many sites perversely insist on no spaces in credit card numbers, when the spaces actually make it much easier to get the number right. Don't make me jump through hoops just because you don't want to write a little bit of code." So, in the default Xcart install, the credit card field has these words. Credit card number (no spaces or dashes) Why don't we just implement some Javascript that strips out the none numbers when they try to submit. EASY. Obligatory Disclaimers 1. I am using Credit Card verification, I don't think this will work without enabling that. 2. I use 4.0.12, it may be fixed in a new version. 3. This could completely destroy your Xcart store (but probably not). Ready? Open skin1/check_cc_number_script.tpl Change this code Code:
To this code Code:
Basically, this just strips out the none numbers from the Credit card number and then if it passes the check, writes it back to the Credit Card input field before proceeding to submit the form. Man that was easy.
__________________
No longer using Xcart, was good while it lasted. |
|||||||
#2
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
WOW That was easy! and works like a charm.
Thanks!@
__________________
Version 4.1.8 |
|||||||
#3
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
can this work in 4.1 seems the Open skin1/check_cc_number_script.tpl has changed
__________________
Version 4.1.8 |
|||||||
#4
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
I'd like to use this too, I have 4.1.0.
The code is now in /check_cc_number_script.js not/check_cc_number_script.tpl The code is as follows: /* Check CC number */ function checkCCNumber(field_cc, field_accepted) { var cc = field_cc.value; var accepted = (field_accepted != null) ? [card_types[field_accepted.value]] : null; if (isCreditCard(cc, accepted)) return true; alert(txt_cc_number_invalid); field_cc.focus(); field_cc.select(); return false; } I tried this, but it didn't work: /* Check CC number */ function checkCCNumber(field_cc, field_accepted) { var original_cc=field_cc.value; var cc=field_cc.value.replace(/[^\d]/g, ''); var accepted = (field_accepted != null) ? [card_types[field_accepted.value]] : null; if (isCreditCard(cc, accepted)){ field_cc.value = cc; return true; }else { alert(txt_cc_number_invalid); field_cc.focus(); field_cc.select(); return false; } } If anybody could fix this it would be very useful, can anybody help?
__________________
X-Cart Gold Version 4.3.2 |
|||||||
#5
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
Works as posted previously in 4.1 using cc verification.
File is different - you need to change the function in skin1/check_cc_number_script.js
__________________
Jeanne 4.1.8 Gold |
|||||||
#6
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
Works fine in 4.1.9
__________________
4.3.1 rounded white template one page checkout |
|||||||
#7
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
This looks like a very useful mod, but how do you enable credit card verification?
__________________
X-Cart 4.3.0 Gold |
|||||||
#8
|
|||||||||
|
|||||||||
Re: User Friendly Credit Card Field Mod
When (if?) you get a merchant account and gateway, and the gateway is properly set up in X-cart, the credit card verification will happen automatically. In Admin, go to 'Payment methods'. Look at the pulldown menu at the bottom where you select a payment gateway.
The merchant account is who charges your customers and sends the money to you. The gateway account is who verifies that the card is good and sends the authorization to charge to the merchant account. For some accounts, the merchant and gateway are the same. If you don't have card verification, and customer can type in anything for a card number, including text and spaces, and X-cart will accept it.
__________________
Bullfrog ~~~ X-Cart Gold v4.7.2 (2) v4.7.8. ⌠If the road is easy, you're likely going the wrong way.■ ― Terry Goodkind |
|||||||||
#9
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
Thank You bullfrog!
__________________
X-Cart 4.3.0 Gold |
|||||||
#10
|
|||||||
|
|||||||
Re: User Friendly Credit Card Field Mod
Nice..I was looking to do this to mine, yet the code you say to change, doesnt match up to what mine is now......So im unsure what to do
This what mine shows {* $Id: check_cc_number_script.tpl,v 1.21.2.1 2007/09/12 12:21:17 ferz Exp $ *} <script type="text/javascript" language="JavaScript 1.2"> <!-- var card_types = new Array(); var card_cvv2 = new Array(); {foreach from=$card_types item=c} card_types["{$c.code}"] = "{$c.type}"; card_cvv2["{$c.code}"] = "{$c.cvv2}"; {/foreach} var force_cvv2 = {if $payment_cc_data.disable_ccinfo eq "N" && ($config.General.check_cc_number eq "Y" || $smarty.get.mode eq 'checkout')}true{else}false{/if}; var txt_cc_number_invalid = "{$lng.txt_cc_number_invalid|strip_tags|escape:jav ascript}"; var current_year = parseInt(('{$smarty.now|date_format:"%Y"}').replac e(/^0/gi, "")); var current_month = parseInt(('{$smarty.now|date_format:"%m"}').replac e(/^0/gi, "")); var lbl_is_this_card_expired = "{$lng.lbl_is_this_card_expired|strip_tags|escape: javascript}"; var lbl_cvv2_is_empty = "{$lng.lbl_cvv2_is_empty|escape:javascript}"; var lbl_cvv2_isnt_correct = "{$lng.lbl_cvv2_isnt_correct|escape:javascript }"; var lbl_cvv2_must_be_number = "{$lng.lbl_cvv2_must_be_number|escape:javascript}" ; --> </script> {include file="main/include_js.tpl" src="check_cc_number_script.js"}
__________________
Regards, Dan X-Cart Gold Version 4.1.10 1 - One page checkout 2 - Image Generator 3 - CSDEO Pro 4 - Shop By Price 5 - Next - Previous 6 - On Sale 7 - Shop By Price 8 - Froogle & Google Base Feed 9 - Buy Together 10 - Customer Loyalty Points 11 - Customer Reward Points Customer Reward Points Referral Add-on 12 - Product Reviews 13 - Other Custom Modifications ---------------------- http://www.townsqjewelry.com/ http://www.eroticnights4u.com/ <---- Adult Oriented - Toys |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|