activo_categoryurlseo - Version 1.0.4

Version Notes

Flattens the SEO structure of your entire catalog: fixed double slash bug in certain cases.

Download this release

Release Info

Developer Activo Extensions
Extension activo_categoryurlseo
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/community/Activo/Categoryurlseo/Helper/Category.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Catalog
23
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
- /**
28
- * Catalog category helper
29
- *
30
- * @category Mage
31
- * @package Mage_Catalog
32
- * @author Magento Core Team <core@magentocommerce.com>
33
- */
34
- class Activo_Categoryurlseo_Helper_Category extends Mage_Catalog_Helper_Category
35
- {
36
- /**
37
- * Retrieve clear url for category as parrent
38
- *
39
- * @param string $url
40
- * @param bool $slash
41
- * @param int $storeId
42
- *
43
- * @return string
44
- */
45
- public function getCategoryUrlPath($urlPath, $slash = false, $storeId = null)
46
- {
47
- if (Mage::getStoreConfig('activo_categoryurlseo/global/enabled')==0)
48
- {
49
- return parent::getCategoryUrlPath($urlPath, $slash, $storeId);
50
- }
51
- else
52
- {
53
- return Mage::getStoreConfig('activo_categoryurlseo/global/toplevel');
54
- }
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/Categoryurlseo/Helper/Data.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
- /**
3
- * Activo OpenSource
4
- *
5
- * LICENSE
6
- *
7
- * This source file is subject to the new BSD license that is bundled
8
- * with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://store.delorumcommerce.com/license/new-bsd
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@tinybrick.com so we can send you a copy immediately.
14
- *
15
- * @category Activo
16
- * @package Activo_BulkImages
17
- * @copyright Copyright (c) 2011 Activo Inc. (http://www.activo.com)
18
- * @license OSL 3.0
19
- */
20
-
21
- class Activo_Categoryurlseo_Helper_Data extends Mage_Core_Helper_Abstract
22
- {
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/Categoryurlseo/Model/Url.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- class Activo_Categoryurlseo_Model_Url extends Mage_Catalog_Model_Url
3
- {
4
- /**
5
- * Get unique product request path
6
- *
7
- * @param Varien_Object $product
8
- * @param Varien_Object $category
9
- * @return string
10
- */
11
- public function getProductRequestPath($product, $category)
12
- {
13
- if (Mage::getStoreConfig('activo_categoryurlseo/global/enabled')==0)
14
- {
15
- return parent::getProductRequestPath($product, $category);
16
- }
17
- else
18
- {
19
- if ($product->getUrlKey() == '') {
20
- $urlKey = $this->getProductModel()->formatUrlKey($product->getName());
21
- } else {
22
- $urlKey = $this->getProductModel()->formatUrlKey($product->getUrlKey());
23
- }
24
- $storeId = $category->getStoreId();
25
- $suffix = $this->getProductUrlSuffix($storeId);
26
- $idPath = $this->generatePath('id', $product, $category);
27
- /**
28
- * Prepare product base request path
29
- */
30
- if ($category->getLevel() > 1) {
31
- // To ensure, that category has path either from attribute or generated now
32
- $this->_addCategoryUrlPath($category);
33
- $categoryUrl = Mage::helper('catalog/category')->getCategoryUrlPath($category->getUrlPath(),
34
- false, $storeId);
35
- $requestPath = $categoryUrl . '/' . $urlKey;
36
- $requestPath = str_ireplace('//', '/', $requestPath);
37
- } else {
38
- $requestPath = $urlKey;
39
- }
40
-
41
- if (strlen($requestPath) > self::MAX_REQUEST_PATH_LENGTH + self::ALLOWED_REQUEST_PATH_OVERFLOW) {
42
- $requestPath = substr($requestPath, 0, self::MAX_REQUEST_PATH_LENGTH);
43
- }
44
-
45
- $this->_rewrite = null;
46
- /**
47
- * Check $requestPath should be unique
48
- */
49
- if (isset($this->_rewrites[$idPath])) {
50
- $this->_rewrite = $this->_rewrites[$idPath];
51
- $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath();
52
- $existingRequestPath = str_replace($suffix, '', $existingRequestPath);
53
-
54
- if ($existingRequestPath == $requestPath) {
55
- return $requestPath.$suffix;
56
- }
57
- /**
58
- * Check if existing request past can be used
59
- */
60
- if ($product->getUrlKey() == '' && !empty($requestPath)
61
- && strpos($existingRequestPath, $requestPath) !== false
62
- ) {
63
- $existingRequestPath = str_replace($requestPath, '', $existingRequestPath);
64
- if (preg_match('#^-([0-9]+)$#i', $existingRequestPath)) {
65
- return $this->_rewrites[$idPath]->getRequestPath();
66
- }
67
- }
68
- /**
69
- * check if current generated request path is one of the old paths
70
- */
71
- $fullPath = $requestPath.$suffix;
72
- $finalOldTargetPath = $this->getResource()->findFinalTargetPath($fullPath, $storeId);
73
- if ($finalOldTargetPath && $finalOldTargetPath == $idPath) {
74
- $this->getResource()->deleteRewrite($fullPath, $storeId);
75
- return $fullPath;
76
- }
77
- }
78
- /**
79
- * Check 2 variants: $requestPath and $requestPath . '-' . $productId
80
- */
81
- $validatedPath = $this->getResource()->checkRequestPaths(
82
- array($requestPath.$suffix, $requestPath.'-'.$product->getId().$suffix),
83
- $storeId
84
- );
85
-
86
- if ($validatedPath) {
87
- return $validatedPath;
88
- }
89
- /**
90
- * Use unique path generator
91
- */
92
- return $this->getUnusedPath($storeId, $requestPath.$suffix, $idPath);
93
- }
94
- }
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/Categoryurlseo/etc/config.xml DELETED
@@ -1,60 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Activo_Categoryurlseo>
5
- <version>1.0.0</version>
6
- </Activo_Categoryurlseo>
7
- </modules>
8
-
9
- <global>
10
- <helpers>
11
- <categoryurlseo>
12
- <class>Activo_Categoryurlseo_Helper</class>
13
- </categoryurlseo>
14
- <catalog>
15
- <rewrite>
16
- <category>Activo_Categoryurlseo_Helper_Category</category>
17
- </rewrite>
18
- </catalog>
19
- </helpers>
20
- <models>
21
- <categoryurlseo>
22
- <class>Activo_Categoryurlseo_Model</class>
23
- </categoryurlseo>
24
- <catalog>
25
- <rewrite>
26
- <url>Activo_Categoryurlseo_Model_Url</url>
27
- </rewrite>
28
- </catalog>
29
- </models>
30
- </global>
31
- <adminhtml>
32
- <acl>
33
- <resources>
34
- <admin>
35
- <children>
36
- <system>
37
- <children>
38
- <config>
39
- <children>
40
- <activo_categoryurlseo>
41
- <title>SEO Friendly Category</title>
42
- </activo_categoryurlseo>
43
- </children>
44
- </config>
45
- </children>
46
- </system>
47
- </children>
48
- </admin>
49
- </resources>
50
- </acl>
51
- </adminhtml>
52
- <default>
53
- <activo_categoryurlseo>
54
- <global>
55
- <enabled>1</enabled>
56
- <toplevel></toplevel>
57
- </global>
58
- </activo_categoryurlseo>
59
- </default>
60
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/Categoryurlseo/etc/system.xml DELETED
@@ -1,78 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magento
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
- *
22
- * @category
23
- * @package _home
24
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
- */
27
- -->
28
- <config>
29
- <tabs>
30
- <activo translate="label">
31
- <label>Activo Extensions</label>
32
- <sort_order>101</sort_order>
33
- </activo>
34
- </tabs>
35
- <sections>
36
- <activo_categoryurlseo translate="label" module="categoryurlseo">
37
- <class>separator-top</class>
38
- <label>SEO Friendly Category</label>
39
- <tab>activo</tab>
40
- <frontend_type>text</frontend_type>
41
- <sort_order>67</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- <groups>
46
- <global translate="label">
47
- <label>SEO Friendly Category Oprions</label>
48
- <expanded>1</expanded>
49
- <sort_order>100</sort_order>
50
- <show_in_default>1</show_in_default>
51
- <show_in_website>1</show_in_website>
52
- <show_in_store>1</show_in_store>
53
- <fields>
54
- <enabled translate="label">
55
- <label>Enabled?</label>
56
- <frontend_type>select</frontend_type>
57
- <source_model>adminhtml/system_config_source_yesno</source_model>
58
- <sort_order>10</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>1</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- <comment>Select Yes if you wish to ignore the parent category(s) in the Category URLs. Notice once you change this value you may need to reindex the Catalog URL Rewrites.</comment>
63
- </enabled>
64
- <toplevel translate="label">
65
- <label>Manual Top Level</label>
66
- <frontend_type>text</frontend_type>
67
- <sort_order>20</sort_order>
68
- <show_in_default>1</show_in_default>
69
- <show_in_website>1</show_in_website>
70
- <show_in_store>1</show_in_store>
71
- <comment>Add a top level manual category that will apply to all products accross the store. No need for the preceeding forward slash, add a trailing forward slash if needed.</comment>
72
- </toplevel>
73
- </fields>
74
- </global>
75
- </groups>
76
- </activo_categoryurlseo>
77
- </sections>
78
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/News/Model/Feed.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * Activo
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Commercial Software License
8
- * that is available through the world-wide-web at this URL:
9
- * http://extensions.activo.com/license_professional
10
- * If you did not receive a copy of the license and are unable to
11
- * obtain it through the world-wide-web, please send an email
12
- * to extensions@activo.com so we can send you a copy immediately.
13
- *
14
- * @category
15
- * @package news
16
- * @copyright Copyright (c) 2012 Activo Inc. (http://www.activo.com)
17
- * @license Open Source
18
- */
19
-
20
- //http://www.nicksays.co.uk/2009/05/magento-custom-admin-notifications/
21
- class Activo_News_Model_Feed extends Mage_AdminNotification_Model_Feed
22
- {
23
- /**
24
- * Retrieve feed url
25
- *
26
- * @return string
27
- */
28
- public function getFeedUrl()
29
- {
30
- if (is_null($this->_feedUrl)) {
31
- $this->_feedUrl = 'http://extensions.activo.com/adminrss.php?s='.Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_UNSECURE_URL);
32
- }
33
- return $this->_feedUrl;
34
- }
35
-
36
- public function observe()
37
- {
38
- $model = Mage::getModel('news/feed');
39
- $model->checkUpdate();
40
- }
41
-
42
- // public function getFrequency()
43
- // {
44
- // return 1;
45
- // }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Activo/News/etc/config.xml DELETED
@@ -1,47 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Activo
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Commercial Software License
9
- * that is available through the world-wide-web at this URL:
10
- * http://extensions.activo.com/license_professional
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to extensions@activo.com so we can send you a copy immediately.
14
- *
15
- * @category
16
- * @package news
17
- * @copyright Copyright (c) 2012 Activo Inc. (http://www.activo.com)
18
- * @license Open Source
19
- */
20
- -->
21
- <config>
22
- <modules>
23
- <Activo_News>
24
- <version>1.0.0</version>
25
- </Activo_News>
26
- </modules>
27
- <global>
28
- <models>
29
- <news>
30
- <class>Activo_News_Model</class>
31
- </news>
32
- </models>
33
- </global>
34
- <adminhtml>
35
- <events>
36
- <controller_action_predispatch>
37
- <observers>
38
- <activo_news>
39
- <type>singleton</type>
40
- <class>news/feed</class>
41
- <method>observe</method>
42
- </activo_news>
43
- </observers>
44
- </controller_action_predispatch>
45
- </events>
46
- </adminhtml>
47
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Activo_News.xml DELETED
@@ -1,31 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Activo
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Commercial Software License
9
- * that is available through the world-wide-web at this URL:
10
- * http://extensions.activo.com/license_professional
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to extensions@activo.com so we can send you a copy immediately.
14
- *
15
- * @category
16
- * @package news
17
- * @copyright Copyright (c) 2012 Activo Inc. (http://www.activo.com)
18
- * @license Open Source
19
- */
20
- -->
21
- <config>
22
- <modules>
23
- <Activo_News>
24
- <active>true</active>
25
- <codePool>community</codePool>
26
- <depends>
27
- <Mage_AdminNotification />
28
- </depends>
29
- </Activo_News>
30
- </modules>
31
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,34 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>activo_categoryurlseo</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>This simple FREE extension can flatten your store URL structure and drastically improve your SEO in just few simple clicks.</summary>
10
- <description>&lt;h4&gt;Overview&lt;/h4&gt;&#xD;
11
- &#xD;
12
- &lt;p&gt;If your online store has a complex categories structure with many levels of subcategories, Magento will create really long URLs for the products in these subcategories, including the full categories hierarchy in the URL.&lt;/p&gt;&#xD;
13
- &lt;p&gt;This can be a real drag for your product SEO since Google usually pays attention only to first few words in the URL.&lt;/p&gt;&#xD;
14
- &lt;p&gt;This FREE &lt;strong&gt;SEO Friendly Categories&lt;/strong&gt; extension lets you flatten your URL structure by using only the last subcategory name in the URL. So instead of &lt;code&gt;mystore.com/category/subcategory1/subcategory2/subcategory3&lt;/code&gt; you will have just &lt;code&gt;mystore.com/subcategory3&lt;/code&gt; in your URL.&lt;/p&gt;&#xD;
15
- &lt;p&gt;You can even customize how that subcategory will look in the URL like by using the URL Key parameter in the category configuration.&lt;/p&gt;&#xD;
16
- &#xD;
17
- &lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
18
- &#xD;
19
- &lt;h4&gt;Highlights&lt;/h4&gt;&#xD;
20
- &lt;p&gt;&lt;ul&gt;&#xD;
21
- &lt;li&gt;Drastically improves your categories' and products' SEO&lt;/li&gt;&#xD;
22
- &lt;li&gt;Gives you full control over product, category and subcategory URLs&lt;/li&gt;&#xD;
23
- &lt;li&gt;Creates flat URL structure for categories&lt;/li&gt;&#xD;
24
- &lt;li&gt;Uses Magento's own URL rewriting mechanism for improved compatibility&lt;/li&gt;&#xD;
25
- &lt;li&gt;100% FREE&lt;/li&gt;&#xD;
26
- &lt;/ul&gt;&lt;/p&gt;</description>
27
- <notes>Added the ability to manually specify a global top level string for refined SEO control.</notes>
28
  <authors><author><name>Activo Extensions</name><user>activo</user><email>extensions@activo.com</email></author></authors>
29
- <date>2012-07-27</date>
30
- <time>06:37:07</time>
31
- <contents><target name="magecommunity"><dir name="Activo"><dir name="Categoryurlseo"><dir><dir name="Helper"><file name="Category.php" hash="5375fd8978c051b8421cc7e4a718eeea"/><file name="Data.php" hash="6892bf5f068f01ecbe4bc746ed0be85b"/></dir><dir name="Model"><file name="Url.php" hash="c65d311f28b4c4f171d702863e37e9fc"/></dir><dir name="etc"><file name="config.xml" hash="c6b25932abab4588478b2ccf46f5ee36"/><file name="system.xml" hash="d8d6fa1b7e04ada0c492b3738b6d9de7"/></dir></dir></dir><dir name="News"><dir><dir name="Model"><file name="Feed.php" hash="3ac6617af7eaceb5cac373a4f13a8b1b"/></dir><dir name="etc"><file name="config.xml" hash="16cfd0b7ac1e67d0d3534b99a6c1e512"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Activo_Categoryurlseo.xml" hash="cbb2d56a19efe3658ff0b6bf21376dd3"/><file name="Activo_News.xml" hash="1c8b4c7e70aa752c05241df66dd5d29b"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>activo_categoryurlseo</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Flattens the SEO structure of your entire catalog.</summary>
10
+ <description>This FREE SEO Friendly Categories extension lets you flatten your URL structure by using only the last subcategory name in the URL. So instead of mystore.com/category/subcategory1/subcategory2/subcategory3 you will have just mystore.com/subcategory3 in your URL.</description>
11
+ <notes>Flattens the SEO structure of your entire catalog: fixed double slash bug in certain cases.</notes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  <authors><author><name>Activo Extensions</name><user>activo</user><email>extensions@activo.com</email></author></authors>
13
+ <date>2012-10-23</date>
14
+ <time>18:17:19</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Activo_Categoryurlseo.xml" hash="cbb2d56a19efe3658ff0b6bf21376dd3"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>8.0.0</max></php></required></dependencies>
18
  </package>