Last active
August 29, 2015 14:25
-
-
Save WENKz/e2fc4a8eef957a213183 to your computer and use it in GitHub Desktop.
gert configurable product with simple associated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL | E_STRICT); | |
define('MAGENTO_ROOT', getcwd()); | |
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; | |
require_once $mageFilename; | |
Mage::setIsDeveloperMode(true); | |
ini_set('display_errors', 1); | |
Mage::app(); | |
// var_dump($storeId); | |
$products = Mage::getModel('catalog/product')->getCollection()->setStoreId(1) | |
->addAttributeToSelect("name") | |
->addAttributeToSelect("sku") | |
->addStoreFilter(1); | |
foreach($products as $_product){ | |
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; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment