Hi David,
I would like to remove from my links the special characters and Upper characters.
Currently my category links are like this :
mysite.com/Caméra
I would like instead to have links like this :
mysite.com/camera
There is my project (of php beginner) :
I thought of adding in the product database a new category field, called "category_simplified_name".
For instance :
Category name : Caméra
Category simplifed name : camera
To build the category simplified name I thought of using the category name, then encode it in iso, then use a replace function to remove the special characters, and then a lower case function.
Then i would use the category simplifed name in the links as an ID to get the category info.
Do you thinks this would be possible ? Could you give me some indications on to which file i need to modify in order to import the category simplified name? And on which file
Best regards,
Frédéric
Hi David,
Yes that's exactly what I would like.
Best regards,
Frédéric
Hi Frédéric,
There's quite a few changes required to do this, I'll have a go for you if you could email me
includes/admin.php
categories.php
search.php
And if you could also let me know a list of all the character translations you need, e.g.
é => e
...that would help...!
Cheers,
David.
Hello David
i'm using pricetapestry 15/09A ,
how i can remove all Greek characters from urls, so that urls have only latin
thanks
Hello George,
With the iconv library now commonly installed the tidiest solution is described in this comment which uses iconv("UTF-8","ASCII//TRANSLIT",$text)
to convert non-ASCII characters to their latin equivalent.
Cheers,
David.
--
PriceTapestry.com
Hello David
i saw your reply now
i tried and now removes all greek characters from urls, keep only latin characters
maybe i do something wrong?
Hello George,
Did you include the new line in config.php
setlocale(LC_ALL,"en_US.utf8");
If not, try the above first (changes will only become apparent after import), otherwise if already in place, try instead using:
setlocale(LC_ALL,"el_GR.utf8");
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hello Frédéric,
Do you mean you only want to remove them from the URL, but the actual category field you want to keep the original name?
Cheers,
David.