HitmanCZ Posted November 1, 2012 Share Posted November 1, 2012 (edited) polozka friendly URL se stale a stale doplnuje s hacky a carky z nazvu produktu. kdyz to opravim a ulozim, je to spravne. ale kdyz produkt otevru k editaci, napr. popisu produktu a ulozim, pole Friendly URL se opet prepise s hacky/carky z popisu produktu. nechci se pak prat se seo a marketingem kvuli ceskym znakum v url. upravil jsem admin.js ale porad mi to tam hazi ceske znaky, str2url je neprepise podle zadanych pravidel Edited November 1, 2012 by HitmanCZ (see edit history) Link to comment Share on other sites More sharing options...
HitmanCZ Posted November 1, 2012 Author Share Posted November 1, 2012 jedno reseni je od jacka <?php function friendly_url($nadpis) { $url = $nadpis; $url = strip_tags(html_entity_decode($url)); $url = iconv("UTF-8","windows-1250"."//TRANSLIT",$url); $noalpha = "\xc1\xc9\xcd\xd3\xda\xdd\xe1\xe9\xed\xf3\xfa\xfd\xc2\xca\xce\xd4\xdb\xe2\xea\xee\xf4\xfb\xc0\xc8\xcc\xd2\xd9\xe0\xe8\xec\xf2\xf9\xc4\xcb\xcf\xd6\xdc\xe4\xeb\xef\xf6\xfc\xc3\xe3\xd5\xf5\xc5\xe5\xd1\xf1\xc7\xe7\xba\xaa\x8e\x9e\x9d\x8d\xd8\xf8\x8a\x9a"; $alpha = 'AEIOUYaeiouyAEIOUaeiouACENUrcenuAEIOUaedouAaOoLlNnCcsSZztTRrSs'; $url = strtr($url, $noalpha, $alpha); $url = strtolower($url); $url = preg_replace('~[^a-z0-9_]+~', '-', $url); $url = trim($url, "-"); $url = preg_replace('~[^-a-z0-9_]+~', '', $url); echo $url."\n"; return $url; } //projde všechny výrobky v db @$spojeni = MySQL_Connect('SERVER' ,'USER', 'PASSWORD'); @MySQL_Select_DB('DATABASE'); if (!$spojeni): echo "MySQL fatal error (no database)"; endif; mysql_query("SET CHARACTER SET utf8"); $sql = "select id_product, name, id_lang from ps_product_lang"; $query = mysql_query($sql); $num = mysql_num_rows($query); while ($row=mysql_fetch_assoc($query)): $url = friendly_url($row['name']); $sql2 = "update ps_product_lang set link_rewrite = '$url' where id_product = {$row['id_product']} and id_lang = {$row['id_lang']}"; mysql_query($sql2) or die("SQL dotaz nešlo provést"); endwhile; echo "OK"; ?> ale musi se asi spoustet pri kazde uprave produktu, lepsi by to bylo vyresene primo v kodu pri uprave nebo pridavani produktu 1 Link to comment Share on other sites More sharing options...
Caleydon Posted November 10, 2012 Share Posted November 10, 2012 Problem bol ostraneny na SVN, revízia 17989 http://forge.prestashop.com/browse/PSCFV-5388 Link to comment Share on other sites More sharing options...
redfish Posted December 1, 2012 Share Posted December 1, 2012 Mně pomohlo přerazit admin-products.js http://svn.prestashop.com/branches/1.5.x/js/admin-products.js Link to comment Share on other sites More sharing options...
Kaspi88 Posted December 7, 2012 Share Posted December 7, 2012 Problem bol ostraneny na SVN, revízia 17989 http://forge.prestas...owse/PSCFV-5388 jaký file jsou upravovány na tento problém. Díky Link to comment Share on other sites More sharing options...
Caleydon Posted December 28, 2012 Share Posted December 28, 2012 Snáď pomôže článok http://prestashop.sk/zapis/oprava-generovania-specialnych-znakov-priatelskych-url-v-prestashop-1.5.3.0 1 Link to comment Share on other sites More sharing options...
djmila Posted December 30, 2012 Share Posted December 30, 2012 (edited) 1.5.3 po zmene admin.js se mi dostavuje tento problem : Došlo k chybě při aktualizaci objektu. product () Problem řeší update na 1.5.3.1 Edited January 2, 2013 by djmila (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now