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

Lowercase clean urls

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-14-2010, 03:38 PM
 
almenzies almenzies is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 66
 

Default Lowercase clean urls

Does anyone know how to have the clean url's that are generated to be lowercase?

Cheers,
Al.
__________________
http://www.ergofurniture.com.au
X-Cart Version 4.3.1
Reply With Quote
  #2  
Old 02-14-2010, 06:31 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Lowercase clean urls

Try this: Open include/func/func.clean_urls.php and find
Code:
return $generated_url;
and replace with
Code:
return strtolower($generated_url);

Backup file first, this is not tested
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 02-15-2010, 04:46 PM
 
almenzies almenzies is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 66
 

Default Re: Lowercase clean urls

hey - thanks for the response, that makes perfect sense to me, but doesn't seem to work for some reason!

I've tried converting to lowercase in a few areas and can't seem to find a solution!
__________________
http://www.ergofurniture.com.au
X-Cart Version 4.3.1
Reply With Quote
  #4  
Old 02-15-2010, 05:52 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Lowercase clean urls

This should work when you click "auto generate clean url's" in admin/tools. It won't work when you edit/create product. Where are you trying to have this functionality?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 02-15-2010, 06:15 PM
 
almenzies almenzies is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 66
 

Default Re: Lowercase clean urls

Hey Steve - yeah I'm trying to have the lowercase url generated as the user adds the product to the store.

I've tried auto generating the clean URL's but still no joy - I've also cleared all the cache from my browser and the server.

I've had a look in my DB as well and can't see any change which is strange!
__________________
http://www.ergofurniture.com.au
X-Cart Version 4.3.1
Reply With Quote
  #6  
Old 02-15-2010, 06:39 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Lowercase clean urls

Well the auto generate works only on products without clean urls so if your products have clean urls assign to them already auto generate won't change anything.
Open skin1/check_clean_url.js and find
Code:
to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '');
and after add
Code:
to_field.value = to_field.value.toLowerCase();

Now when you add new product in admin and enter product name and then move out of that field the url will be lower cases
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
almenzies (02-15-2010)
  #7  
Old 02-15-2010, 07:16 PM
 
almenzies almenzies is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 66
 

Default Re: Lowercase clean urls

that's awesome, thanks!
__________________
http://www.ergofurniture.com.au
X-Cart Version 4.3.1
Reply With Quote
  #8  
Old 07-22-2010, 09:40 PM
 
divy divy is offline
 

Member
  
Join Date: May 2010
Posts: 13
 

Default Re: Lowercase clean urls

I try to do this in 4.3.2 and than all of my pages are white screens including the admin part.

How can i do it in 4.3.2 ?

Thanks

Divy
__________________
X-cart 4.3.2
BCSE Product Importer Updater Pro
Smart Search
Reply With Quote
  #9  
Old 07-23-2010, 02:54 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,192
 

Default Re: Lowercase clean urls

It should work in 4.3.2 as well. Double check how you did it
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
divy (07-23-2010)
  #10  
Old 07-23-2010, 03:27 AM
 
divy divy is offline
 

Member
  
Join Date: May 2010
Posts: 13
 

Default Re: Lowercase clean urls

oops. I missed the brackets.

Thanks Steve.

Is there a way to add a additional field (short description, it have only 2-3 words) along with the name of the product in the url as well as in the page title ?

Divy
__________________
X-cart 4.3.2
BCSE Product Importer Updater Pro
Smart Search
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 09:57 PM.

   

 
X-Cart forums © 2001-2020