Version Notes
Fix for category URL
Download this release
Release Info
Developer | Alex |
Extension | Magefast_FixUrlCategory |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
app/code/local/Magefast/FixUrlCategory/Model/Category.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Catalog category
|
4 |
+
*
|
5 |
+
* @category Magefast
|
6 |
+
* @package Magefast_FixUrlCategory
|
7 |
+
* @author
|
8 |
+
*/
|
9 |
+
class Magefast_FixUrlCategory_Model_Category extends Mage_Catalog_Model_Category
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Format URL key from name or defined key
|
14 |
+
*
|
15 |
+
* @param string $str
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
public function formatUrlKey($str)
|
19 |
+
{
|
20 |
+
$str = Mage::helper('catalog/product_url')->format($str); //new, like for product
|
21 |
+
//$str = Mage::helper('core')->removeAccents($str); //old
|
22 |
+
$urlKey = preg_replace('#[^0-9a-z]+#i', '-', $str);
|
23 |
+
$urlKey = strtolower($urlKey);
|
24 |
+
$urlKey = trim($urlKey, '-');
|
25 |
+
return $urlKey;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
}
|
app/code/local/Magefast/FixUrlCategory/etc/config.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magefast_FixUrlCategory>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Magefast_FixUrlCategory>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<catalog>
|
11 |
+
<rewrite>
|
12 |
+
<category>Magefast_FixUrlCategory_Model_Category</category>
|
13 |
+
</rewrite>
|
14 |
+
</catalog>
|
15 |
+
</models>
|
16 |
+
</global>
|
17 |
+
</config>
|
app/etc/modules/Magefast_FixUrlCategory.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Magefast_FixUrlCategory>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Magefast_FixUrlCategory>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Magefast_FixUrlCategory</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Fix for saving URL of category.</summary>
|
10 |
+
<description>Extension for fix problem URL, if use with cyrillic or other non-latin charset. 
|
11 |
+
Extension based on Product Helper as example. URL key before save will converted, non-latin symbols will translit.</description>
|
12 |
+
<notes>Fix for category URL</notes>
|
13 |
+
<authors><author><name>Alex</name><user>alexhost</user><email>b07400@yandex.com</email></author></authors>
|
14 |
+
<date>2012-02-17</date>
|
15 |
+
<time>10:35:51</time>
|
16 |
+
<contents><target name="magelocal"><dir name="Magefast"><dir name="FixUrlCategory"><dir name="Model"><file name="Category.php" hash="ffff99e5375b366979e58368e91e0f10"/></dir><dir name="etc"><file name="config.xml" hash="e4ba1311b0037873f13fd58651414508"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magefast_FixUrlCategory.xml" hash="2cb30a168d275e171619048b227d829b"/></dir></target></contents>
|
17 |
+
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
+
</package>
|