Skip to content

Instantly share code, notes, and snippets.

@corpsefilth
Created April 16, 2015 02:17
Show Gist options
  • Select an option

  • Save corpsefilth/afc4c290b79116e2318e to your computer and use it in GitHub Desktop.

Select an option

Save corpsefilth/afc4c290b79116e2318e to your computer and use it in GitHub Desktop.

Revisions

  1. corpsefilth created this gist Apr 16, 2015.
    19 changes: 19 additions & 0 deletions simpleinfo.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    <?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){
    echo $simple_product->getSku() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "<br>";
    }
    endif;
    ?>

    <?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){
    echo $simple_product->getPrice();
    }
    endif;
    ?>