Beforehand I have to tell: I'm a total n00b on Magento and what I need to know is more a "common practice" or "standard" about how is something achieved in Magento, since I have to maintain (in record time) a Magento distribution (perhaps the previous developers created a dirty way to do what I will ask, but if I don't know the standard ways, I'll have even less chances to guess the dirty ones). For the explained below, I don't expect you hit in the nail about, but give me some guidance about.
When I send a standard search query to /index.php/catalogsearch/result/?q=, I find products not present in many "states". By "states" I mean possible discrete values of "estado" attribute (a custom attribute for my Products).
As I can see, Products having certain values for "estado" are not shown in the results (even when Visibility is set to include those products in the Search results).
Question: Is there a place where I can setup a custom filter to use for my product list (as obtained from the search query) so I can keep only products in a certain state? What does Magento support, as standard, regarding that?
For "place" I mean an option in the Admin backend or, as the very last option, a chunk of code, event, callback, hook, interceptor, middleware or whatever (I'm a n00b so I don't know the true term used in magento) is used in these cases to intercept the query.
Notes: In app/design/frontend/caramel/template/catalog/product/list.phtml the first lines before iteration are:
<?php $_productCollection=$this->getLoadedProductCollection(); $_helper = $this->helper('catalog/output'); ?> <?php if(!$_productCollection->count()): ?> <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p> <p>No encontraste lo que buscabas, <a href="<?php $_SERVER['HTTP_HOST']?>/index.php/pidenos?tipo=pidenos">pídenos</a> y lo buscamos por ti.</p> <?php else: ?> <!-- more code here ... -->
And as I can see, the filter is not applied here but it comes from somewhere else, and I want to know where does it come from (usually).