News:

Looking for documentation? Take a look on our wiki

Main Menu

[SOLVED] VM 2.6.6 product slug (alias) unicode issue

Started by Kiku, June 11, 2014, 17:17:32 PM

Previous topic - Next topic

Kiku

Hi,

VM 2.6.6
Joomla 2.5.21

in earlier versions of VM (for example VM 2.0.26d), while saving NEW product, slug (alias) was created without any special characters, for example if product name was containing special characters like "ś" and "ą" then after saving in slug these special characters been turned to "s" and "a". Now they're the same as in product name. What's more if I insert a comma inside product name (while creating new product) and hit save, that comma will be present in slug, but earlier was replaced with "-".

How can I turn ON feature responsible for creating slug without special characters (I mean non [a-z])? In global Joomla configuration I have "Unicode Aliases" = "No" but it seems it doesn't mean anything in this situation.

Best regards,
Chris


UPDATE:

I figure it out, in /administrator/components/com_virtuemart/helpers/vmtable.php around line 764 I changed this:
//if (JVM_VERSION === 1) $this->$slugName = JFilterOutput::stringURLSafe($this->$slugName);
//else $this->$slugName = JApplication::stringURLSafe($this->$slugName);
//pro+#'!"§$%&/()=?duct-w-| ||cu|st|omfield-|str<ing>
//vmdebug('my slugName '.$slugName,$this->$slugName);
$this->$slugName = str_replace('-', ' ', $this->$slugName);

//$config =& JFactory::getConfig();
//$transliterate = $config->get('unicodeslugs');
$unicodeslugs = VmConfig::get('transliterateSlugs',false);
if($unicodeslugs){
$lang = JFactory::getLanguage();
$this->$slugName = $lang->transliterate($this->$slugName);
}

// Trim white spaces at beginning and end of alias and make lowercase
$this->$slugName = trim(JString::strtolower($this->$slugName));
$this->$slugName = str_replace(array('`','´',"'"),'',$this->$slugName);

$this->$slugName = vRequest::filterUword($this->$slugName,'-,_,.,|','-');
while(strpos($this->$slugName,'--')){
$this->$slugName = str_replace('--','-',$this->$slugName);
}
// Trim dashes at beginning and end of alias
$this->$slugName = trim($this->$slugName, '-');

if($unicodeslugs)$this->$slugName = rawurlencode($this->$slugName);

$valid = $this->checkCreateUnique($checkTable, $slugName);
vmdebug('my Final slugName '.$slugName,$this->slugName);
if (!$valid) {
return false;
}


to this:

//if (JVM_VERSION === 1) $this->$slugName = JFilterOutput::stringURLSafe($this->$slugName);
//else
$this->$slugName = JApplication::stringURLSafe($this->$slugName);
//pro+#'!"§$%&/()=?duct-w-| ||cu|st|omfield-|str<ing>
//vmdebug('my slugName '.$slugName,$this->$slugName);
//$this->$slugName = str_replace('-', ' ', $this->$slugName);

//$config =& JFactory::getConfig();
//$transliterate = $config->get('unicodeslugs');
//$unicodeslugs = VmConfig::get('transliterateSlugs',false);
//if($unicodeslugs){
// $lang = JFactory::getLanguage();
// $this->$slugName = $lang->transliterate($this->$slugName);
//}

// Trim white spaces at beginning and end of alias and make lowercase
//$this->$slugName = trim(JString::strtolower($this->$slugName));
//$this->$slugName = str_replace(array('`','´',"'"),'',$this->$slugName);

//$this->$slugName = vRequest::filterUword($this->$slugName,'-,_,.,|','-');
//while(strpos($this->$slugName,'--')){
// $this->$slugName = str_replace('--','-',$this->$slugName);
//}
// Trim dashes at beginning and end of alias
//$this->$slugName = trim($this->$slugName, '-');

//if($unicodeslugs)$this->$slugName = rawurlencode($this->$slugName);

$valid = $this->checkCreateUnique($checkTable, $slugName);
//vmdebug('my Final slugName '.$slugName,$this->slugName);
if (!$valid) {
return false;
}


and everything is fine now, like it was before :)

jankoo

hi.. i got this issue with latest vm version 3.0.9 .. it's still not fixed or what???
thx

worknmn

Virtuemart 3.0.9, joomla 3.4.4    ","  replace %2C and took 404 error
my site: sagip.ru

its4yougr

Hi
I have tried different proposed solutions on Joomla! 3.4.8 and VirtueMart 3.0.12 and none of them worked.
When I create a new product and the product name is in Greek then I get ending URLs like : %CE%B1%CF%80%CE%BF%CE%B8%CE%B7%CE%BA%CE%B5%CF%85%CF%84%CE%B9%CE%BA%CF%8C-%CE%BC%CE%AD%CF%83%CE%BF-usb-64-gb which is in Greek but cannot be read if you post them into Facebook, Google+ etc.
I would like to get urls which contain the Greek title written using latin characters i.e.
"Αποθηκευτικό μέσο usb 64 gb" to be changed into "apothikeftiko-meso-usb-64-gb" automatically.
Is that possible with Virtuemart 3?

Thanks in advance
Κατασκευή Ιστοσελίδων Θεσσαλονίκη - http://www.its4you.gr/
WebDesign Internet Marketing - http://www.webdesign-internetmarketing.com/

pwidner

I'm using VM 3 and I can't believe this issue still exist. I am looking everywhere for a solution. Product titles such 12" Wheel, when saving strips the double quotes.