Magento Forum

   
adding advanced search to the home page
 
fastrack
Member
 
Total Posts:  56
Joined:  2009-02-04
 

I’ve successfully added my advanced search to the home page by adding this:

{{block type="catalogsearch/advanced_form" name="catalogsearch_advanced_form" template="catalogsearch/advanced/form.phtml"}}

to the CMS, but instead of getting search results, I get the 404 error page. The actual advanced search page gives good search results.

I noticed that the url for the actual advanced search results is:

...index.php/catalogsearch/advanced/result/…

while the url from the advanced search results on the home page is:

...index.php/cms/index/result/…

is there a quick fix that will make my new advanced search on my home page work just like the actual advanced search page?
thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adam Moss
Sr. Member
 
Avatar
Total Posts:  248
Joined:  2009-02-11
Birmingham, UK
 

Here’s the solution - open:

app/code/core/Mage/CatalogSearch/Block/Advanced/form.php

Find the line 255 and replace this:

return $this->getUrl('*/*/result');

with this:

return $this->getUrl('/catalogsearch/advanced/result/');

That should do the trick!

 
Magento Community Magento Community
Magento Community
Magento Community
 
fastrack
Member
 
Total Posts:  56
Joined:  2009-02-04
 

Thanks Highwayman. it works!
I owe you one

 
Magento Community Magento Community
Magento Community
Magento Community
 
asdf asdff
Member
 
Total Posts:  32
Joined:  2009-09-23
 

This doesnt work for me.  My magento version is 1.3.2.3

return $this->getUrl('/catalogsearch/advanced/result/');

What i did is remove the slash at the start of the url

return $this->getUrl('catalogsearch/advanced/result/');

and it works.

One question, how can i fix the page title? when i put the advanced search at the sidebar of all the pages, the page title turns into

Catalog Advanced Search

 
Magento Community Magento Community
Magento Community
Magento Community
 
asdf asdff
Member
 
Total Posts:  32
Joined:  2009-09-23
 

This doesnt work for me.  My magento version is 1.3.2.3

return $this->getUrl('/catalogsearch/advanced/result/');

What i did is remove the slash at the start of the url

return $this->getUrl('catalogsearch/advanced/result/');

and it works.

One question, how can i fix the page title? when i put the advanced search at the sidebar of all the pages, the page title turns into

Catalog Advanced Search

 
Magento Community Magento Community
Magento Community
Magento Community
 
generalbongo
Member
 
Total Posts:  75
Joined:  2009-01-25
 

After changing the app/code/core/Mage/CatalogSearch/Block/Advanced/form.php I don’t have the 404 error anymore but now I am redirected to the homepage.

Does anyone has a solution for this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
vinnycool
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2010-06-20
 

Yes, just like Wetwet posted before…

Go to: app/code/core/Mage/CatalogSearch/Block/Advanced/form.php

Find the line 255 and replace this:

return $this->getUrl('*/*/result');

with this:

return $this->getUrl('catalogsearch/advanced/result/');

*note there’s no forward slash in the beginning.

Vinny

http://www.designincontrast.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
iiijjjiii
Jr. Member
 
Total Posts:  10
Joined:  2010-09-07
 
fastrack - 10 November 2009 09:07 AM

I’ve successfully added my advanced search to the home page by adding this:

{{block type="catalogsearch/advanced_form" name="catalogsearch_advanced_form" template="catalogsearch/advanced/form.phtml"}}

Which xml file did you add this block to?  Also where in the file did you add it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
iiijjjiii
Jr. Member
 
Total Posts:  10
Joined:  2010-09-07
 

Ahh the answer is here:
http://www.magentocommerce.com/boards/viewreply/195673/

 
Magento Community Magento Community
Magento Community
Magento Community
 
ktsixit
Member
 
Total Posts:  61
Joined:  2008-08-20
 
wetwet - 12 March 2010 07:13 AM

One question, how can i fix the page title? when i put the advanced search at the sidebar of all the pages, the page title turns into

Hi wetwet, have you found a solution to the page title issue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
amat1
Member
 
Total Posts:  36
Joined:  2011-06-13
 
Edward Sarenas - 12 March 2010 07:13 AM

This doesnt work for me.  My magento version is 1.3.2.3

return $this->getUrl('/catalogsearch/advanced/result/');


What i did is remove the slash at the start of the url

return $this->getUrl('catalogsearch/advanced/result/');

and it works.


One question, how can i fix the page title? when i put the advanced search at the sidebar of all the pages, the page title turns into
Catalog Advanced Search

Edward,

In your local copy of CatalogSearch/Block/Advanced/Form.php look for the following lines:

// add Home breadcrumb
        if ($breadcrumbs $this->getLayout()->getBlock('breadcrumbs')) {
            $breadcrumbs
->addCrumb('home', array(
                
'label'=>Mage::helper('catalogsearch')->__('Home'),
                
'title'=>Mage::helper('catalogsearch')->__('Go to Home Page'),
                
'link'=>Mage::getBaseUrl()
            ))->
addCrumb('search', array(
                
'label'=>Mage::helper('catalogsearch')->__('Catalog Advanced Search')
            ));
        
}
        
return parent::_prepareLayout();

Remove those lines or comment them out. This should prevent the “Catalog Advanced Search” from showing up in the breadcrumbs.

Kind regards,

Matthijs

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top