I want to show Configurable Product Options on category Page for that i have added this code in my list.phtml. it shows the options of the configurable products.
<?php if($_product->isConfigurable()): ?>
<?php $attributes = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product); ?>
<?php foreach($attributes as $attribute): ?>
<ul><li><?php echo $attribute['label']; ?></li></ul>
<select name="super_attribute[<?php echo $attribute['attribute_id'] ?>]" id="attribute<?php echo $attribute['attribute_id'] ?>">
<option> <?php echo $this->__('Choose an option') ?></option>
<?php $values = $attribute['values']; ?>
<?php foreach($values as $value): ?>
<option value="<?php echo $value['value_index']; ?>" price="<?php echo $value['pricing_value']; ?>"><?php echo $value['label']; ?></option>
<?php endforeach; ?>
</select>
<?php endforeach; ?>
<?php endif; ?>
But the problem is
1.how to change Product price according to selected options?
- In some products there are two configurable options and the values of second one depends on the First option Selected(on product page).
How to Do the same on List page?