View Single Post
  #4  
Old 10-03-2013, 04:50 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Clean Url first letter

Here is a way to do it with .htaccess or httpd.conf:
http://www.askapache.com/htaccess/rewrite-uppercase-lowercase.html

You could write a mysql query that would change all the entries in the database using the Lower() function:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_lower

To get it to be lowercase from now on automatically:
http://stackoverflow.com/questions/154862/convert-javascript-string-to-be-all-lower-case

Edit /common_files/js/check_clean_url.js
Look at line 69 and find:
to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '');

Change it to:
to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '').toLowerCase();;

All we have done is added ".toLowerCase();" to the end of the JavaScript expression. This will work for all new products you create that don't have a clean url value. Or if you remove the Clean URL and make some change to the product name than it will rewrite it for you.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote