Having a problem with getting some data out of a configurable product, basically the 'standard' drop down select menu appears to select some as normal on my product page.
I'm doing something fiddly with an overlay and I'm going to be 'controlling' these select options using the jQuery .val() function.
The .val() function needs to take the tags 'value' field.
Now I can't find out how to pull this value when getting configurable product information...
I'm pulling information about the configurable products like follows:
$attrs = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
foreach($attrs as $attr) {
$options = $attr['values'];
foreach($options as $option) {
echo "<p class='swatchie' id='".$attr['attribute_id']."' title='".$attr[]."'>{$option['store_label']}</p><br />";
}
}
As you can see, the attr in title is blank as this is where I need to pull in the option value. the html magento gives for the option boxes looks like this:
<option value="">Choose an Option...</option><option value="41" price="0">King</option><option value="42" price="540">Super King +£540.00</option></select>
I think I've found 'where' the value I need is located,
app/code/core/mage/catalog/model/resource/product/type/configurable/attribute/collection.php
Line 258,
$values[$item->getId() . ':' . $option['value']] = array(
'product_super_attribute_id' => $item->getId(),
'value_index' => $option['value'],
Value index is what i think i want, no idea how to get hold of it though
Any ideas of how to pull this thorugh?