From a controller I redirect to a configurable product's page by
$productUrl = $this->_customSearch();
$url = Mage::getBaseUrl().$productUrl.'.html';
header('Location: '.$url);
die();
The children products can be searched by specific attribute (corresponding to their color group) and I want when the user is redirected to the product page - the attribute "Color" (a drop-down menu) to already have the certain color selected, depending on the searched value.
Now, what I cannot wrap my mind around is how to make the attribute auto-selected when the page loads. In the controller I can get the color of the product from the product object, but what next? I guess I have to deal with Ajax
here, but the URL of the product's page has nothing that can give me a hint.
Any ideas?