I currently have an extension that replaces the old product view page with a custom one, showing several configurable options, as the customer goes through the options it filters down to a simple product and they can purchase it
I currently have 3 links placed at the bottom of the page which are attributes (related to the simple products) but they only refer to the configurable product.
I have changed the following;
<?php if($_product->getPdfLink()){ ?>
<a href="<?php echo $_product->getPdfLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/acrobat_reader_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
<?php if($_product->getPsLink()){ ?>
<a href="<?php echo $_product->getPsLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/photoshop_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
<?php if($_product->getIndesignLink()){ ?>
<a href="<?php echo $_product->getIndesignLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/indesign_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
To the following;
<?php if($_product->getTypeId() == "configurable"):
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach($simple_collection as $simple_product){}
endif;
?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getPdfLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/acrobat_reader_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getPsLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/photoshop_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
<?php foreach($simple_collection as $simple_product){ ?>
<a href="<?php echo $simple_product->getIndesignLink(); ?>" target="_blank" style="float: left; margin-left: 15px;" ><img src="<?php echo $this->getSkinUrl('images/indesign_25x25.gif'); ?>" alt="" /></a>
<?php } ?>
The code works, however it actually refers to all of the simple products related to the selected configurable...
How do I get it so it only shows the attributes related to the filtered simple product
Any help is appreciated!