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

Capitalise First Letters in Customer Info

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 01-15-2008, 08:19 PM
 
JDam JDam is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 4
 

Default Re: Capitalise First Letters in Customer Info

Great mod PhilJ and MoonDog!

This mod should be on the list for one of the top 10 must have mods. So much neater, cleaner and more professional looking... For 4.1 users don't forget post 25 from PhilJ if using Fastlane Checkout.

Thanks again!
__________________
X-CART Gold v4.4
Reply With Quote
  #32  
Old 01-15-2008, 10:17 PM
 
JDam JDam is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 4
 

Default Re: Capitalise First Letters in Customer Info

Since I used MoonDogs mod for 4.1.9 I thought I would give it a try in 4.0.19 and Lo and Behold it worked without a glitch.

Thanks again!!!
__________________
X-CART Gold v4.4
Reply With Quote
  #33  
Old 01-16-2008, 01:08 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Capitalise First Letters in Customer Info

Thanks!
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
  #34  
Old 01-20-2008, 10:55 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Capitalise First Letters in Customer Info

Look. I was testing an i made a profile with my sister name Maria Paula GuimarЦes Pellegrini Rocha and i got one little problem. Because her name have my mother╢s last name "GuamarЦes" with "~" symbol the MOD turns the name from GuimarЦes to GuimarцEs". Any ideas why that happen?

Cya!
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
  #35  
Old 01-20-2008, 08:26 PM
  imexhouse's Avatar 
imexhouse imexhouse is offline
 

eXpert
  
Join Date: May 2006
Location: Canada
Posts: 377
 

Default Re: Capitalise First Letters in Customer Info

Use PhilJ's mod instead.
You have to add those accented characters to this line of capitalize.js:

// if not alpha cap next character
cmp = "ABCDEихкFGH...

Go to the Character Map in Windows Accessories, find the ц character and insert it after 'A', just like you see accented E's above.
That will fix the problem.

Here's the whole mod with some modifications I've made to account for street directions, like SW, SE, NW, NE, and those pesky foreign characters:


////////////////////////////////////////////////////////////////////////
//Capitalise the first letter in a textbox once the value is changed
//Call as follows onChange="Proper(this); return true;"
function Proper(o) {
var s = o.value;
var out = "";
if (s.length > 0) {
var c = true;
// process each character one at a time
for (var i=0; i < s.length; i++) {
var t = s.substring(i,i+1).toUpperCase();
// if not alpha cap next character
cmp = "AцBCгDEихкFGHIJKLMNяOPQRSTUVWXYZ1234567890' ";
if ( cmp.indexOf(t) < 0) {
c = true;
}
else {
if (c) {
c = false;
}
else {
t = t.toLowerCase();
}
}
// take special cases like Mc, Mac De and Roman numerals
if ( i > 1 ) {
temp = s.substring(i-2,i).toUpperCase();
if ( temp == "MC" || temp == "DE" && i < 3 ) {
t = t.toUpperCase();
}
cmp = "R IX XI XX II V X S N";
roman = "RWEIVX";
roman2 = "RWIVX E W ";
if ( cmp.indexOf(temp) >= 0 && roman.indexOf(t.toUpperCase()) >= 0 &&
roman2.indexOf(s.substring(i,i+2).toUpperCase() ) >= 0 ) {
t = t.toUpperCase();
}
}
if ( i > 2 ) {
temp = s.substring(i-3,i).toUpperCase();
if ( temp == "MAC" && i < 4 ) {
t = t.toUpperCase();
}
if ( ( temp == " XI" || temp == " VI " || temp == " XX " || temp == "XV" || temp == " RR" ) && (t.toUpperCase() == "I" || t.toUpperCase() == "X" || t.toUpperCase == "R" ) ) {t = t.toUpperCase();
}
} out += t;
}
o.value = out;
} return true;
}



Jack
__________________
Jack@AquasanaCA
X-CART GOLD 4.0.19 Live
DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts
AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America!
X-CART GOLD 4.4.5 Live
CDSEO Pro v. 1.8.4
AquasanaMontreal.com
Aquasana╝ & Rhino Water Filtration Systems
Reply With Quote
  #36  
Old 01-21-2008, 05:25 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Capitalise First Letters in Customer Info

Good now. But when i try to put "ñinho" come up to be "ÑInho". Any ideas why captilise the "I" whe supose to be "i"? Thanks!

PS i got the space out, before the "Th".
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
  #37  
Old 01-21-2008, 06:18 AM
  imexhouse's Avatar 
imexhouse imexhouse is offline
 

eXpert
  
Join Date: May 2006
Location: Canada
Posts: 377
 

Default Re: Capitalise First Letters in Customer Info

Did you include the я in the cmp= line?
__________________
Jack@AquasanaCA
X-CART GOLD 4.0.19 Live
DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts
AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America!
X-CART GOLD 4.4.5 Live
CDSEO Pro v. 1.8.4
AquasanaMontreal.com
Aquasana╝ & Rhino Water Filtration Systems
Reply With Quote
  #38  
Old 01-21-2008, 08:31 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Capitalise First Letters in Customer Info

Which one?
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
  #39  
Old 01-21-2008, 08:38 AM
  imexhouse's Avatar 
imexhouse imexhouse is offline
 

eXpert
  
Join Date: May 2006
Location: Canada
Posts: 377
 

Default Re: Capitalise First Letters in Customer Info

The one that has all the letters of the alphabet. You have to include every letter you don't want capitalized. There was no я there, so it didn't work with your Яinho.
Just insert it after N.

Jack
__________________
Jack@AquasanaCA
X-CART GOLD 4.0.19 Live
DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts
AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America!
X-CART GOLD 4.4.5 Live
CDSEO Pro v. 1.8.4
AquasanaMontreal.com
Aquasana╝ & Rhino Water Filtration Systems
Reply With Quote
  #40  
Old 01-21-2008, 09:33 AM
 
sales@webosusa.com sales@webosusa.com is offline
 

Senior Member
  
Join Date: Nov 2007
Location: Australia
Posts: 118
 

Default Re: Capitalise First Letters in Customer Info

Thanks!
__________________
Pedro
digitalnotions.i2u.shop
shop.modestclassy.com.au4.1.9 X-Cart
X-Cart
Business 5.3.6.0
Multi-vendor 5.3.6.0


Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 07:49 PM.

   

 
X-Cart forums © 2001-2020