I need to print a URL on a template that leads to the search page with the search query parameter already predefined.
This is the code I have at the moment:
$url = Mage::getUrl('catalogsearch/advanced/result', array('_use_rewrite' => true, '_query' => $query));
$queryis an array containing the search, e.g.
$query['flavor'] = "bacon" to search using attributes.
If I understand correctly,
_use_rewrite should check if there is any URL rewrite already in place, and return that URL instead. I will use URL rewriting later on, but at the moment there is not any rewrite defined, so I assume it should return just the regular URL.
getUrl function doesn't return the search URL correctly when
_use_rewrite_ is set to true, and it instead returns the base store URL without the
catalogsearch module on the URL. I.e.:
_use_rewrite is set to false, it prints the URL correctly:
Is everything working as expected?