Optimiseweb_Redirects - Version 0.3.0

Version Notes

* Added functionality to redirect disabled categories and products

Download this release

Release Info

Developer Kathir Vel
Extension Optimiseweb_Redirects
Version 0.3.0
Comparing to
See all releases


Code changes from version 0.2.3 to 0.3.0

app/code/community/Optimiseweb/Redirects/Block/Adminhtml/System/Config/Fieldset/Hint.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_Adminhtml_System_Config_Fieldset_Hint extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_Adminhtml_System_Config_Fieldset_Hint extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Adminhtml_Block_System_Config_Form_Field
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_Adminhtml_Block_System_Config_Form_Field
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field
app/code/community/Optimiseweb/Redirects/Helper/Data.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Helper_Data extends Mage_Core_Helper_Abstract
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Helper_Data extends Mage_Core_Helper_Abstract
app/code/community/Optimiseweb/Redirects/Model/Redirector.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
- * @copyright Copyright (c) 2014 Optimise Web
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Model_Redirector
@@ -25,13 +25,17 @@ class Optimiseweb_Redirects_Model_Redirector
25
  $actionName = $request->getActionName();
26
 
27
  $disabledProductCheck = $this->disabledProductCheck($request);
 
28
 
29
  $requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri(), '/');
30
  if ($disabledProductCheck) {
31
  $requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . '/' . $disabledProductCheck, '/');
32
  }
 
 
 
33
 
