Jump to content

And work with cold Russian...


Recommended Posts



find this

public static function link_rewrite($str, $utf8_decode = false)
 return Tools::translit($str); <-- Make it
 //~ return Tools::str2url(Tools::translit($str)); <-- Comment it

after this, type next code

public static function translit($str)
 $tr = array(
  "-" => "_",
  " "=> "_",
  "."=> "",
  ","=> "",
  "/"=> "_"
 return strtolower(strtr($str,$tr));

Ho-ho-ho, now i have translit gun

so, a little more?


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

Ow guys, sorry, forgot 'bout that

open ./js/admin.js

and add this code

String.prototype.translit = (function(){
var L = {
	r = '',
for (k in L) r += k;
r = new RegExp('[' + r + ']', 'g');
k = function(a){
	return a in L ? L[a] : '';
return function(){
	return this.replace(r, k);

then find here this func copy2friendlyURL()

and make it like this

function copy2friendlyURL()
if (typeof(id_product) == 'undefined')
 id_product = false;

if (!$('#link_rewrite_' + id_language).val().length || !id_product)//check if user didn't type anything in rewrite field, to prevent overwriting
 $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().translit().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
 if ($('#friendly-url'))
  $('#friendly-url').html($('#link_rewrite_' + id_language).val());
 // trigger onchange event to use anything binded there
 $('#link_rewrite_' + id_language).change();

then find copyMeta2friendlyURL

and make it like

function copyMeta2friendlyURL()
$('#input_link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().translit().replace(/^[0-9]+\./, ''), 'UTF-8'));

viola, nous avons a cool transliterated links by clicking on Generate btn

  • Like 1
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...