Jump to content

[Solved] What is $PS_ALLOW_ACCENTED_CHARS_URL (Friendly URL)


Recommended Posts

By overriding Dispatcher.php and Validate.php in 1.5.2.0, I was able to input and display Thai Friendly URL. But 1.5.3.0 (and 1.5.3.1) have suddenly fixed something that isn't broken, Now other language including Thai can't be input in Friendly URL(Catalog > Products > SEO).

 

If I manually edit link_rewrite field in ps_product_lang and input Thai (via phpMyAdmin), the friendly URL can be saved and displayed correctly.

 

After closely looked at the code, notice that there is new constant $PS_ALLOW_ACCENTED_CHARS_URL in some javascript code that blacklist certain characters to be accepted.

 

So what is $PS_ALLOW_ACCENTED_CHARS_URL, can it be set somewhere in in BO or it need to be manually defined. Please help!

{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
  var PS_ALLOW_ACCENTED_CHARS_URL = 1;
{else}
  var PS_ALLOW_ACCENTED_CHARS_URL = 0;
{/if}

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

I knew where is this constant. Just that I don't know how to get and set this value. In fact these files are:

/admin/themes/default/template/controllers/categories/helpers/form/form.tpl
/admin/themes/default/template/controllers/cms/helpers/form/form.tpl
/admin/themes/default/template/controllers/cms_categories/helpers/form/form.tpl
/admin/themes/default/template/controllers/products/informations.tpl
/classes/Tools.php
/classes/Validate.php
/js/admin.js
/controllers/admin/AdminCategoriesController.php
/controllers/admin/AdminCmsCategoriesController.php
/controllers/admin/AdminCmsController.php
/controllers/admin/AdminProductsController.php

Link to comment
Share on other sites

I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field.

 

Now I can input Thai in Catalog > Products > SEO > Friendly URL.

  • Like 3
Link to comment
Share on other sites

No, I can't. It converts to ииееррфф. I believe because the lowercase function.

 

if (function_exists('mb_strtolower'))
 $str = mb_strtolower($str, 'utf-8');

 

Basically, I override \pL to \pL\pM in three files:

1. classes\Dispatcher.php (28 of them)

2. classes\Validate.php

3. classes\Tools.php

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

  • 1 month later...

Thank you, This has solved the same problem for generating Friendly URL in Hebrew.

 

The SQL code I used is:

INSERT INTO `ps_configuration` (`id_configuration`, `id_shop_group`, `id_shop`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, NULL, NULL, 'PS_ALLOW_ACCENTED_CHARS_URL', '1', '', '');

 

I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field.

 

Now I can input Thai in Catalog > Products > SEO > Friendly URL.

Edited by AppleEater (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

hi Mr Suthichai,

 

Friendly URL in THAI LANGUAGE

1.how to insert phpMyAdmin Step by step ???
   THIS below database i already insert. Am i do the right step ??     

                     
 id_configuration   id_shop_ group   id_shop  name                                    value    date_add       date_upd

  dot.gif 690                     NULL                 NULL      PS_ALLOW_ACCENTED_CHARS_URL     1    0000-00-00 00:00:00 0000-00-00 00:00:00

 

Hope u can Help me with above first issue. :). .. Am i do the right step ??

 

2. i solved it.

Basically, I override \pL to \pL\pM in three files:
a. classes\Dispatcher.php (28 of them)
b. classes\Validate.php
c. classes\Tools.php

 

 ong

Link here @ 7zhop.com
 
 

I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field.

Now I can input Thai in Catalog > Products > SEO > Friendly URL.

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

×
×
  • Create New...