1

I have a Magento ver. 1.9.2.4 with friendly url rewrite active. It works, but it is replacing special characters as 'ñ' with '-' and I need to replace them with 'n'.

Now if the product is, for example, named 'piña' in the url rewrite is changed to 'pi-a', and I want to change it to 'pina'.

I do not find any option to change this in the backend, only the URL Rewrite management, but changing it one by one is not an option.

Where is the url rewrite code? I'm thinking about replacing 'ñ' character to 'n' in the string before the url encode, but I'm not finding the code.

0

Finally I've found a solution and I post it here hoping it helps somebody in the future.

There is an asociative array named $_convertTable, that acts like a conversion table, placed in app/code/core/Mage/Catalog/Helper/Product/Url.php .

In this array there are all the special character conversions, and surprisingly there is no 'ñ' character and there is no 'Ñ' character.

So the solution is override the file. Copy this file in app/code/local/Mage/Catalog/Helper/Product/Url.php and add 'ñ' => 'n', 'Ñ' => 'n', (or the desired characters with their equivalence) at the end of the $_convertTable array.

  • Nice solution! This might be something which is usefull for Magento core I guess. – Akif Sep 6 '18 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.