I'm new to magento and I have some troubles. I've managed to filter products by style or color, which are configurable products, but I can't figure out how to filter by size, where products are simple products.
Here's the code I use for style and color:
if (isset($_GET['style'])) {
$this->addAttributeToFilter('style', array('eq' => $_GET['style']));
if (isset($_GET['solid'])) {
$this->addAttributeToFilter('solid', array('eq' => $_GET['solid']));
}
I get attributute name and ID from URL. My filter show styles and color only if they are available for products inside the filtered category, but it always show all sizes and when I try to filter any of them, nothing is returned. Also, there is a problem when I select for example more than 1 style to filter. I should get 2 products with two styles, but instead I get only one (first one).