Jump to content

Anyone knows how to rewrite friendly-url for å and ö=a and o?


oklok

Recommended Posts

So Prestashop V.1.7 have this std setting in friendly URL to re-write ö=oe , ä=ae, any tips on how to proceed to make so the automatic friendly url rewrite ö= o and ä=a?

For sure can enable accented URL but not recommended as some browser not compatible with åäö so preferbly is as mention above.

Link to comment
Share on other sites

15 hours ago, 4you.software said:

./classes/Tools.php

Find function replaceAccentedChars

Thanks all!

Maybe I did wrong but nothing happens when I change the unicode to the correct one, for example Ö should become o in friendly url.
(cash cleaned but still same outout ö=oe)

As reference (http://www.tachyonsoft.com/uc0000.htm#U00D6)

å: 00E5

ä: 00E4

ö: 00F6

Å: 00C5

Ä: 00C4

Ö: 00D6

The code:

$patterns = [
            /* Lowercase */
 /* oe */ '/[\x{00F6}]/u',

/* Uppercase */
 /* OE */ '/[\x{00D6}]/u',

 

Link to comment
Share on other sites

9 minutes ago, 4you.software said:
 
static $allow_accented_chars = null;

$str = str_replace(array('Ö', 'ö', 'Ë', 'ë'), array('O', 'o', 'E', 'e'), $str);

 

 

Thx.

Am I doing something wrong here? did not get it to work...

screenshot1.png

Link to comment
Share on other sites

5 minutes ago, 4you.software said:

Where is it not visible?
You have to open where the badly generated url is and have it generated again, or write a script to change all the urls stored in the database.

When generating a new cms page and insert something in title it still generates oe. I will test again, and again thanks for your advice.

Write script for old url, ok noted.

Edited by oklok (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...