X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Lowercase clean urls (https://forum.x-cart.com/showthread.php?t=52342)

almenzies 02-14-2010 03:38 PM

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

Cheers,
Al.

cflsystems 02-14-2010 06:31 PM

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

almenzies 02-15-2010 04:46 PM

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!

cflsystems 02-15-2010 05:52 PM

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?

almenzies 02-15-2010 06:15 PM

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!

cflsystems 02-15-2010 06:39 PM

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

almenzies 02-15-2010 07:16 PM

Re: Lowercase clean urls
 
that's awesome, thanks!

divy 07-22-2010 09:40 PM

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

cflsystems 07-23-2010 02:54 AM

Re: Lowercase clean urls
 
It should work in 4.3.2 as well. Double check how you did it

divy 07-23-2010 03:27 AM

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


All times are GMT -8. The time now is 09:01 AM.

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