34
- if (($actionName == 'noRoute') OR $disabledProductCheck) {
35
  Mage::dispatchEvent('optimiseweb_redirects_before_legacy', array('request_url' => &$requestUrl));
36
  $this->doRedirectsLegacy($requestUrl);
37
  Mage::dispatchEvent('optimiseweb_redirects_before_v1', array('request_url' => &$requestUrl));
@@ -61,6 +65,22 @@ class Optimiseweb_Redirects_Model_Redirector
61
  return FALSE;
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  protected function doRedirectsLegacy($requestUrl)
65
  {
66
  if (Mage::getStoreConfig('optimisewebredirects/general/upload') AND file_exists(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload'))) {
5
  *
6
  * @package Optimiseweb_Redirects
7
  * @author Kathir Vel (sid@optimiseweb.co.uk)
8
+ * @copyright Copyright (c) 2015 Kathir Vel
9
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
  */
11
  class Optimiseweb_Redirects_Model_Redirector
25
  $actionName = $request->getActionName();
26
 
27
  $disabledProductCheck = $this->disabledProductCheck($request);
28
+ $disabledCategoryCheck = $this->disabledCategoryCheck($request);
29
 
30
  $requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . $request->getRequestUri(), '/');
31
  if ($disabledProductCheck) {
32
  $requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . '/' . $disabledProductCheck, '/');
33
  }
34
+ if ($disabledCategoryCheck) {
35
+ $requestUrl = rtrim($request->getScheme() . '://' . $request->getHttpHost() . '/' . $disabledCategoryCheck, '/');
36
+ }
37
 
38
+ if (($actionName == 'noRoute') OR $disabledProductCheck OR $disabledCategoryCheck) {
39
  Mage::dispatchEvent('optimiseweb_redirects_before_legacy', array('request_url' => &$requestUrl));
40
  $this->doRedirectsLegacy($requestUrl);
41
  Mage::dispatchEvent('optimiseweb_redirects_before_v1', array('request_url' => &$requestUrl));
65
  return FALSE;
66
  }
67
 
68
+ protected function disabledCategoryCheck($request)
69
+ {
70
+ if ($request->getActionName() !== 'noRoute') {
71
+ if ((bool) Mage::getStoreConfig('optimisewebredirects/disabled_products/enabled')) {
72
+ if (($request->getModuleName() == 'catalog') AND ( $request->getControllerName() == 'category') AND ( $request->getActionName() == 'view')) {
73
+ if ($category = Mage::getModel('catalog/category')->load(Mage::app()->getRequest()->getParam('id'))) {
74
+ if ($category->getIsActive() == 0) {
75
+ return $category->getUrlPath();
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ return FALSE;
82
+ }
83
+
84
  protected function doRedirectsLegacy($requestUrl)
85
  {
86
  if (Mage::getStoreConfig('optimisewebredirects/general/upload') AND file_exists(Mage::getBaseDir('media') . '/optimiseweb/redirects/' . Mage::getStoreConfig('optimisewebredirects/general/upload'))) {
app/code/community/Optimiseweb/Redirects/doc/Readme.html CHANGED
@@ -15,84 +15,84 @@
15
  <p>I called this Legacy as it was the first option I wrote for this module. Many Magento retailers still use this option. I did not want their websites to stop working. So it is still here.</p>
16
 
17
  <p><b>CSV Format:</b><br />
18
- http://www.oldurl.com/oldpath;http://www.newurl.com/newpath
19
- <br />
20
- Notice the semicolon. In the past, this module used a semicolon to separate the URLs. Please note that this option uses just a single cell of the CSV file in Excel.
21
- <br />
22
- A sample file is available here http://optimiseweb.co.uk/magento-modules/1-Legacy.csv
23
  </p>
24
  <h3>Method 2 - Redirects System v1.0</h3>
25
  <p>Many retailers were struggling with the semicolon and single cell based redirects. So, I made this into a three cell redirect.</p>
26
  <p>
27
- <b>CSV Format:</b>
28
- <br />
29
- http://www.oldurl.com/oldpath,http://www.newurl.com/newpath,status_code
30
- <br />
31
- Notice the comma as a separator. I have now given an option for you to customise the delimiter / separator. Excel saves the CSV using commas. However, you can choose to use any character, even a pipe delimiter.
32
- <br />
33
- The status_code will be 301 or 302. Now this version on, you can define the status code (required for the redirects to work) as well.
34
- <br />
35
- Another big improvement to this module is the wildcard character. You can define a wildcard character in the options screen and use it in the CSV file.
36
- <br />
37
- e.g. http://www.oldurl.com/oldpath/*,http://www.newurl.com/newpath/newsublevel,301
38
- <br />
39
- This will match URL that follows http://www.oldurl.com/oldpath/ and redirect them all to http://www.newurl.com/newpath/newsublevel.
40
- <br />
41
- A sample file is available here http://optimiseweb.co.uk/magento-modules/2-Redirects.v1.0.csv
42
  </p>
43
  <h3>Method 2 - Query String Based Redirects</h3>
44
  <p>The query string based option was developed primarily for retailers moving away from old school ecommerce platforms that used query strings in their URLs. It can also be used by existing Magento retailers who have deleted a product attribute, stopped a Google Adwords campaign, etc.</p>
45
  <p>
46
- <b>CSV Format:</b>
47
- <br />
48
- http://www.oldurl.com/oldbasepath,prod_id,170,http://www.newurl.com/newproducturl,status_code
49
- <br />
50
- The settings, delimiter, wildcard options are similar to Method 2.
51
- <br />
52
- The second column is the query string name and the third column is the query string value.
53
- <br />
54
- e.g. http://www.oldurl.com/oldbasepath,prod_id,170,http://www.newurl.com/newproducturl,301
55
- <br />
56
- This will match all of the following
57
- <br />
58
- http://www.oldurl.com/oldbasepath?prod_id=170
59
- <br />
60
- http://www.oldurl.com/oldbasepath?cat_id=24&amp;prod_id=170
61
- <br />
62
- http://www.oldurl.com/oldbasepath?prod_id=170&amp;cat_id=24
63
- <br />
64
- Please Note: This module works on a best match basis. If you had a redirect setup for the cat_id query before the prod_id query, both the above URLs will redirect to the category page. This is because cat_id is the best match. If you setup prod_id before cat_id, then the product page would take priority. It is very rare that old ecommerce systems will call both the category id and product id in the same URL. However, I am just illustrating the best match scenario.
65
- <br />
66
- A sample file is available here http://optimiseweb.co.uk/magento-modules/3-QueryStringBasedRedirects.csv
67
  </p>
68
  <br />
69
  <br />
70
  <h3>
71
- <b>
72
- <u>PLEASE READ THIS</u>
73
- </b>
74
  </h3>
75
  <p>
76
- - This module is widely tested and works on most standard Magento setups.<br />
77
- - If the module isn't working for you, you have most likely not followed the standard Magento module installation routine. Read the FAQs below.<br />
78
- - Before leaving negative feedback or writing an email to us, please check the following - <b>Turn Off Compilation Before Installation, Clear Cache After Installation, Log Off and Log Back Into the Admin</b><br />
79
- - 99% of the time, when users install the module and it doesn't work, we investigate and find out that there are other problems (server issues, file and folder permissions, conflicting modules, etc.).<br />
80
- - Please note that this is a very useful, but free module. We cannot be doing email ping pong all day long. If you need us to look into a problem, send us a private message with your Magento admin (with full access rights) password and FTP details. Without this we will have to embark on a email ping pong and that takes a lot of time. We hope you will understand.<br />
81
- - Thank you very much for taking time to use our module.<br />
82
  </p>
83
  <h3>
84
- <b>
85
- <u>Features</u>
86
- </b>
87
  </h3>
88
  <p>
89
- - If you disable a product in Magento and add a redirect for that product via this module, the redirect will not work as according to Magento the product is still in the system. You will have to delete the product for the redirect to work. I'll look into finding a work around for this.<br />
90
- <br />
91
- <b>Download and Upload of CSV</b>
92
- <br />
93
- - Using the system configuration panel. <b>System &gt; Configuration &gt; Optimise Web (tab) &gt; Mass 301 Redirects</b><br />
94
- - Always remember to download the previously uploaded CSV and add new redirects to it. Uploading a new CSV will overwrite the old CSV and you will lose all previously uploaded 301 redirects.<br />
95
- <br />
96
  </p>
97
 
98
  <h3><b><u>Frequently asked questions</u></b></h3>
15
  <p>I called this Legacy as it was the first option I wrote for this module. Many Magento retailers still use this option. I did not want their websites to stop working. So it is still here.</p>
16
 
17
  <p><b>CSV Format:</b><br />
18
+ http://www.oldurl.com/oldpath;http://www.newurl.com/newpath
19
+ <br />
20
+ Notice the semicolon. In the past, this module used a semicolon to separate the URLs. Please note that this option uses just a single cell of the CSV file in Excel.
21
+ <br />
22
+ A sample file is available here http://optimiseweb.co.uk/magento-modules/1-Legacy.csv
23
  </p>
24
  <h3>Method 2 - Redirects System v1.0</h3>
25
  <p>Many retailers were struggling with the semicolon and single cell based redirects. So, I made this into a three cell redirect.</p>
26
  <p>
27
+ <b>CSV Format:</b>
28
+ <br />
29
+ http://www.oldurl.com/oldpath,http://www.newurl.com/newpath,status_code
30
+ <br />
31
+ Notice the comma as a separator. I have now given an option for you to customise the delimiter / separator. Excel saves the CSV using commas. However, you can choose to use any character, even a pipe delimiter.
32
+ <br />
33
+ The status_code will be 301 or 302. Now this version on, you can define the status code (required for the redirects to work) as well.
34
+ <br />
35
+ Another big improvement to this module is the wildcard character. You can define a wildcard character in the options screen and use it in the CSV file.
36
+ <br />
37
+ e.g. http://www.oldurl.com/oldpath/*,http://www.newurl.com/newpath/newsublevel,301
38
+ <br />
39
+ This will match URL that follows http://www.oldurl.com/oldpath/ and redirect them all to http://www.newurl.com/newpath/newsublevel.
40
+ <br />
41
+ A sample file is available here http://optimiseweb.co.uk/magento-modules/2-Redirects.v1.0.csv
42
  </p>
43
  <h3>Method 2 - Query String Based Redirects</h3>
44
  <p>The query string based option was developed primarily for retailers moving away from old school ecommerce platforms that used query strings in their URLs. It can also be used by existing Magento retailers who have deleted a product attribute, stopped a Google Adwords campaign, etc.</p>
45
  <p>
46
+ <b>CSV Format:</b>
47
+ <br />
48
+ http://www.oldurl.com/oldbasepath,prod_id,170,http://www.newurl.com/newproducturl,status_code
49
+ <br />
50
+ The settings, delimiter, wildcard options are similar to Method 2.
51
+ <br />
52
+ The second column is the query string name and the third column is the query string value.
53
+ <br />
54
+ e.g. http://www.oldurl.com/oldbasepath,prod_id,170,http://www.newurl.com/newproducturl,301
55
+ <br />
56
+ This will match all of the following
57
+ <br />
58
+ http://www.oldurl.com/oldbasepath?prod_id=170
59
+ <br />
60
+ http://www.oldurl.com/oldbasepath?cat_id=24&amp;prod_id=170
61
+ <br />
62
+ http://www.oldurl.com/oldbasepath?prod_id=170&amp;cat_id=24
63
+ <br />
64
+ Please Note: This module works on a best match basis. If you had a redirect setup for the cat_id query before the prod_id query, both the above URLs will redirect to the category page. This is because cat_id is the best match. If you setup prod_id before cat_id, then the product page would take priority. It is very rare that old ecommerce systems will call both the category id and product id in the same URL. However, I am just illustrating the best match scenario.
65
+ <br />
66
+ A sample file is available here http://optimiseweb.co.uk/magento-modules/3-QueryStringBasedRedirects.csv
67
  </p>
68
  <br />
69
  <br />
70
  <h3>
71
+ <b>
72
+ <u>PLEASE READ THIS</u>
73
+ </b>
74
  </h3>
75
  <p>
76
+ - This module is widely tested and works on most standard Magento setups.<br />
77
+ - If the module isn't working for you, you have most likely not followed the standard Magento module installation routine. Read the FAQs below.<br />
78
+ - Before leaving negative feedback or writing an email to us, please check the following - <b>Turn Off Compilation Before Installation, Clear Cache After Installation, Log Off and Log Back Into the Admin</b><br />
79
+ - 99% of the time, when users install the module and it doesn't work, we investigate and find out that there are other problems (server issues, file and folder permissions, conflicting modules, etc.).<br />
80
+ - Please note that this is a very useful, but free module. We cannot be doing email ping pong all day long. If you need us to look into a problem, send us a private message with your Magento admin (with full access rights) password and FTP details. Without this we will have to embark on a email ping pong and that takes a lot of time. We hope you will understand.<br />
81
+ - Thank you very much for taking time to use our module.<br />
82
  </p>
83
  <h3>
84
+ <b>
85
+ <u>Features</u>
86
+ </b>
87
  </h3>
88
  <p>
89
+ - If you disable a product in Magento and add a redirect for that product via this module, the redirect will not work as according to Magento the product is still in the system. You will have to delete the product for the redirect to work. I'll look into finding a work around for this.<br />
90
+ <br />
91
+ <b>Download and Upload of CSV</b>
92
+ <br />
93
+ - Using the system configuration panel. <b>System &gt; Configuration &gt; Optimise Web (tab) &gt; Mass 301 Redirects</b><br />
94
+ - Always remember to download the previously uploaded CSV and add new redirects to it. Uploading a new CSV will overwrite the old CSV and you will lose all previously uploaded 301 redirects.<br />
95
+ <br />
96
  </p>
97
 
98
  <h3><b><u>Frequently asked questions</u></b></h3>
app/code/community/Optimiseweb/Redirects/etc/adminhtml.xml CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
- * @copyright Copyright (c) 2014 Optimise Web
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
+ * @copyright Copyright (c) 2015 Kathir Vel
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
app/code/community/Optimiseweb/Redirects/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
- * @copyright Copyright (c) 2014 Optimise Web
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
@@ -11,7 +11,7 @@
11
 
12
  <modules>
13
  <Optimiseweb_Redirects>
14
- <version>0.2.2</version>
15
  </Optimiseweb_Redirects>
16
  </modules>
17
 
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
+ * @copyright Copyright (c) 2015 Kathir Vel
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
11
 
12
  <modules>
13
  <Optimiseweb_Redirects>
14
+ <version>0.3.0</version>
15
  </Optimiseweb_Redirects>
16
  </modules>
17
 
app/code/community/Optimiseweb/Redirects/etc/system.xml CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
- * @copyright Copyright (c) 2014 Optimise Web
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
@@ -12,7 +12,7 @@
12
  <tabs>
13
  <optimisewebconfig translate="label comment" module="ow_redirects">
14
  <label>Optimise Web</label>
15
- <sort_order>0</sort_order>
16
  </optimisewebconfig>
17
  </tabs>
18
 
@@ -20,6 +20,8 @@
20
  <optimisewebredirects translate="label comment" module="ow_redirects">
21
  <label>Mass 301 Redirects</label>
22
  <tab>optimisewebconfig</tab>
 
 
23
  <frontend_type>text</frontend_type>
24
  <sort_order>99999</sort_order>
25
  <show_in_default>1</show_in_default>
@@ -38,7 +40,7 @@
38
  <disabled_products translate="label comment" module="ow_redirects">
39
  <label>Disabled Products Check</label>
40
  <frontend_type>text</frontend_type>
41
- <sort_order>2</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>
@@ -47,8 +49,7 @@
47
  <label>Redirect disabled products?</label>
48
  <tooltip>
49
  <![CDATA[
50
- <p>With this option set to 'Yes', you can prevent visitors of disabled products from going to a 404 page. This feature was added due to popular demand.</p>
51
- <p><strong><span style="color:#df280a;">If the above 'Redirect non-404 requests?' is set to 'Yes', it overrides this option.</span></strong></p>
52
  <p style="margin-bottom: 0;">It is recommended to leave this option turned off unless you fully understand what the implications are. With this option set to 'Yes', this module will make a data call to check the product's status before every product page load. This could add a very tiny bit of additional processing before every product page load.</p>
53
  ]]>
54
  </tooltip>
@@ -62,8 +63,34 @@
62
  </fields>
63
  </disabled_products>
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  <general translate="label comment" module="ow_redirects">
66
- <label>Legacy - Upload / Download CSV File (DO NOT USE THIS - USE v1.0)</label>
67
  <comment>
68
  <![CDATA[
69
  <div class="notice-msg" style="background-image: none!important; padding: 5px;">
@@ -229,7 +256,7 @@
229
  </querystring>
230
 
231
  <cataloguesearch translate="label comment" module="ow_redirects">
232
- <label>Redirect to Catalogue Search (DEPRECATED - DO NOT USE THIS)</label>
233
  <frontend_type>text</frontend_type>
234
  <sort_order>6</sort_order>
235
  <show_in_default>1</show_in_default>
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
+ * @copyright Copyright (c) 2015 Kathir Vel
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
12
  <tabs>
13
  <optimisewebconfig translate="label comment" module="ow_redirects">
14
  <label>Optimise Web</label>
15
+ <sort_order>400</sort_order>
16
  </optimisewebconfig>
17
  </tabs>
18
 
20
  <optimisewebredirects translate="label comment" module="ow_redirects">
21
  <label>Mass 301 Redirects</label>
22
  <tab>optimisewebconfig</tab>
23
+ <class>ow-system-section ow-mass-301-redirects-section</class>
24
+ <header_css>ow-system-header ow-mass-301-redirects-header</header_css>
25
  <frontend_type>text</frontend_type>
26
  <sort_order>99999</sort_order>
27
  <show_in_default>1</show_in_default>
40
  <disabled_products translate="label comment" module="ow_redirects">
41
  <label>Disabled Products Check</label>
42
  <frontend_type>text</frontend_type>
43
+ <sort_order>1</sort_order>
44
  <show_in_default>1</show_in_default>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
49
  <label>Redirect disabled products?</label>
50
  <tooltip>
51
  <![CDATA[
52
+ <p>With this option set to 'Yes', you can prevent visitors of disabled products from going to a 404 page.</p>
 
53
  <p style="margin-bottom: 0;">It is recommended to leave this option turned off unless you fully understand what the implications are. With this option set to 'Yes', this module will make a data call to check the product's status before every product page load. This could add a very tiny bit of additional processing before every product page load.</p>
54
  ]]>
55
  </tooltip>
63
  </fields>
64
  </disabled_products>
65
 
66
+ <disabled_categories translate="label comment" module="ow_redirects">
67
+ <label>Disabled Categories Check</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>2</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <fields>
74
+ <enabled translate="label tooltip comment" module="ow_redirects">
75
+ <label>Redirect disabled categories?</label>
76
+ <tooltip>
77
+ <![CDATA[
78
+ <p>With this option set to 'Yes', you can prevent visitors of disabled categories from going to a 404 page.</p>
79
+ <p style="margin-bottom: 0;">It is recommended to leave this option turned off unless you fully understand what the implications are. With this option set to 'Yes', this module will make a data call to check the category's status before every category page load. This could add a very tiny bit of additional processing before every category page load.</p>
80
+ ]]>
81
+ </tooltip>
82
+ <frontend_type>select</frontend_type>
83
+ <source_model>adminhtml/system_config_source_yesno</source_model>
84
+ <sort_order>1</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <show_in_website>1</show_in_website>
87
+ <show_in_store>1</show_in_store>
88
+ </enabled>
89
+ </fields>
90
+ </disabled_categories>
91
+
92
  <general translate="label comment" module="ow_redirects">
93
+ <label>Legacy - Deprecated - DO NOT USE THIS - Use Redirects System v1.0</label>
94
  <comment>
95
  <![CDATA[
96
  <div class="notice-msg" style="background-image: none!important; padding: 5px;">
256
  </querystring>
257
 
258
  <cataloguesearch translate="label comment" module="ow_redirects">
259
+ <label>Redirect to Catalogue Search - DEPRECATED - DO NOT USE THIS OPTION</label>
260
  <frontend_type>text</frontend_type>
261
  <sort_order>6</sort_order>
262
  <show_in_default>1</show_in_default>
app/design/adminhtml/default/default/template/optimiseweb/redirects/system/config/fieldset/hint.phtml CHANGED
@@ -6,6 +6,10 @@
6
  <strong style="color:#ea7601;"><?php echo $this->getModuleName(); ?> v<?php echo $this->getModuleVersion(); ?></strong> by <a target="_blank" href="<?php echo $this->getOptimiseWebUrl(); ?>"><strong>Optimise Web</strong></a>
7
  </h4>
8
 
 
 
 
 
9
  <p>
10
  <a target="_blank" href="<?php echo $this->getOptimiseWebUrl(); ?>"><strong>Optimise Web</strong></a> is a <strong>Full Service Digital Agency</strong> from Edinburgh (Scotland, UK).
11
  The author of this extension, <a target="_blank" href="<?php echo $this->getKathirVelUrl(); ?>"><strong>Kathir 'Sid' Vel</strong></a>, is our eCommerce and Digital Marketing specialist.
6
  <strong style="color:#ea7601;"><?php echo $this->getModuleName(); ?> v<?php echo $this->getModuleVersion(); ?></strong> by <a target="_blank" href="<?php echo $this->getOptimiseWebUrl(); ?>"><strong>Optimise Web</strong></a>
7
  </h4>
8
 
9
+ <h3>
10
+ <a href="https://github.com/vkathirvel/Magento-Extension-Redirects/wiki" target="_blank" title="Click here for this module's configuration and usage documentation"><strong>Click here for this module's configuration and usage documentation</strong></a>
11
+ </h3>
12
+
13
  <p>
14
  <a target="_blank" href="<?php echo $this->getOptimiseWebUrl(); ?>"><strong>Optimise Web</strong></a> is a <strong>Full Service Digital Agency</strong> from Edinburgh (Scotland, UK).
15
  The author of this extension, <a target="_blank" href="<?php echo $this->getKathirVelUrl(); ?>"><strong>Kathir 'Sid' Vel</strong></a>, is our eCommerce and Digital Marketing specialist.
app/etc/modules/Optimiseweb_Redirects.xml CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
- * @copyright Copyright (c) 2014 Optimise Web
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
3
  /**
4
  * @package Optimiseweb_Redirects
5
  * @author Kathir Vel (sid@optimiseweb.co.uk)
6
+ * @copyright Copyright (c) 2015 Kathir Vel
7
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
  */
9
  -->
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Optimiseweb_Redirects</name>
4
- <version>0.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Set up bulk 301 redirects for 404 pages by uploading the URL data in a CSV file. No HTACCESS or DB changes!</summary>
10
  <description>Set up bulk 301 redirects for 404 pages by uploading the URL data in a CSV file. No HTACCESS or DB changes!</description>
11
- <notes>* Tidy up</notes>
12
  <authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
13
- <date>2014-12-15</date>
14
- <time>12:29:19</time>
15
- <contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="43abb095865b190b0c2507bb9f086aa2"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="7aa495fa61b5dc8701ede38c4e00b343"/><file name="Download1.php" hash="83690ba4e42f356d92aecf3c5ef6d5d3"/><file name="Downloadquerystringfile.php" hash="51b51f70aa042bd09586fd03cfc55125"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ca14b5ce332105a9a21a0bdc61200919"/></dir><dir name="Model"><file name="Redirector.php" hash="121617daa7ae28632bdf80e3989029ac"/></dir><dir name="doc"><file name="Readme.html" hash="303e2db27b7d7c6fe0b3efdc5e18aaff"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dd58dc054f2933de6f68a1986c444ab5"/><file name="config.xml" hash="35fb05077f9bd1bf285397f1325b9c38"/><file name="system.xml" hash="c956a94feb35c6cdaf1a36fcdf998141"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Optimiseweb_Redirects.xml" hash="52171a52ca4993b6d25b51df3b762897"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Optimiseweb_Redirects.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="optimiseweb"><dir name="redirects"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="4ffed9569ab276f56b53f9e0de93eadc"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Optimiseweb_Redirects</name>
4
+ <version>0.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Set up bulk 301 redirects for 404 pages by uploading the URL data in a CSV file. No HTACCESS or DB changes!</summary>
10
  <description>Set up bulk 301 redirects for 404 pages by uploading the URL data in a CSV file. No HTACCESS or DB changes!</description>
11
+ <notes>* Added functionality to redirect disabled categories and products</notes>
12
  <authors><author><name>Kathir Vel</name><user>OptimiseWeb</user><email>info@optimiseweb.co.uk</email></author></authors>
13
+ <date>2015-05-20</date>
14
+ <time>10:55:39</time>
15
+ <contents><target name="magecommunity"><dir name="Optimiseweb"><dir name="Redirects"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="c3354a9a5fa6e585ccf01bb344286f16"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Download.php" hash="271ee03fca9ecce398eeb174bc3f1c32"/><file name="Download1.php" hash="da149ec109a496ebabc0444d5bf53232"/><file name="Downloadquerystringfile.php" hash="e458890aa9fba432f97ed4f38985a7da"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="69ad76fea40d7c3a73e24210b83c52ad"/></dir><dir name="Model"><file name="Redirector.php" hash="7d51d90d7e02947bf0487925c5f13fc5"/></dir><dir name="doc"><file name="Readme.html" hash="14bbc48e3864e316759b8dfde12c2d58"/></dir><dir name="etc"><file name="adminhtml.xml" hash="513115a18f7dc90511466fdb3ffc5ddc"/><file name="config.xml" hash="32acd1e7109479a7004220b4c4a326db"/><file name="system.xml" hash="f2f912c491e5f9a3dd9601a5bb197587"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Optimiseweb_Redirects.xml" hash="fc570b2799c319db61907ac4794f99d5"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Optimiseweb_Redirects.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="optimiseweb"><dir name="redirects"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="79322c0ba284256e1696c40b6bf466ff"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>