Version Notes
Enjoy it ;)
Download this release
Release Info
Developer | Magento Core Team |
Extension | IG_404ToSearch |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/IG/404ToSearch/CHANGELOG.txt +0 -0
- app/code/community/IG/404ToSearch/COMPATIBILITY.txt +9 -0
- app/code/community/IG/404ToSearch/Helper/Data.php +111 -0
- app/code/community/IG/404ToSearch/LICENSE.txt +72 -0
- app/code/community/IG/404ToSearch/Model/Cmsheader.php +24 -0
- app/code/community/IG/404ToSearch/controllers/IndexController.php +94 -0
- app/code/community/IG/404ToSearch/etc/config.xml +103 -0
- app/code/community/IG/404ToSearch/etc/system.xml +83 -0
- app/design/frontend/base/default/layout/ig_404tosearch.xml +51 -0
- app/design/frontend/base/default/template/ig_404tosearch/result.phtml +61 -0
- app/etc/modules/IG_404ToSearch.xml +8 -0
- package.xml +18 -0
app/code/community/IG/404ToSearch/CHANGELOG.txt
ADDED
File without changes
|
app/code/community/IG/404ToSearch/COMPATIBILITY.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
This file reports the compatibility table for this extension.
|
2 |
+
If your Magento version is not included in this list you may try
|
3 |
+
using the extension but AT YOUR OWN RISK.
|
4 |
+
|
5 |
+
CE 1.4.2
|
6 |
+
CE 1.5.0
|
7 |
+
CE 1.5.1
|
8 |
+
CE 1.6.0
|
9 |
+
CE 1.6.1
|
app/code/community/IG/404ToSearch/Helper/Data.php
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* IDEALIAGroup srl
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
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://www.idealiagroup.com/magento-ext-license.html
|
11 |
+
*
|
12 |
+
* @category IG
|
13 |
+
* @package IG_404ToSearch
|
14 |
+
* @copyright Copyright (c) 2012 IDEALIAGroup srl (http://www.idealiagroup.com)
|
15 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
16 |
+
*/
|
17 |
+
|
18 |
+
class IG_404ToSearch_Helper_Data extends Mage_Core_Helper_Abstract
|
19 |
+
{
|
20 |
+
const XML_PATH_GENERAL_ENABLED = 'ig_404tosearch/general/enabled';
|
21 |
+
const XML_PATH_GENERAL_TEMPLATE = 'ig_404tosearch/general/template';
|
22 |
+
const XML_PATH_GENERAL_TITLE = 'ig_404tosearch/general/page_title';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Return true if service is enabled
|
26 |
+
*
|
27 |
+
* @return bool
|
28 |
+
*/
|
29 |
+
public function getIsEnabled()
|
30 |
+
{
|
31 |
+
return (bool)Mage::getStoreConfig(self::XML_PATH_GENERAL_ENABLED);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get search mode
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
public function getTemplate()
|
40 |
+
{
|
41 |
+
return Mage::getStoreConfig(self::XML_PATH_GENERAL_TEMPLATE);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get title
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function getTitle()
|
50 |
+
{
|
51 |
+
return Mage::getStoreConfig(self::XML_PATH_GENERAL_TITLE);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Convert template
|
56 |
+
*
|
57 |
+
* @param string $path
|
58 |
+
* @param array $qs
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function getQueryString($path, $qs)
|
62 |
+
{
|
63 |
+
$path = str_replace('ig_404tosearch/index/noRoute/q/', '', $path);
|
64 |
+
|
65 |
+
$return = $this->getTemplate();
|
66 |
+
if (!preg_match_all("/\{\{([^\}]+)\}\}/", $return, $matches))
|
67 |
+
return null;
|
68 |
+
|
69 |
+
|
70 |
+
$pathInfo = pathinfo($path);
|
71 |
+
$path = $pathInfo['dirname'].'/'.$pathInfo['filename'];
|
72 |
+
$pathA = explode('/', $path);
|
73 |
+
|
74 |
+
foreach($matches[1] as $param)
|
75 |
+
{
|
76 |
+
$v = '';
|
77 |
+
|
78 |
+
if ($param == '_url_')
|
79 |
+
{
|
80 |
+
$v = $path;
|
81 |
+
}
|
82 |
+
elseif (preg_match("/_url:(\-*\d+)_/", $param, $matches))
|
83 |
+
{
|
84 |
+
$n = intval($matches[1]);
|
85 |
+
$start = $n>=0 ? $n+1 : count($pathA)+$n;
|
86 |
+
|
87 |
+
for ($i=$start; $i<count($pathA); $i++)
|
88 |
+
{
|
89 |
+
$v .= $pathA[$i].' ';
|
90 |
+
}
|
91 |
+
}
|
92 |
+
elseif (preg_match("/_url\[(\-*\d+)\]_/", $param, $matches))
|
93 |
+
{
|
94 |
+
$n = intval($matches[1]);
|
95 |
+
$start = $n>=0 ? $n+1 : count($pathA)+$n;
|
96 |
+
|
97 |
+
$v = $pathA[$start];
|
98 |
+
}
|
99 |
+
elseif (isset($qs[$param]))
|
100 |
+
{
|
101 |
+
$v = $qs[$param];
|
102 |
+
}
|
103 |
+
|
104 |
+
$v = trim(preg_replace('/\W/', ' ', $v));
|
105 |
+
$return = str_replace('{{'.$param.'}}', $v, $return);
|
106 |
+
}
|
107 |
+
|
108 |
+
$return = trim($return);
|
109 |
+
return $return;
|
110 |
+
}
|
111 |
+
}
|
app/code/community/IG/404ToSearch/LICENSE.txt
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
IDEALIAGroup srl EULA
|
2 |
+
www.idealiagroup.com
|
3 |
+
www.magentospecialist.it
|
4 |
+
|
5 |
+
THIS LICENSE AGREEMENT (HEREINAFTER AGREEMENT) IS AN AGREEMENT BETWEEN YOU (THE
|
6 |
+
PERSON OR COMPANY WHO IS BEING LICENSED TO USE THE SOFTWARE OR DOCUMENTATION)
|
7 |
+
AND IDEALIAGROUP SRL. (HEREINAFTER WE/US/OUR). THE AGREEMENT APPLIES TO ALL
|
8 |
+
PRODUCTS/SOFTWARE/SCRIPTS/SERVICES YOU PURCHASE FROM US.
|
9 |
+
|
10 |
+
1. By purchasing the Software you acknowledge that you have read this Agreement,
|
11 |
+
and that you agree to the content of the Agreement and its terms, and agree
|
12 |
+
to use the Software in compliance with this Agreement.
|
13 |
+
|
14 |
+
2. The Agreement comes into legal force at the moment when you order our
|
15 |
+
Software from our site or receive it through email or on data medium at the
|
16 |
+
our discretion.
|
17 |
+
|
18 |
+
3. We are the copyright holder of the Product. The Product or a portion of
|
19 |
+
it is a copyrightable matter and is liable to protection by the law.
|
20 |
+
Any activity that infringes terms of this Agreement violates copyright
|
21 |
+
law and will be prosecuted according to the current law. We reserve the
|
22 |
+
right to revoke the license of any user who is holding an invalid
|
23 |
+
license.
|
24 |
+
|
25 |
+
4. You may not use any part of the code in whole or part in any other
|
26 |
+
software or product or website without our explicit written permission.
|
27 |
+
|
28 |
+
5. You have the right, within the duration of the license, to modify and
|
29 |
+
adapt the product for your specific needs.
|
30 |
+
|
31 |
+
6. You may not give, sell, distribute, sub-license, rent, lease or lend
|
32 |
+
any portion of the Product or Documentation to anyone without our
|
33 |
+
explicit written permission. You may not place the Product on a server
|
34 |
+
so that it is accessible via a public network such as the Internet
|
35 |
+
for distribution purposes without our explicit written permission.
|
36 |
+
|
37 |
+
7. You are bound to preserve the copyright information intact, this
|
38 |
+
includes the text/link at bottom of templates.
|
39 |
+
|
40 |
+
8. We reserve the right to publish a selected list of buyers of our
|
41 |
+
Product.
|
42 |
+
|
43 |
+
9. We will not be liable to you for any damages (including any loss of
|
44 |
+
profits/saving, or incidental or consequential) caused to you, your
|
45 |
+
information and your business arising out of the use or inability to use
|
46 |
+
this Product.
|
47 |
+
|
48 |
+
10. We are not liable for prosecution arising from use of the Product
|
49 |
+
against law or for any illegal use.
|
50 |
+
|
51 |
+
11. If you fail to use the Product in accordance with the terms and
|
52 |
+
conditions of this License Agreement, it constitutes a breach of the
|
53 |
+
agreement, and your license to use the program is revoked.
|
54 |
+
|
55 |
+
12. IDEALIAGroup srl reserves the right to change this license agreement at
|
56 |
+
any time and impose its clauses at any given time.
|
57 |
+
|
58 |
+
13. License agreement remains effective until terminated. We retain the right
|
59 |
+
to terminate your license to use the Product at any time, if in its sole
|
60 |
+
discretion, you are not abiding by the terms of the Agreement, including,
|
61 |
+
but not limited to, obscuring or removing any link or copyright notice as
|
62 |
+
specified in this agreement. You may terminate it at any time by
|
63 |
+
destroying all copies of the Product. Termination of this Agreement does
|
64 |
+
not bind us to return you the amount spent for purchase of the Product.
|
65 |
+
|
66 |
+
14. If you continue to use the Software after IDEALIAGroup srl gives you
|
67 |
+
notice of termination of your license, you hereby agree to accept an
|
68 |
+
injunction to enjoin you from its further use and to pay all costs
|
69 |
+
(including but not limited to reasonable attorney fees) to enforce our
|
70 |
+
revocation of your license and any damages suffered by us because of
|
71 |
+
your misuse of the Product.
|
72 |
+
|
app/code/community/IG/404ToSearch/Model/Cmsheader.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* IDEALIAGroup srl
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
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://www.idealiagroup.com/magento-ext-license.html
|
11 |
+
*
|
12 |
+
* @category IG
|
13 |
+
* @package IG_404ToSearch
|
14 |
+
* @copyright Copyright (c) 2012 IDEALIAGroup srl (http://www.idealiagroup.com)
|
15 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
16 |
+
*/
|
17 |
+
|
18 |
+
class IG_404ToSearch_Model_Cmsheader extends Mage_Core_Model_Config_Data
|
19 |
+
{
|
20 |
+
public function getvalue()
|
21 |
+
{
|
22 |
+
return Mage::helper('ig_404tosearch')->__('Create a CMS Block named "ig_404tosearch"');
|
23 |
+
}
|
24 |
+
}
|
app/code/community/IG/404ToSearch/controllers/IndexController.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* IDEALIAGroup srl
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
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://www.idealiagroup.com/magento-ext-license.html
|
11 |
+
*
|
12 |
+
* @category IG
|
13 |
+
* @package IG_404ToSearch
|
14 |
+
* @copyright Copyright (c) 2012 IDEALIAGroup srl (http://www.idealiagroup.com)
|
15 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
16 |
+
*/
|
17 |
+
|
18 |
+
require_once "Mage/Cms/controllers/IndexController.php";
|
19 |
+
class IG_404ToSearch_IndexController extends Mage_Cms_IndexController
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Render CMS 404 Not found page
|
23 |
+
*
|
24 |
+
* @param string $coreRoute
|
25 |
+
*/
|
26 |
+
public function noRouteAction($coreRoute = null)
|
27 |
+
{
|
28 |
+
$helper = Mage::helper('ig_404tosearch');
|
29 |
+
|
30 |
+
if (!$helper->getIsEnabled())
|
31 |
+
return parent::noRouteAction($coreRoute);
|
32 |
+
|
33 |
+
$urlInfo = parse_url($_SERVER['REQUEST_URI']);
|
34 |
+
|
35 |
+
$qs = $helper->getQueryString($urlInfo['path'], $_REQUEST);
|
36 |
+
$queryHelper = Mage::helper('catalogsearch');
|
37 |
+
|
38 |
+
$this->getRequest()->setParam($queryHelper->getQueryParamName(), $qs);
|
39 |
+
|
40 |
+
$query = $queryHelper->getQuery();
|
41 |
+
$query->setStoreId(Mage::app()->getStore()->getId());
|
42 |
+
|
43 |
+
if ($query->getQueryText())
|
44 |
+
{
|
45 |
+
if (Mage::helper('catalogsearch')->isMinQueryLength())
|
46 |
+
{
|
47 |
+
$query->setId(0)
|
48 |
+
->setIsActive(1)
|
49 |
+
->setIsProcessed(1);
|
50 |
+
}
|
51 |
+
else
|
52 |
+
{
|
53 |
+
if ($query->getId())
|
54 |
+
{
|
55 |
+
$query->setPopularity($query->getPopularity()+1);
|
56 |
+
}
|
57 |
+
else
|
58 |
+
{
|
59 |
+
$query->setPopularity(1);
|
60 |
+
}
|
61 |
+
|
62 |
+
if ($query->getRedirect())
|
63 |
+
{
|
64 |
+
$query->save();
|
65 |
+
$this->getResponse()->setRedirect($query->getRedirect());
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
else
|
69 |
+
{
|
70 |
+
$query->prepare();
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
Mage::helper('catalogsearch')->checkNotes();
|
75 |
+
|
76 |
+
$this->getResponse()->setHttpResponseCode(404);
|
77 |
+
|
78 |
+
$this->loadLayout();
|
79 |
+
$this->getLayout()->getBlock('head')->setTitle($helper->getTitle());
|
80 |
+
$this->_initLayoutMessages('catalog/session');
|
81 |
+
$this->_initLayoutMessages('checkout/session');
|
82 |
+
$this->renderLayout();
|
83 |
+
|
84 |
+
if (!Mage::helper('catalogsearch')->isMinQueryLength())
|
85 |
+
{
|
86 |
+
$query->save();
|
87 |
+
}
|
88 |
+
}
|
89 |
+
else
|
90 |
+
{
|
91 |
+
$this->_redirectReferer();
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
app/code/community/IG/404ToSearch/etc/config.xml
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* IDEALIAGroup srl
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://www.idealiagroup.com/magento-ext-license.html
|
12 |
+
*
|
13 |
+
* @category IG
|
14 |
+
* @package IG_404ToSearch
|
15 |
+
* @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
|
16 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<modules>
|
21 |
+
<IG_404ToSearch>
|
22 |
+
<version>1.0.0</version>
|
23 |
+
</IG_404ToSearch>
|
24 |
+
</modules>
|
25 |
+
|
26 |
+
<frontend>
|
27 |
+
<routers>
|
28 |
+
<ig_404tosearch>
|
29 |
+
<use>standard</use>
|
30 |
+
<args>
|
31 |
+
<module>IG_404ToSearch</module>
|
32 |
+
<frontName>ig_404tosearch</frontName>
|
33 |
+
</args>
|
34 |
+
</ig_404tosearch>
|
35 |
+
</routers>
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<ig_404tosearch>
|
39 |
+
<file>ig_404tosearch.xml</file>
|
40 |
+
</ig_404tosearch>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
</frontend>
|
44 |
+
|
45 |
+
<global>
|
46 |
+
<helpers>
|
47 |
+
<ig_404tosearch>
|
48 |
+
<class>IG_404ToSearch_Helper</class>
|
49 |
+
</ig_404tosearch>
|
50 |
+
</helpers>
|
51 |
+
<models>
|
52 |
+
<ig_404tosearch>
|
53 |
+
<class>IG_404ToSearch_Model</class>
|
54 |
+
</ig_404tosearch>
|
55 |
+
</models>
|
56 |
+
<routers>
|
57 |
+
<cms>
|
58 |
+
<rewrite>
|
59 |
+
<index>
|
60 |
+
<to>ig_404tosearch/index</to>
|
61 |
+
<override_actions>true</override_actions>
|
62 |
+
<actions>
|
63 |
+
<noroute><to>ig_404tosearch/index/noroute</to></noroute>
|
64 |
+
</actions>
|
65 |
+
</index>
|
66 |
+
</rewrite>
|
67 |
+
</cms>
|
68 |
+
</routers>
|
69 |
+
</global>
|
70 |
+
|
71 |
+
<adminhtml>
|
72 |
+
<acl>
|
73 |
+
<resources>
|
74 |
+
<admin>
|
75 |
+
<children>
|
76 |
+
<system>
|
77 |
+
<children>
|
78 |
+
<config>
|
79 |
+
<children>
|
80 |
+
<ig_404tosearch translate="title" module="ig_404tosearch">
|
81 |
+
<title>IG_404ToSearch</title>
|
82 |
+
<sort_order>50</sort_order>
|
83 |
+
</ig_404tosearch>
|
84 |
+
</children>
|
85 |
+
</config>
|
86 |
+
</children>
|
87 |
+
</system>
|
88 |
+
</children>
|
89 |
+
</admin>
|
90 |
+
</resources>
|
91 |
+
</acl>
|
92 |
+
</adminhtml>
|
93 |
+
|
94 |
+
<default>
|
95 |
+
<ig_404tosearch>
|
96 |
+
<general>
|
97 |
+
<enabled>1</enabled>
|
98 |
+
<page_title>Page Not Found</page_title>
|
99 |
+
<template>{{_url_}}</template>
|
100 |
+
</general>
|
101 |
+
</ig_404tosearch>
|
102 |
+
</default>
|
103 |
+
</config>
|
app/code/community/IG/404ToSearch/etc/system.xml
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* IDEALIAGroup srl
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://www.idealiagroup.com/magento-ext-license.html
|
12 |
+
*
|
13 |
+
* @category IG
|
14 |
+
* @package IG_404ToSearch
|
15 |
+
* @copyright Copyright (c) 2010-2011 IDEALIAGroup srl (http://www.idealiagroup.com)
|
16 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<tabs>
|
21 |
+
<ig translate="label" module="ig_404tosearch">
|
22 |
+
<label>IdealiaGroup</label>
|
23 |
+
<sort_order>200</sort_order>
|
24 |
+
</ig>
|
25 |
+
</tabs>
|
26 |
+
<sections>
|
27 |
+
<ig_404tosearch translate="label" module="ig_404tosearch">
|
28 |
+
<label>IG 404 To Search</label>
|
29 |
+
<tab>ig</tab>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<groups>
|
36 |
+
<general translate="label">
|
37 |
+
<label>General</label>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>10</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
<fields>
|
44 |
+
<enabled translate="label">
|
45 |
+
<label>Enable 404-to-search</label>
|
46 |
+
<frontend_type>select</frontend_type>
|
47 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
48 |
+
<sort_order>10</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
</enabled>
|
53 |
+
<page_title translate="label">
|
54 |
+
<label>Page Title</label>
|
55 |
+
<frontend_type>text</frontend_type>
|
56 |
+
<sort_order>20</sort_order>
|
57 |
+
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
+
</page_title>
|
61 |
+
<template translate="label">
|
62 |
+
<label>Search Template</label>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<sort_order>30</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</template>
|
69 |
+
<cms_header>
|
70 |
+
<label>CMS Header</label>
|
71 |
+
<frontend_type>label</frontend_type>
|
72 |
+
<backend_model>ig_404tosearch/cmsheader</backend_model>
|
73 |
+
<sort_order>40</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</cms_header>
|
78 |
+
</fields>
|
79 |
+
</general>
|
80 |
+
</groups>
|
81 |
+
</ig_404tosearch>
|
82 |
+
</sections>
|
83 |
+
</config>
|
app/design/frontend/base/default/layout/ig_404tosearch.xml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* IDEALIAGroup srl
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://www.idealiagroup.com/magento-ext-license.html
|
12 |
+
*
|
13 |
+
* @category IG
|
14 |
+
* @package IG_404ToSearch
|
15 |
+
* @copyright Copyright (c) 2012 IDEALIAGroup srl (http://www.idealiagroup.com)
|
16 |
+
* @license http://www.idealiagroup.com/magento-ext-license.html
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<layout version="0.1.0">
|
20 |
+
<ig_404tosearch_index_noroute translate="label">
|
21 |
+
<label>Quick Search Form</label>
|
22 |
+
<reference name="root">
|
23 |
+
<action method="setTemplate"><template>page/3columns.phtml</template></action>
|
24 |
+
</reference>
|
25 |
+
<reference name="left">
|
26 |
+
<block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
|
27 |
+
</reference>
|
28 |
+
<reference name="content">
|
29 |
+
<block type="catalogsearch/result" name="search.result" template="ig_404tosearch/result.phtml">
|
30 |
+
<block type="cms/block" name="404header">
|
31 |
+
<action method="setBlockId"><block_id>ig_404tosearch</block_id></action>
|
32 |
+
</block>
|
33 |
+
|
34 |
+
<block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
|
35 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
36 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
37 |
+
</block>
|
38 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
39 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
40 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
41 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
42 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
43 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
44 |
+
</block>
|
45 |
+
<action method="setListOrders"/>
|
46 |
+
<action method="setListModes"/>
|
47 |
+
<action method="setListCollection"/>
|
48 |
+
</block>
|
49 |
+
</reference>
|
50 |
+
</ig_404tosearch_index_noroute>
|
51 |
+
</layout>
|
app/design/frontend/base/default/template/ig_404tosearch/result.phtml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-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 design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<div class="std 404tosearch-header">
|
28 |
+
<?php echo $this->getChildHtml('404header') ?>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<?php if($this->getResultCount()): ?>
|
32 |
+
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
|
33 |
+
|
34 |
+
<div class="page-title">
|
35 |
+
<?php if ($this->helper('rss/catalog')->getTagFeedUrl()): ?>
|
36 |
+
<a href="<?php echo $this->helper('rss/catalog')->getTagFeedUrl() ?>" class="nobr link-rss"><?php echo $this->__('Subscribe to Feed') ?></a>
|
37 |
+
<?php endif; ?>
|
38 |
+
<h1><?php echo ($this->getHeaderText() || $this->getHeaderText() === false) ? $this->getHeaderText() : $this->__("Search results for '%s'", $this->helper('catalogsearch')->getEscapedQueryText()) ?></h1>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<?php if ($messages = $this->getNoteMessages()):?>
|
42 |
+
<p class="note-msg">
|
43 |
+
<?php foreach ($messages as $message):?>
|
44 |
+
<?php echo $message?><br />
|
45 |
+
<?php endforeach;?>
|
46 |
+
</p>
|
47 |
+
<?php endif; ?>
|
48 |
+
<?php echo $this->getProductListHtml() ?>
|
49 |
+
<?php else: ?>
|
50 |
+
<div class="page-title">
|
51 |
+
<h1><?php echo ($this->getHeaderText() || $this->getHeaderText() === false) ? $this->getHeaderText() : $this->__("Search results for '%s'", $this->helper('catalogsearch')->getEscapedQueryText()) ?></h1>
|
52 |
+
</div>
|
53 |
+
<p class="note-msg">
|
54 |
+
<?php echo ($this->getNoResultText()) ? $this->getNoResultText() : $this->__('Your search returns no results.') ?>
|
55 |
+
<?php if ($messages = $this->getNoteMessages()):?>
|
56 |
+
<?php foreach ($messages as $message):?>
|
57 |
+
<br /><?php echo $message?>
|
58 |
+
<?php endforeach;?>
|
59 |
+
<?php endif; ?>
|
60 |
+
</p>
|
61 |
+
<?php endif; ?>
|
app/etc/modules/IG_404ToSearch.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<IG_404ToSearch>
|
4 |
+
<active>true</active>
|
5 |
+
<codePool>community</codePool>
|
6 |
+
</IG_404ToSearch>
|
7 |
+
</modules>
|
8 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>IG_404ToSearch</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.idealiagroup.com/magento-ext-license.html">Commercial</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>IDEALIAGroup 404-to-search</summary>
|
10 |
+
<description>IDEALIAGroup 404-to-search</description>
|
11 |
+
<notes>Enjoy it ;)</notes>
|
12 |
+
<authors><author><name>Riccardo Tempesta</name><user>auto-converted</user><email>tempesta@idealiagroup.com</email></author><author><name>Marco Giorgetti</name><user>auto-converted</user><email>giorgetti@idealiagroup.com</email></author></authors>
|
13 |
+
<date>2011-12-28</date>
|
14 |
+
<time>10:13:57</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="IG"><dir name="404ToSearch"><dir name="Helper"><file name="Data.php" hash="4268a7d9e27f1ff5ffba72c904f61784"/></dir><dir name="Model"><file name="Cmsheader.php" hash="3e94db77c4d18116d4e2575721fd9e7d"/></dir><dir name="controllers"><file name="IndexController.php" hash="7f981bca5b036baf0ccc032c9e571a4b"/></dir><dir name="etc"><file name="config.xml" hash="69fc1afeec3131f20b1013e88df6b9c7"/><file name="system.xml" hash="c81de30a90950cad2bf444c6d9c954ad"/></dir><file name="CHANGELOG.txt" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="COMPATIBILITY.txt" hash="d3b64c7bb51137148e6b0feed3224af5"/><file name="LICENSE.txt" hash="b3688e16b11d101dd15b47c62cd2567d"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IG_404ToSearch.xml" hash="361122d80952e5b3564cbaed45fa609a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ig_404tosearch.xml" hash="4564c27515487b96583be48003b2176e"/></dir><dir name="template"><dir name="ig_404tosearch"><file name="result.phtml" hash="599543e92d1968b3c4ccd6a7111f570a"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|